]> git.mxchange.org Git - simgear.git/blobdiff - CMakeLists.txt
Libsvn / APR dependency is removed.
[simgear.git] / CMakeLists.txt
index f25cf760535bb6b777a5ee729358aa20084d10d3..2617f6e4fc4887217ec1fe3cfcce14eb26d9a1a9 100644 (file)
@@ -10,6 +10,8 @@ project(SimGear)
 file(READ version versionFile)
 string(STRIP ${versionFile} SIMGEAR_VERSION)
 
+set(FIND_LIBRARY_USE_LIB64_PATHS ON)
+
 # use simgear version also as the SO version (if building SOs)
 SET(SIMGEAR_SOVERSION ${SIMGEAR_VERSION})
 
@@ -108,11 +110,10 @@ endif()
 
 option(SIMGEAR_HEADLESS "Set to ON to build SimGear without GUI/graphics support" OFF)
 option(JPEG_FACTORY     "Enable JPEG-factory support" OFF)
-option(SG_SVN_CLIENT    "Set to ON to build SimGear with built-in SVN support" OFF)
-option(ENABLE_LIBSVN    "Set to ON to build SimGear with libsvnclient support" ON)
 option(ENABLE_RTI       "Set to ON to build SimGear with RTI support" OFF)
 option(ENABLE_TESTS     "Set to OFF to disable building SimGear's test applications" ON)
 option(ENABLE_SOUND     "Set to OFF to disable building SimGear's sound support" ON)
+option(ENABLE_PKGUTIL   "Set to ON to build the sg_pkgutil application (default)" ON)
 
 if (MSVC)
   GET_FILENAME_COMPONENT(PARENT_DIR ${PROJECT_BINARY_DIR} PATH)
@@ -198,25 +199,6 @@ else()
     message(STATUS "JPEG-factory: DISABLED")
 endif(JPEG_FACTORY)
 
-if (SG_SVN_CLIENT)
-    message(STATUS "Using built-in subversion client code")
-elseif(ENABLE_LIBSVN)
-    find_package(SvnClient)
-
-    if(LIBSVN_FOUND)
-        message(STATUS "Subversion client support: ENABLED")
-        set(HAVE_SVN_CLIENT_H 1)
-        set(HAVE_LIBSVN_CLIENT_1 1)
-    else()
-        # Oops. ENABLE_LIBSVN is ON, but svn is still missing.
-        # Provide clearly visible warning/hint, so builders know what else they should install (or disable).
-        message(WARNING "Failed to enable subversion client support. Unable to find required subversion client library. Some features may not be available (scenery download).")
-        message(WARNING "Install 'libsvn' library/DLL (libsvn-devel/libsvnclient/...). Otherwise disable subversion support (set 'ENABLE_LIBSVN' to 'OFF').")
-    endif(LIBSVN_FOUND)
-else()
-    message(STATUS "Subversion client support: DISABLED")
-endif(SG_SVN_CLIENT)
-
 find_package(ZLIB REQUIRED)
 find_package(Threads REQUIRED)
 
@@ -224,12 +206,19 @@ if (SYSTEM_EXPAT)
     message(STATUS "Requested to use system Expat library, forcing SIMGEAR_SHARED to true")
     set(SIMGEAR_SHARED ON)
     find_package(EXPAT REQUIRED)
-    include_directories(${EXPAT_INCLUDE_DIRS})
+
 else()
     message(STATUS "Using built-in expat code")
-    add_definitions(-DHAVE_EXPAT_CONFIG_H)
+    # XML_STATIC is important to avoid sg_expat_external.h
+    # declaring symbols as declspec(import)
+    add_definitions(-DHAVE_EXPAT_CONFIG_H -DXML_STATIC)
+    set(EXPAT_INCLUDE_DIRS 
+           ${PROJECT_SOURCE_DIR}/3rdparty/expat 
+           ${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)
@@ -343,7 +332,6 @@ 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)
-include_directories(${PROJECT_BINARY_DIR}/simgear/xml)
 
 include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS} 
     ${Boost_INCLUDE_DIRS} 
@@ -361,42 +349,41 @@ configure_file (
   "${PROJECT_BINARY_DIR}/simgear/simgear_config.h"
   )
 
-configure_file (
-    "${PROJECT_SOURCE_DIR}/simgear/xml/expat_config_cmake.in"
-    "${PROJECT_BINARY_DIR}/simgear/xml/expat_config.h"
-)
-
 if(ENABLE_TESTS)
     # enable CTest / make test target
     message(STATUS "Tests: ENABLED")
 
     include (Dart)
     enable_testing()
-
-    if(SIMGEAR_SHARED)
-        set( TEST_LIBS
-            SimGearCore)
-    else()
-        set( TEST_LIBS
-            SimGearCore
-            ${CMAKE_THREAD_LIBS_INIT}
-            ${ZLIB_LIBRARY}
-            ${WINSOCK_LIBRARY}
-            ${RT_LIBRARY}
-            ${CORE_SERVICES_LIBRARY})
-    endif()
-
-    if(NOT SIMGEAR_HEADLESS)
-        set( TEST_LIBS
-            SimGearScene
-            ${TEST_LIBS}
-            ${OPENGL_LIBRARIES})
-    endif()
 else()
     message(STATUS "Tests: DISABLED")
 endif(ENABLE_TESTS)
 
+# always set TEST_LIBS as it is also used by other tools/applications
+# TODO maybe better rename?
+if(SIMGEAR_SHARED)
+    set( TEST_LIBS
+        SimGearCore)
+else()
+    set( TEST_LIBS
+        SimGearCore
+        ${CMAKE_THREAD_LIBS_INIT}
+        ${ZLIB_LIBRARY}
+        ${WINSOCK_LIBRARY}
+        ${RT_LIBRARY}
+        ${CORE_SERVICES_LIBRARY})
+endif()
+
+if(NOT SIMGEAR_HEADLESS)
+    set( TEST_LIBS
+        SimGearScene
+        ${TEST_LIBS}
+        ${OPENGL_LIBRARIES})
+endif()
+
 install (FILES ${PROJECT_BINARY_DIR}/simgear/simgear_config.h  DESTINATION include/simgear/)
+
+add_subdirectory(3rdparty)
 add_subdirectory(simgear)
 
 if (NOT EMBEDDED_SIMGEAR)