]> git.mxchange.org Git - flightgear.git/blobdiff - CMakeLists.txt
Make units of a function explicit.
[flightgear.git] / CMakeLists.txt
index 2ad040b44d21337a2e2ff0ad755e6fc7e8a5be95..33fb5464c351468c632d6bda29ef5b1623e41a0f 100644 (file)
@@ -96,7 +96,7 @@ endif()
 if(NOT MSVC)
     # TBD: are these really necessary? Aren't they considered by cmake automatically?
     list(APPEND ADDITIONAL_LIBRARY_PATHS
-         /local
+         /opt/local
          /usr/local
          /usr)
 endif()
@@ -144,7 +144,17 @@ option(SYSTEM_SQLITE     "Set to ON to build FlightGear with the system's SQLite
 
 # additional utilities
 option(ENABLE_FGADMIN    "Set to ON to build the FGADMIN application (default)" ON)
+option(ENABLE_FGELEV     "Set to ON to build the fgelev application (default)" ON)
 option(WITH_FGPANEL      "Set to ON to build the fgpanel application (default)" ON)
+option(ENABLE_FGVIEWER   "Set to ON to build the fgviewer application (default)" ON)
+option(ENABLE_GPSSMOOTH  "Set to ON to build the GPSsmooth application (default)" ON)
+option(ENABLE_TERRASYNC  "Set to ON to build the terrasync application (default)" ON)
+
+option(ENABLE_FGJS       "Set to ON to build the fgjs application (default)" ON)
+option(ENABLE_JS_DEMO    "Set to ON to build the js_demo application (default)" ON)
+
+option(ENABLE_METAR      "Set to ON to build the metar application (default)" ON)
+
 option(ENABLE_TESTS      "Set to ON to build test applications (default)" ON)
 
 if(LOGGING)
@@ -230,8 +240,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
@@ -264,10 +293,13 @@ if(ENABLE_PROFILE)
 endif()
 
 if(ENABLE_RTI)
+    message(STATUS "RTI: ENABLED")
     find_package(RTI)
     if(RTI_FOUND)
         set(FG_HAVE_HLA 1)
     endif(RTI_FOUND)
+else()
+    message(STATUS "RTI: DISABLED")
 endif(ENABLE_RTI)
 
 if(CMAKE_COMPILER_IS_GNUCXX)
@@ -288,7 +320,7 @@ if(WIN32)
         #     SET(WARNING_FLAGS "${WARNING_FLAGS} /wd${warning}")
         # endforeach(warning)
 
-        set(MSVC_FLAGS "-DNOMINMAX -D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS -D__CRT_NONSTDC_NO_WARNINGS")
+        set(MSVC_FLAGS "-DNOMINMAX -D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS -D__CRT_NONSTDC_NO_WARNINGS -Dstrdup=_strdup")
         if (${MSVC_VERSION} GREATER 1599)
             set( MSVC_LD_FLAGS "/FORCE:MULTIPLE" )
         endif (${MSVC_VERSION} GREATER 1599)
@@ -335,6 +367,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)