1 # 20130904 - build of fgcom standalone - geoff
4 set( RESOURCE_FILE fgcom.rc )
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")
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")
17 set(DEFAULT_POSITIONS_FILE "../share/flightgear/positions.txt")
18 set(SPECIAL_FREQUENCIES_FILE "../share/flightgear/special_frequencies.txt")
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")
26 # pass these to the compiler
27 add_definitions( -DDEFAULT_POSITIONS_FILE="${DEFAULT_POSITIONS_FILE}" )
28 add_definitions( -DSPECIAL_FREQUENCIES_FILE="${SPECIAL_FREQUENCIES_FILE}" )
30 # Project fgcom, type Console Application
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 )
35 list(APPEND ${name}_SOURCES fgcom_getopt.c)
36 list(APPEND ${name}_HEADERS fgcom_getopt.h)
38 add_executable( ${name} ${${name}_SOURCES} ${${name}_HEADERS} )
40 set_target_properties( ${name} PROPERTIES DEBUG_POSTFIX d )
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}
48 ${SIMGEAR_CORE_LIBRARIES}
49 ${SIMGEAR_CORE_LIBRARY_DEPENDENCIES} )
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})