1
0
Fork 0
flightgear/utils/fgcom/CMakeLists.txt
James Turner e4e2b34a4c FGCom OpenAL CMake fixes
Ensure we detect OpenAL the way IAXClient expects, and set it up as
a dependency of IAXClient, not FGCom.
2020-08-23 11:31:37 +01:00

32 lines
819 B
CMake

set(name fgcom)
# Copy positions.txt content in const char* _positionsData[];
file(READ utils/positions.txt POSITIONS_DATA)
string(REGEX REPLACE "\n" "\"%
\"" POSITIONS_DATA ${POSITIONS_DATA})
string(REGEX REPLACE "%" "," POSITIONS_DATA ${POSITIONS_DATA})
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};")
if(MSVC)
set(RESOURCE_FILE fgcom.rc)
endif(MSVC)
set(SOURCES fgcom_external.cxx)
set(HEADERS fgcom_external.hxx ${out_file})
add_executable(${name}
${SOURCES}
${HEADERS}
${RESOURCE_FILE}
)
target_link_Libraries(${name}
iaxclient_lib
SimGearCore)
install(TARGETS ${name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})