1
0
Fork 0

CMake: Split the target links and includes into separate CMake modules.

This commit is contained in:
Edward d'Auvergne 2018-03-26 22:27:25 +02:00
parent 6a730b5820
commit 3b79530b06
4 changed files with 20 additions and 6 deletions

View 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()

View file

@ -19,9 +19,6 @@ function(setup_fgfs_libraries target)
endif()
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)
endif()
@ -34,7 +31,6 @@ function(setup_fgfs_libraries target)
endif()
if(FG_HAVE_GPERFTOOLS)
include_directories(${GooglePerfTools_INCLUDE_DIR})
target_link_libraries(${target} ${GooglePerfTools_LIBRARIES})
endif()

View file

@ -2,6 +2,7 @@
include(FlightGearComponent)
include(SetupFGFSBundle)
include(SetupFGFSEmbeddedResources)
include(SetupFGFSIncludes)
include(SetupFGFSLibraries)
include(SetupMSVCGrouping)
@ -61,6 +62,9 @@ setup_fgfs_embedded_resources()
# Sort the sources and headers for MSVC.
setup_msvc_grouping()
# Additional search paths for includes.
setup_fgfs_includes()
# All sources and headers to be built into fgfs.
get_property(FG_SOURCES GLOBAL PROPERTY FG_SOURCES)
get_property(FG_HEADERS GLOBAL PROPERTY FG_HEADERS)
@ -86,7 +90,7 @@ if(APPLE)
setup_fgfs_bundle(fgfs)
endif()
# Set up the target links and includes.
# Set up the target links.
setup_fgfs_libraries(fgfs)
if (APPLE)

View file

@ -1,5 +1,6 @@
# CMake module includes.
include(SetupFGFSEmbeddedResources)
include(SetupFGFSIncludes)
include(SetupFGFSLibraries)
include(SetupMSVCGrouping)
@ -82,6 +83,9 @@ setup_fgfs_embedded_resources()
# Sort the sources and headers for MSVC.
setup_msvc_grouping()
# Additional search paths for includes.
setup_fgfs_includes()
# All sources and headers to be built into the test suite.
get_property(FG_SOURCES GLOBAL PROPERTY FG_SOURCES)
get_property(FG_HEADERS GLOBAL PROPERTY FG_HEADERS)
@ -121,7 +125,7 @@ add_custom_target(test_suite
COMMENT ${TEST_SUITE_COMMENT}
)
# Set up the target links and includes.
# Set up the target links.
setup_fgfs_libraries(run_test_suite)
# Additional libraries just for the test suite.