1
0
Fork 0

CMake: The main sources/headers have been shifted into FG_{SOURCES,HEADERS}.

This allows the sources and headers in src/Main/ to be used by other targets.
They are grouped into the new "Main" flightgear component via the macro in the
FlightGearComponent CMake module.  The bootstrap.cxx file with its main function
has been separated out into a separate variable MAIN_SOURCE for use by the fgfs
binary.

All these files have therefore been removed from the test_suite CMakeLists.txt
file, as they are added via FG_SOURCES and FG_HEADERS.  The MSVC grouping code
also does not need to deal with the now deleted separate SOURCE and HEADER
variables for these files.
This commit is contained in:
Edward d'Auvergne 2018-03-26 20:27:12 +02:00
parent e88017eba3
commit 6a730b5820
3 changed files with 12 additions and 54 deletions

View file

@ -16,7 +16,4 @@ function(setup_msvc_grouping)
list(REMOVE_AT g2 0) list(REMOVE_AT g2 0)
source_group("${name}\\Headers" FILES ${g2}) source_group("${name}\\Headers" FILES ${g2})
endforeach() endforeach()
source_group("Main\\Headers" FILES ${HEADERS})
source_group("Main\\Sources" FILES ${SOURCES})
endfunction() endfunction()

View file

@ -1,15 +1,16 @@
# CMake module includes. # CMake module includes.
include(FlightGearComponent)
include(SetupFGFSBundle) include(SetupFGFSBundle)
include(SetupFGFSEmbeddedResources) include(SetupFGFSEmbeddedResources)
include(SetupFGFSLibraries) include(SetupFGFSLibraries)
include(SetupMSVCGrouping) include(SetupMSVCGrouping)
# Set up the Main FG file sources and headers (excluding bootstrap.cxx and its main() function).
if(MSVC) if(MSVC)
set(RESOURCE_FILE flightgear.rc) set(MS_RESOURCE_FILE flightgear.rc)
endif(MSVC) endif(MSVC)
set(SOURCES set(SOURCES
bootstrap.cxx
fg_commands.cxx fg_commands.cxx
fg_init.cxx fg_init.cxx
fg_io.cxx fg_io.cxx
@ -26,7 +27,7 @@ set(SOURCES
screensaver_control.cxx screensaver_control.cxx
subsystemFactory.cxx subsystemFactory.cxx
util.cxx util.cxx
${RESOURCE_FILE} ${MS_RESOURCE_FILE}
) )
set(HEADERS set(HEADERS
@ -47,6 +48,13 @@ set(HEADERS
util.hxx util.hxx
) )
flightgear_component(Main "${SOURCES}" "${HEADERS}")
# The main() function.
set(MAIN_SOURCE
bootstrap.cxx
)
# Set up the embedded resources. # Set up the embedded resources.
setup_fgfs_embedded_resources() setup_fgfs_embedded_resources()
@ -66,8 +74,7 @@ get_property(EMBEDDED_RESOURCE_HEADERS GLOBAL PROPERTY EMBEDDED_RESOURCE_HEADERS
add_executable(fgfs add_executable(fgfs
WIN32 WIN32
MACOSX_BUNDLE MACOSX_BUNDLE
${SOURCES} ${MAIN_SOURCE}
${HEADERS}
${FG_SOURCES} ${FG_SOURCES}
${FG_HEADERS} ${FG_HEADERS}
${EMBEDDED_RESOURCE_SOURCES} ${EMBEDDED_RESOURCE_SOURCES}

View file

@ -76,50 +76,6 @@ add_test(SimgearPropsSimgearUnitTests ${TESTSUITE_OUTPUT_DIR}/run_test_suite --c
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Set up the binary. # Set up the binary.
# Set up the Main FG file sources and headers (excluding bootstrap.cxx and its main() function).
if(MSVC)
set(RESOURCE_FILE ${PROJECT_SOURCE_DIR}/src/Main/flightgear.rc)
endif(MSVC)
set(MAIN_SOURCES
#${PROJECT_SOURCE_DIR}/src/Main/bootstrap.cxx
${PROJECT_SOURCE_DIR}/src/Main/fg_commands.cxx
${PROJECT_SOURCE_DIR}/src/Main/fg_init.cxx
${PROJECT_SOURCE_DIR}/src/Main/fg_io.cxx
${PROJECT_SOURCE_DIR}/src/Main/fg_os_common.cxx
${PROJECT_SOURCE_DIR}/src/Main/fg_scene_commands.cxx
${PROJECT_SOURCE_DIR}/src/Main/fg_props.cxx
${PROJECT_SOURCE_DIR}/src/Main/FGInterpolator.cxx
${PROJECT_SOURCE_DIR}/src/Main/globals.cxx
${PROJECT_SOURCE_DIR}/src/Main/locale.cxx
${PROJECT_SOURCE_DIR}/src/Main/logger.cxx
${PROJECT_SOURCE_DIR}/src/Main/main.cxx
${PROJECT_SOURCE_DIR}/src/Main/options.cxx
${PROJECT_SOURCE_DIR}/src/Main/positioninit.cxx
${PROJECT_SOURCE_DIR}/src/Main/screensaver_control.cxx
${PROJECT_SOURCE_DIR}/src/Main/subsystemFactory.cxx
${PROJECT_SOURCE_DIR}/src/Main/util.cxx
${RESOURCE_FILE}
)
set(MAIN_HEADERS
${PROJECT_SOURCE_DIR}/src/Main/AircraftDirVisitorBase.hxx
${PROJECT_SOURCE_DIR}/src/Main/fg_commands.hxx
${PROJECT_SOURCE_DIR}/src/Main/fg_init.hxx
${PROJECT_SOURCE_DIR}/src/Main/fg_io.hxx
${PROJECT_SOURCE_DIR}/src/Main/fg_props.hxx
${PROJECT_SOURCE_DIR}/src/Main/FGInterpolator.hxx
${PROJECT_SOURCE_DIR}/src/Main/globals.hxx
${PROJECT_SOURCE_DIR}/src/Main/locale.hxx
${PROJECT_SOURCE_DIR}/src/Main/logger.hxx
${PROJECT_SOURCE_DIR}/src/Main/main.hxx
${PROJECT_SOURCE_DIR}/src/Main/options.hxx
${PROJECT_SOURCE_DIR}/src/Main/positioninit.hxx
${PROJECT_SOURCE_DIR}/src/Main/screensaver_control.hxx
${PROJECT_SOURCE_DIR}/src/Main/subsystemFactory.hxx
${PROJECT_SOURCE_DIR}/src/Main/util.hxx
)
# Set up the embedded resources. # Set up the embedded resources.
setup_fgfs_embedded_resources() setup_fgfs_embedded_resources()
@ -138,8 +94,6 @@ add_executable(run_test_suite
${FG_HEADERS} ${FG_HEADERS}
${EMBEDDED_RESOURCE_SOURCES} ${EMBEDDED_RESOURCE_SOURCES}
${EMBEDDED_RESOURCE_HEADERS} ${EMBEDDED_RESOURCE_HEADERS}
${MAIN_SOURCES}
${MAIN_HEADERS}
${TESTSUITE_SOURCES} ${TESTSUITE_SOURCES}
${TESTSUITE_HEADERS} ${TESTSUITE_HEADERS}
) )