]> git.mxchange.org Git - flightgear.git/commitdiff
Support optionally embedding simgear.
authorJames Turner <zakalawe@mac.com>
Sat, 26 Jan 2013 14:32:18 +0000 (15:32 +0100)
committerJames Turner <zakalawe@mac.com>
Sat, 26 Jan 2013 14:32:18 +0000 (15:32 +0100)
CMakeLists.txt

index 20f367733f6a55f3b3212e6a21d9c22ed8b6c9ac..0aaf7c318a52e99c9395cece85464a24e50e933e 100644 (file)
@@ -230,8 +230,27 @@ list(APPEND SQLITE3_LIBRARY ${CMAKE_THREAD_LIBS_INIT})
 
 find_package(PLIB REQUIRED puaux pu js fnt)
 
-# FlightGear and SimGear versions need to match
-find_package(SimGear ${FLIGHTGEAR_VERSION} REQUIRED)
+if (EMBEDDED_SIMGEAR)
+    message(STATUS "Using embedded SimGear");
+    # create the same variables that FindSimGear would define
+    set(SIMGEAR_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/simgear)
+    set(SIMGEAR_CORE_LIBRARIES SimGearCore)
+    set(SIMGEAR_LIBRARIES SimGearScene)
+
+    if (NOT SIMGEAR_SHARED)
+        set(SIMGEAR_CORE_LIBRARY_DEPENDENCIES
+            ${CMAKE_THREAD_LIBS_INIT}
+            ${ZLIB_LIBRARY}
+            ${LIBSVN_LIBRARIES}
+            ${WINMM_LIBRARY})
+
+        set(SIMGEAR_SCENE_LIBRARY_DEPENDENCIES 
+            ${OPENAL_LIBRARY})
+    endif()
+else(EMBEDDED_SIMGEAR)
+    # FlightGear and SimGear versions need to match
+    find_package(SimGear ${FLIGHTGEAR_VERSION} REQUIRED)
+endif (EMBEDDED_SIMGEAR)
 
 if (JPEG_FACTORY)
     # check simgear was built with JPEG-factory support
@@ -335,6 +354,14 @@ configure_file (
     "${PROJECT_BINARY_DIR}/src/Include/version.h"
 )
 
+if (EMBEDDED_SIMGEAR)
+    add_subdirectory(simgear)
+    # since we build without SimGear installed, we need to
+    # search this path directly to find the generated
+    # simgear_config.h
+    include_directories(${PROJECT_BINARY_DIR}/simgear)
+endif(EMBEDDED_SIMGEAR)
+
 add_subdirectory(src)
 add_subdirectory(utils)
 add_subdirectory(man)