CMake: Split the target links and includes into separate CMake modules.
This commit is contained in:
parent
6a730b5820
commit
3b79530b06
4 changed files with 20 additions and 6 deletions
10
CMakeModules/SetupFGFSIncludes.cmake
Normal file
10
CMakeModules/SetupFGFSIncludes.cmake
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
function(setup_fgfs_includes)
|
||||||
|
if(ENABLE_JSBSIM)
|
||||||
|
# FIXME - remove once JSBSim doesn't expose private headers
|
||||||
|
include_directories(${PROJECT_SOURCE_DIR}/src/FDM/JSBSim)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(FG_HAVE_GPERFTOOLS)
|
||||||
|
include_directories(${GooglePerfTools_INCLUDE_DIR})
|
||||||
|
endif()
|
||||||
|
endfunction()
|
|
@ -19,9 +19,6 @@ function(setup_fgfs_libraries target)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ENABLE_JSBSIM)
|
if(ENABLE_JSBSIM)
|
||||||
# FIXME - remove once JSBSim doesn't expose private headers
|
|
||||||
include_directories(${PROJECT_SOURCE_DIR}/src/FDM/JSBSim)
|
|
||||||
|
|
||||||
target_link_libraries(${target} JSBSim)
|
target_link_libraries(${target} JSBSim)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -34,7 +31,6 @@ function(setup_fgfs_libraries target)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(FG_HAVE_GPERFTOOLS)
|
if(FG_HAVE_GPERFTOOLS)
|
||||||
include_directories(${GooglePerfTools_INCLUDE_DIR})
|
|
||||||
target_link_libraries(${target} ${GooglePerfTools_LIBRARIES})
|
target_link_libraries(${target} ${GooglePerfTools_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
include(FlightGearComponent)
|
include(FlightGearComponent)
|
||||||
include(SetupFGFSBundle)
|
include(SetupFGFSBundle)
|
||||||
include(SetupFGFSEmbeddedResources)
|
include(SetupFGFSEmbeddedResources)
|
||||||
|
include(SetupFGFSIncludes)
|
||||||
include(SetupFGFSLibraries)
|
include(SetupFGFSLibraries)
|
||||||
include(SetupMSVCGrouping)
|
include(SetupMSVCGrouping)
|
||||||
|
|
||||||
|
@ -61,6 +62,9 @@ setup_fgfs_embedded_resources()
|
||||||
# Sort the sources and headers for MSVC.
|
# Sort the sources and headers for MSVC.
|
||||||
setup_msvc_grouping()
|
setup_msvc_grouping()
|
||||||
|
|
||||||
|
# Additional search paths for includes.
|
||||||
|
setup_fgfs_includes()
|
||||||
|
|
||||||
# All sources and headers to be built into fgfs.
|
# All sources and headers to be built into fgfs.
|
||||||
get_property(FG_SOURCES GLOBAL PROPERTY FG_SOURCES)
|
get_property(FG_SOURCES GLOBAL PROPERTY FG_SOURCES)
|
||||||
get_property(FG_HEADERS GLOBAL PROPERTY FG_HEADERS)
|
get_property(FG_HEADERS GLOBAL PROPERTY FG_HEADERS)
|
||||||
|
@ -86,7 +90,7 @@ if(APPLE)
|
||||||
setup_fgfs_bundle(fgfs)
|
setup_fgfs_bundle(fgfs)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Set up the target links and includes.
|
# Set up the target links.
|
||||||
setup_fgfs_libraries(fgfs)
|
setup_fgfs_libraries(fgfs)
|
||||||
|
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
# CMake module includes.
|
# CMake module includes.
|
||||||
include(SetupFGFSEmbeddedResources)
|
include(SetupFGFSEmbeddedResources)
|
||||||
|
include(SetupFGFSIncludes)
|
||||||
include(SetupFGFSLibraries)
|
include(SetupFGFSLibraries)
|
||||||
include(SetupMSVCGrouping)
|
include(SetupMSVCGrouping)
|
||||||
|
|
||||||
|
@ -82,6 +83,9 @@ setup_fgfs_embedded_resources()
|
||||||
# Sort the sources and headers for MSVC.
|
# Sort the sources and headers for MSVC.
|
||||||
setup_msvc_grouping()
|
setup_msvc_grouping()
|
||||||
|
|
||||||
|
# Additional search paths for includes.
|
||||||
|
setup_fgfs_includes()
|
||||||
|
|
||||||
# All sources and headers to be built into the test suite.
|
# All sources and headers to be built into the test suite.
|
||||||
get_property(FG_SOURCES GLOBAL PROPERTY FG_SOURCES)
|
get_property(FG_SOURCES GLOBAL PROPERTY FG_SOURCES)
|
||||||
get_property(FG_HEADERS GLOBAL PROPERTY FG_HEADERS)
|
get_property(FG_HEADERS GLOBAL PROPERTY FG_HEADERS)
|
||||||
|
@ -121,7 +125,7 @@ add_custom_target(test_suite
|
||||||
COMMENT ${TEST_SUITE_COMMENT}
|
COMMENT ${TEST_SUITE_COMMENT}
|
||||||
)
|
)
|
||||||
|
|
||||||
# Set up the target links and includes.
|
# Set up the target links.
|
||||||
setup_fgfs_libraries(run_test_suite)
|
setup_fgfs_libraries(run_test_suite)
|
||||||
|
|
||||||
# Additional libraries just for the test suite.
|
# Additional libraries just for the test suite.
|
||||||
|
|
Loading…
Add table
Reference in a new issue