1
0
Fork 0
flightgear/CMakeModules/FlightGearComponent.cmake
James Turner 33e205f123 Switch to using OBJECT library for main build
Allows sharing object files between the fgfs and test_suite targets, in
a follow-up commit.
2021-03-08 16:59:14 +00:00

29 lines
1 KiB
CMake

macro(flightgear_component name sources)
set(fc ${name})
set(fh ${name})
foreach(s ${sources})
set_property(GLOBAL
APPEND PROPERTY FG_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/${s}")
set(fc "${fc}#${CMAKE_CURRENT_SOURCE_DIR}/${s}")
# becuase we can't require CMake 3.13, we can't use CMP0076
# so we need to manually resolve relative paths into absolute paths
target_sources(fgfsObjects PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/${s})
endforeach()
foreach(h ${ARGV2})
set_property(GLOBAL
APPEND PROPERTY FG_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/${h}")
set(fh "${fh}#${CMAKE_CURRENT_SOURCE_DIR}/${h}")
# becuase we can't require CMake 3.13, we can't use CMP0076
# so we need to manually resolve relative paths into absolute paths
target_sources(fgfsObjects PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/${h})
endforeach()
set_property(GLOBAL APPEND PROPERTY FG_GROUPS_C "${fc}@")
set_property(GLOBAL APPEND PROPERTY FG_GROUPS_H "${fh}@")
endmacro()