]> git.mxchange.org Git - flightgear.git/blobdiff - CMakeLists.txt
fgviewer: Update fgviewer.
[flightgear.git] / CMakeLists.txt
index f583d0a01bba52f2460f61ab7dc6630ea781e026..150c3931d276e7e571aec0c9a53ff2081529107d 100644 (file)
@@ -18,6 +18,14 @@ else(${CMAKE_VERSION} VERSION_GREATER 2.8.4)
     include(OldGNUInstallDirs)
 endif(${CMAKE_VERSION} VERSION_GREATER 2.8.4)
 
+# 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. 'fgbuild') and call CMake from there: ")
+    message(WARNING  "  mkdir ../fgbuild && cd ../fgbuild && cmake ${CMAKE_SOURCE_DIR}")
+endif(InSourceBuild)
+
 set(CMAKE_DEBUG_POSTFIX          "d" CACHE STRING "add a postfix, usually d on windows")
 set(CMAKE_RELEASE_POSTFIX        ""  CACHE STRING "add a postfix, usually empty on windows")
 set(CMAKE_RELWITHDEBINFO_POSTFIX ""  CACHE STRING "add a postfix, usually empty on windows")
@@ -254,19 +262,6 @@ check_include_file(unistd.h   HAVE_UNISTD_H)
 check_include_file(sys/time.h HAVE_SYS_TIME_H)
 check_include_file(windows.h  HAVE_WINDOWS_H)
 
-# definition depends on OSG version
-set(CMAKE_REQUIRED_INCLUDES ${OPENSCENEGRAPH_INCLUDE_DIRS})
-
-check_cxx_source_compiles(
-    "#include <osg/CullSettings>
-    int main()
-    {
-        osg::CullSettings::VariablesMask mask = osg::CullSettings::CLEAR_MASK;
-        return 0;
-    }
-    "
-    HAVE_CULLSETTINGS_CLEAR_MASK)
-
 if(ENABLE_RTI)
     find_package(RTI)
     if(RTI_FOUND)