X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=CMakeLists.txt;h=008d7a9a83e39042a6bfc7c17eb727a85973d28c;hb=3001809bc3fd679268426e02945195fb9addab8f;hp=f34d882881bd38699c0e61decc99741696374f23;hpb=b61692b66772e3f6f8482bd7015cc1fc5f18e4c6;p=simgear.git diff --git a/CMakeLists.txt b/CMakeLists.txt index f34d8828..008d7a9a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,14 @@ string(STRIP ${versionFile} SIMGEAR_VERSION) # use simgear version also as the SO version (if building SOs) SET(SIMGEAR_SOVERSION ${SIMGEAR_VERSION}) +# Warning when build is not an out-of-source build. +string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" InSourceBuild) +if(InSourceBuild) + message(WARNING "Avoid building inside the source tree!") + message(WARNING "Create a separate build directory instead (i.e. 'sgbuild') and call CMake from there: ") + message(WARNING " mkdir ../sgbuild && cd ../sgbuild && cmake ${CMAKE_SOURCE_DIR}") +endif(InSourceBuild) + #packaging SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/COPYING") SET(CPACK_RESOURCE_FILE_README "${PROJECT_SOURCE_DIR}/README") @@ -103,23 +111,18 @@ if (MSVC AND MSVC_3RDPARTY_ROOT) 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 osgGA osgUtil) endif(SIMGEAR_HEADLESS) @@ -148,6 +151,9 @@ else() message(STATUS "Subversion client support: DISABLED") endif(ENABLE_LIBSVN) +find_package(ZLIB REQUIRED) +find_package(Threads REQUIRED) + 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) @@ -249,7 +255,7 @@ 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)