From 044715ba05c537953a3a37087e6901375b174533 Mon Sep 17 00:00:00 2001 From: Bertrand Coconnier Date: Sat, 4 Feb 2017 22:53:22 +0100 Subject: [PATCH] CMake commands TRY_COMPILE and TRY_RUN are ignoring the instructions from INCLUDE_DIRECTORIES so the include directory has to specified ad hoc. --- CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 028e9664b..b2b7b7854 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -359,9 +359,9 @@ endif(ENABLE_RTI) # Check if the flag ENABLE_SIMD was enabled during the compilation of SimGear. # The same value has to be carried over for FlightGear to prevent crashes. -include_directories(${SIMGEAR_INCLUDE_DIRS}) try_run(ENABLE_SIMD COMPILE_RESULT_TEST_SIMD ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/tests/test-simd-enabled.c) + ${CMAKE_CURRENT_SOURCE_DIR}/tests/test-simd-enabled.c + CMAKE_FLAGS "-DINCLUDE_DIRECTORIES=${SIMGEAR_INCLUDE_DIRS}") if (COMPILE_RESULT_TEST_SIMD AND ENABLE_SIMD AND NOT (ENABLE_SIMD EQUAL FAILED_TO_RUN)) @@ -448,6 +448,7 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${MSVC_LD_FLAGS}") include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${OPENGL_INCLUDE_DIR} + ${SIMGEAR_INCLUDE_DIRS} ${PLIB_INCLUDE_DIR} ${SQLITE3_INCLUDED_DIR} )