X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=CMakeLists.txt;h=328dfdd0b791b4fd2e09a6bb5400956c840e1051;hb=4993a5c6c04c32f62af801e03315ef481a6a1d47;hp=b4420de0097404888bcee4d91a93824745961121;hpb=c84e1d0f0e8a945160264547e9613d61ea945b5f;p=simgear.git diff --git a/CMakeLists.txt b/CMakeLists.txt index b4420de0..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 ) @@ -108,27 +111,34 @@ if (MSVC AND MSVC_3RDPARTY_ROOT) set (CMAKE_LIBRARY_PATH ${MSVC_3RDPARTY_ROOT}/${MSVC_3RDPARTY_DIR}/lib ${MSVC_3RDPARTY_ROOT}/install/${OSG_MSVC}/OpenScenegraph/lib ) set (CMAKE_INCLUDE_PATH ${MSVC_3RDPARTY_ROOT}/${MSVC_3RDPARTY_DIR}/include ${MSVC_3RDPARTY_ROOT}/install/${OSG_MSVC}/OpenScenegraph/include) - set (BOOST_ROOT ${MSVC_3RDPARTY_ROOT}/boost_1_44_0) + find_path(BOOST_ROOT boost/version.hpp + ${MSVC_3RDPARTY_ROOT}/boost + ${MSVC_3RDPARTY_ROOT}/boost_1_51_0 + ${MSVC_3RDPARTY_ROOT}/boost_1_50_0 + ${MSVC_3RDPARTY_ROOT}/boost_1_49_0 + ${MSVC_3RDPARTY_ROOT}/boost_1_48_0 + ${MSVC_3RDPARTY_ROOT}/boost_1_47_0 + ${MSVC_3RDPARTY_ROOT}/boost_1_46_1 + ${MSVC_3RDPARTY_ROOT}/boost_1_46_0 + ${MSVC_3RDPARTY_ROOT}/boost_1_45_0 + ${MSVC_3RDPARTY_ROOT}/boost_1_44_0 + ) + # set (BOOST_ROOT ${MSVC_3RDPARTY_ROOT}/boost_1_44_0) message(STATUS "BOOST_ROOT is ${BOOST_ROOT}") set (OPENAL_INCLUDE_DIR ${MSVC_3RDPARTY_ROOT}/${MSVC_3RDPARTY_DIR}/include) - set (ALUT_INCLUDE_DIR ${MSVC_3RDPARTY_ROOT}/${MSVC_3RDPARTY_DIR}/include) set (OPENAL_LIBRARY_DIR ${MSVC_3RDPARTY_ROOT}/${MSVC_3RDPARTY_DIR}/lib) endif (MSVC AND MSVC_3RDPARTY_ROOT) find_package(Boost REQUIRED) set (BOOST_CXX_FLAGS "-DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DBOOST_BIMAP_DISABLE_SERIALIZATION") -find_package(ZLIB REQUIRED) -find_package(Threads REQUIRED) - if(SIMGEAR_HEADLESS) message(STATUS "SimGear mode: HEADLESS") else() message(STATUS "SimGear mode: NORMAL") find_package(OpenGL REQUIRED) find_package(OpenAL REQUIRED) - find_package(ALUT REQUIRED) - find_package(OpenSceneGraph 3.0.0 REQUIRED osgText osgSim osgDB osgParticle osgUtil) + find_package(OpenSceneGraph 3.0.0 REQUIRED osgText osgSim osgDB osgParticle osgGA osgUtil) endif(SIMGEAR_HEADLESS) if(JPEG_FACTORY) @@ -156,6 +166,19 @@ else() message(STATUS "Subversion client support: DISABLED") 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) @@ -238,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 @@ -257,10 +280,9 @@ include_directories(${PROJECT_BINARY_DIR}/simgear/xml) include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR} - ${ALUT_INCLUDE_DIR} ${OPENAL_INCLUDE_DIR} ) + ${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