]> git.mxchange.org Git - simgear.git/blobdiff - CMakeLists.txt
SGPath: fix creating paths with permission checker.
[simgear.git] / CMakeLists.txt
index 364aec23e7509280f43495fb9913f02d437bca32..7af05c81f267c4ebbf03fb2514776d9379cc008b 100644 (file)
@@ -163,6 +163,9 @@ if(APPLE)
   find_library(COCOA_LIBRARY Cocoa)
 endif()
 
+# Somehow this only works if included before searching for Boost...
+include(BoostTestTargets)
+
 find_package(Boost REQUIRED)
 set (BOOST_CXX_FLAGS "-DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DBOOST_BIMAP_DISABLE_SERIALIZATION")
 
@@ -260,7 +263,9 @@ check_cxx_source_compiles(
 
 if(HAVE_DLFCN_H)
     check_library_exists(dl dlerror "" HAVE_DL)
-    set(DL_LIBRARY "dl")
+    if(HAVE_DL)
+        set(DL_LIBRARY "dl")
+    endif()
 endif()
 
 SET(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "add a postfix, usually 'd' on windows")
@@ -333,9 +338,11 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS_C} ${MSVC_FLAGS}")
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS_CXX} ${MSVC_FLAGS} ${BOOST_CXX_FLAGS}")
 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${MSVC_LD_FLAGS}")
 
-include_directories(${PROJECT_SOURCE_DIR})
-include_directories(${PROJECT_SOURCE_DIR}/simgear/canvas/ShivaVG/include)
-include_directories(${PROJECT_BINARY_DIR}/simgear)
+# use BEFORE to ensure local directories are used first, 
+# ahead of system-installed libs
+include_directories(BEFORE ${PROJECT_SOURCE_DIR})
+include_directories(BEFORE ${PROJECT_SOURCE_DIR}/simgear/canvas/ShivaVG/include)
+include_directories(BEFORE ${PROJECT_BINARY_DIR}/simgear)
 
 include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS} 
     ${Boost_INCLUDE_DIRS}