c92c41a50f
Remove use of BUILDING_TESTSUITE from headers. Where possible, move test APIs to their own file in the test_suite dir (testApis.cxx). For some others, add them to a special list of ‘sources which depend on the build mode’. This will hopefully go away with some further refactoring.
36 lines
1.3 KiB
CMake
36 lines
1.3 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()
|
|
|
|
# third argument is TEST_SOURCES
|
|
foreach(t ${ARGV3})
|
|
set_property(GLOBAL
|
|
APPEND PROPERTY FG_TEST_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/${t}")
|
|
set(fc "${fh}#${CMAKE_CURRENT_SOURCE_DIR}/${t}")
|
|
endforeach()
|
|
|
|
set_property(GLOBAL APPEND PROPERTY FG_GROUPS_C "${fc}@")
|
|
set_property(GLOBAL APPEND PROPERTY FG_GROUPS_H "${fh}@")
|
|
|
|
endmacro()
|