]> git.mxchange.org Git - flightgear.git/blob - utils/fgcom/CMakeLists.txt
FGCom standalone: .txt destination can be tweaked with -DFGCOM_DATA_PATH
[flightgear.git] / utils / fgcom / CMakeLists.txt
1 # 20130904 - build of fgcom standalone - geoff
2
3     if (MSVC)
4       set( RESOURCE_FILE fgcom.rc )
5     endif (MSVC)
6
7     if (NOT FGCOM_DATA_PATH)
8         # use relative paths (for standalone and custom installation)
9         set(FGCOM_DATA_PATH "${CMAKE_INSTALL_PREFIX}/share/flightgear")
10         if (APPLE)
11             # on Mac "share" directory doesn't exist
12             # .txt files are moved in the Resources directory because of Mac convention
13             # This movement is handled by the fgmeta.git/hudson_mac_package_release.rb line 139
14             set(DEFAULT_POSITIONS_FILE "../Resources/positions.txt")
15             set(SPECIAL_FREQUENCIES_FILE "../Resources/special_frequencies.txt")
16         else (APPLE)
17             set(DEFAULT_POSITIONS_FILE "../share/flightgear/positions.txt")
18             set(SPECIAL_FREQUENCIES_FILE "../share/flightgear/special_frequencies.txt")
19         endif (APPLE)
20     else()
21         # use absolute paths, useful for package creation (e.g -DFGCOM_DATA_PATH=/usr/share/fgcom)
22         set(DEFAULT_POSITIONS_FILE "${FGCOM_DATA_PATH}/positions.txt")
23         set(SPECIAL_FREQUENCIES_FILE "${FGCOM_DATA_PATH}/special_frequencies.txt")
24     endif()
25
26     # pass these to the compiler
27     add_definitions( -DDEFAULT_POSITIONS_FILE="${DEFAULT_POSITIONS_FILE}" )
28     add_definitions( -DSPECIAL_FREQUENCIES_FILE="${SPECIAL_FREQUENCIES_FILE}" )
29
30     # Project fgcom, type Console Application
31     set(name fgcom)
32     set( ${name}_SOURCES fgcom.cxx fgcom_init.cxx position.cxx utils.cxx ${RESOURCE_FILE} )
33     set( ${name}_HEADERS fgcom.hxx fgcom_init.hxx position.hxx utils.hxx )
34     if(WIN32)
35         list(APPEND ${name}_SOURCES fgcom_getopt.c)
36         list(APPEND ${name}_HEADERS fgcom_getopt.h)
37     endif()
38     add_executable( ${name} ${${name}_SOURCES} ${${name}_HEADERS} )
39     if(WIN32)
40         set_target_properties( ${name} PROPERTIES DEBUG_POSTFIX d )
41     endif()
42     target_link_libraries( ${name} iaxclient_lib )
43     # this could be just on a target basis, but for now
44     include_directories( ${CMAKE_SOURCE_DIR}/3rdparty/iaxclient/lib ) # for iaxclient.h
45     # Now include simgear libraries 
46     target_link_Libraries( ${name}
47         ${OPENAL_LIBRARY}
48         ${SIMGEAR_CORE_LIBRARIES}
49         ${SIMGEAR_CORE_LIBRARY_DEPENDENCIES} )
50     # deal with install
51     install(TARGETS ${name} RUNTIME DESTINATION bin)
52     # then install, from their source to install destination
53     set( inst_FILES utils/positions.txt
54         utils/special_frequencies.txt )
55     install(FILES ${inst_FILES} DESTINATION ${FGCOM_DATA_PATH})
56 # eof