X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=CMakeLists.txt;h=328dfdd0b791b4fd2e09a6bb5400956c840e1051;hb=4993a5c6c04c32f62af801e03315ef481a6a1d47;hp=d12183e137b718e7d5b3543f80a631e2472dae0c;hpb=b4c8b00c0e5b31db95f1e54ad5d62685386acd9e;p=simgear.git diff --git a/CMakeLists.txt b/CMakeLists.txt index d12183e1..328dfdd0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -74,6 +74,7 @@ option(JPEG_FACTORY "Enable JPEG-factory 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(SYSTEM_EXPAT "Set to ON to build SimGear using the system libExpat" OFF) if (MSVC) GET_FILENAME_COMPONENT(PARENT_DIR ${PROJECT_SOURCE_DIR} PATH) @@ -94,11 +95,13 @@ endif (MSVC) if (MSVC AND MSVC_3RDPARTY_ROOT) message(STATUS "3rdparty files located in ${MSVC_3RDPARTY_ROOT}") set( OSG_MSVC "msvc" ) - if (${MSVC_VERSION} EQUAL 1600) + if (${MSVC_VERSION} EQUAL 1700) + set( OSG_MSVC ${OSG_MSVC}110 ) + elseif (${MSVC_VERSION} EQUAL 1600) set( OSG_MSVC ${OSG_MSVC}100 ) - else (${MSVC_VERSION} EQUAL 1600) + else (${MSVC_VERSION} EQUAL 1700) set( OSG_MSVC ${OSG_MSVC}90 ) - endif (${MSVC_VERSION} EQUAL 1600) + endif (${MSVC_VERSION} EQUAL 1700) if (CMAKE_CL_64) set( OSG_MSVC ${OSG_MSVC}-64 ) set( MSVC_3RDPARTY_DIR 3rdParty.x64 ) @@ -166,6 +169,16 @@ endif(ENABLE_LIBSVN) find_package(ZLIB REQUIRED) find_package(Threads REQUIRED) +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) +endif(SYSTEM_EXPAT) + check_include_file(sys/time.h HAVE_SYS_TIME_H) check_include_file(sys/timeb.h HAVE_SYS_TIMEB_H) check_include_file(unistd.h HAVE_UNISTD_H) @@ -248,7 +261,7 @@ if(WIN32) # SET(WARNING_FLAGS "${WARNING_FLAGS} /wd${warning}") # endforeach(warning) - set(MSVC_FLAGS "-DWIN32 -DNOMINMAX -D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -D__CRT_NONSTDC_NO_WARNINGS /wd4996") + set(MSVC_FLAGS "-DWIN32 -DNOMINMAX -D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -D__CRT_NONSTDC_NO_WARNINGS /wd4996 /wd4250") endif(MSVC) # assumed on Windows @@ -270,7 +283,6 @@ include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS} ${OPENAL_INCLUDE_DIR} ) add_definitions(-DHAVE_CONFIG_H) -add_definitions(-DHAVE_EXPAT_CONFIG_H) # configure a header file to pass some of the CMake settings # to the source code