diff --git a/CMakeLists.txt b/CMakeLists.txt index 43126d48..8476da63 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -207,17 +207,14 @@ else() if (ENABLE_SOUND) if (USE_AEONWAVE) find_package(AAX COMPONENTS aax REQUIRED) - include_directories( ${AAX_INCLUDE_DIR} ) else() find_package(OpenAL REQUIRED) - include_directories( ${OPENAL_INCLUDE_DIR} ) endif() message(STATUS "Sound support: ENABLED") endif(ENABLE_SOUND) find_package(OpenSceneGraph 3.2.0 REQUIRED osgText osgSim osgDB osgParticle osgGA osgViewer osgUtil) - include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS}) if (MSVC) set(CMAKE_REQUIRED_INCLUDES ${OPENSCENEGRAPH_INCLUDE_DIRS}) @@ -253,8 +250,6 @@ else() ${PROJECT_BINARY_DIR}/3rdparty/expat) endif(SYSTEM_EXPAT) -include_directories(${EXPAT_INCLUDE_DIRS}) - check_include_file(inttypes.h HAVE_INTTYPES_H) check_include_file(sys/time.h HAVE_SYS_TIME_H) check_include_file(sys/timeb.h HAVE_SYS_TIMEB_H) @@ -413,12 +408,6 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${MSVC_LD_FLAGS}") # ahead of system-installed libs include_directories(BEFORE ${PROJECT_BINARY_DIR}/simgear) -include_directories( - ${Boost_INCLUDE_DIRS} - ${ZLIB_INCLUDE_DIR} - ${CURL_INCLUDE_DIRS} -) - add_definitions(-DHAVE_CONFIG_H) # configure a header file to pass some of the CMake settings diff --git a/simgear/CMakeLists.txt b/simgear/CMakeLists.txt index 1759d7a5..27fb6bac 100644 --- a/simgear/CMakeLists.txt +++ b/simgear/CMakeLists.txt @@ -112,6 +112,12 @@ target_include_directories(SimGearCore BEFORE PUBLIC $ $) +target_include_directories(SimGearCore PUBLIC ${Boost_INCLUDE_DIRS}) +target_include_directories(SimGearCore PRIVATE + ${EXPAT_INCLUDE_DIRS} + ${ZLIB_INCLUDE_DIR} + ${CURL_INCLUDE_DIRS}) + install(TARGETS SimGearCore EXPORT SimGearTargets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} @@ -127,6 +133,13 @@ if (NOT SIMGEAR_HEADLESS) $ $) + target_include_directories(SimGearScene PUBLIC ${OPENSCENEGRAPH_INCLUDE_DIRS}) + + if (USE_AEONWAVE) + target_include_directories(SimGearScene PRIVATE ${AAX_INCLUDE_DIR} ) + else() + target_include_directories(SimGearScene PRIVATE ${OPENAL_INCLUDE_DIR} ) + endif() endif()