2014-08-19 18:46:42 +00:00
|
|
|
set(name fgcom)
|
2013-09-27 14:05:45 +00:00
|
|
|
|
2014-08-19 18:46:42 +00:00
|
|
|
# Copy positions.txt content in const char* _positionsData[];
|
|
|
|
file(READ utils/positions.txt POSITIONS_DATA)
|
|
|
|
string(REGEX REPLACE "\n" "\"%
|
2020-08-19 13:49:50 +00:00
|
|
|
\"" POSITIONS_DATA ${POSITIONS_DATA})
|
2014-08-19 18:46:42 +00:00
|
|
|
string(REGEX REPLACE "%" "," POSITIONS_DATA ${POSITIONS_DATA})
|
2020-08-19 13:49:50 +00:00
|
|
|
|
|
|
|
set(out_file ${CMAKE_BINARY_DIR}/positions.hxx)
|
|
|
|
|
|
|
|
file(WRITE ${out_file} "const char* _positionsData[] = {\n\"")
|
|
|
|
file(APPEND ${out_file} ${POSITIONS_DATA})
|
|
|
|
file(APPEND ${out_file} "\"\n};")
|
2013-10-31 13:07:31 +00:00
|
|
|
|
2014-08-19 18:46:42 +00:00
|
|
|
if(MSVC)
|
|
|
|
set(RESOURCE_FILE fgcom.rc)
|
|
|
|
endif(MSVC)
|
2013-11-27 12:48:14 +00:00
|
|
|
|
2020-08-19 13:49:50 +00:00
|
|
|
set(SOURCES fgcom_external.cxx)
|
|
|
|
set(HEADERS fgcom_external.hxx ${out_file})
|
2013-09-27 14:05:45 +00:00
|
|
|
|
2014-08-19 18:46:42 +00:00
|
|
|
add_executable(${name}
|
|
|
|
${SOURCES}
|
|
|
|
${HEADERS}
|
|
|
|
${RESOURCE_FILE}
|
|
|
|
)
|
|
|
|
|
|
|
|
target_link_Libraries(${name}
|
|
|
|
iaxclient_lib
|
2020-08-19 13:49:50 +00:00
|
|
|
SimGearCore)
|
2014-08-19 18:46:42 +00:00
|
|
|
|
2016-07-09 21:14:28 +00:00
|
|
|
install(TARGETS ${name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|