https://github.com/qgis/QGIS/blob/maste ... ARTH.cmake
- Code: Select all
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4ed9e85..0adc0a1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -114,6 +114,7 @@ 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)
+option(ENABLE_OSGEARTH "Set to ON to build with osgEarth support (default)" ON)
if (MSVC)
GET_FILENAME_COMPONENT(PARENT_DIR ${PROJECT_BINARY_DIR} PATH)
@@ -182,7 +183,15 @@ if(SIMGEAR_HEADLESS)
else()
message(STATUS "SimGear mode: NORMAL")
find_package(OpenGL REQUIRED)
-
+
+ if(ENABLE_OSGEARTH)
+ message(STATUS "osgEarth support enabled, looking for dependencies...")
+ find_package(OSGEARTH REQUIRED)
+ if(OSGEARTH_FOUND)
+ message(STATUS "Okay, osgEarth found via CMake:${OSGEARTH_LIBRARY}")
+ endif(OSGEARTH_FOUND)
+ endif(ENABLE_OSGEARTH)
+
if (ENABLE_SOUND)
find_package(OpenAL REQUIRED)
message(STATUS "Sound support: ENABLED")
@@ -395,6 +404,8 @@ endif()
if(NOT SIMGEAR_HEADLESS)
set( TEST_LIBS
SimGearScene
+ ${OSGEARTH_LIBRARY}
+ ${OSGEARTHUTIL_LIBRARY}
${TEST_LIBS}
${OPENGL_LIBRARIES})
endif()
diff --git a/simgear/CMakeLists.txt b/simgear/CMakeLists.txt
index 096d018..68ec2f0 100644
--- a/simgear/CMakeLists.txt
+++ b/simgear/CMakeLists.txt
@@ -87,7 +87,8 @@ if(SIMGEAR_SHARED)
${OPENSCENEGRAPH_LIBRARIES}
${OPENAL_LIBRARY}
${OPENGL_LIBRARY}
- ${JPEG_LIBRARY})
+ ${JPEG_LIBRARY}
+ ${OSGEARTH_LIBRARY})
install(TARGETS SimGearScene LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
diff --git a/simgear/scene/util/CMakeLists.txt b/simgear/scene/util/CMakeLists.txt
index 4a46bad..704dcd8 100644
--- a/simgear/scene/util/CMakeLists.txt
+++ b/simgear/scene/util/CMakeLists.txt
@@ -64,6 +64,6 @@ if(ENABLE_TESTS)
add_executable(test_parse_color parse_color_test.cxx )
add_test(parse_color ${EXECUTABLE_OUTPUT_PATH}/test_parse_color)
-target_link_libraries(test_parse_color ${TEST_LIBS})
+target_link_libraries(test_parse_color ${TEST_LIBS})
endif(ENABLE_TESTS)
Apparently, osgearth/util is only used in a unit test currently ? Otherwise, it would also need to be added to the SimGearScene section.
there were some minor build warnings:
- Code: Select all
/home/hooray/sources/simgear/simgear/scene/util/OsgEarthHeightCache.hxx: In constructor ‘simgear::OsgEarthHeightCache::OsgEarthHeightCache(double, unsigned int)’:
/home/hooray/sources/simgear/simgear/scene/util/OsgEarthHeightCache.hxx:311: warning: ‘simgear::OsgEarthHeightCache::m_CellResolutionRad’ will be initialized after
/home/hooray/sources/simgear/simgear/scene/util/OsgEarthHeightCache.hxx:296: warning: ‘unsigned int simgear::OsgEarthHeightCache::m_MaxSize’
/home/hooray/sources/simgear/simgear/scene/util/OsgEarthHeightCache.hxx:123: warning: when initialized here
/home/hooray/sources/simgear/simgear/scene/util/OsgEarthHeightCache.hxx:321: warning: ‘simgear::OsgEarthHeightCache::m_EarthMapNode’ will be initialized after
/home/hooray/sources/simgear/simgear/scene/util/OsgEarthHeightCache.hxx:318: warning: ‘osg::observer_ptr<osg::CoordinateSystemNode> simgear::OsgEarthHeightCache::m_EarthCoordinateSystemNode’
/home/hooray/sources/simgear/simgear/scene/util/OsgEarthHeightCache.hxx:123: warning: when initialized here
/home/hooray/sources/simgear/simgear/scene/util/OsgEarthHeightCache.hxx:348: warning: ‘simgear::OsgEarthHeightCache::m_Contrast’ will be initialized after
/home/hooray/sources/simgear/simgear/scene/util/OsgEarthHeightCache.hxx:330: warning: ‘bool simgear::OsgEarthHeightCache::m_IsWithinTolerance’
/home/hooray/sources/simgear/simgear/scene/util/OsgEarthHeightCache.hxx:123: warning: when initialized here
/home/hooray/sources/simgear/simgear/scene/util/OsgEarthHeightCache.hxx:330: warning: ‘simgear::OsgEarthHeightCache::m_IsWithinTolerance’ will be initialized after
/home/hooray/sources/simgear/simgear/scene/util/OsgEarthHeightCache.hxx:305: warning: ‘bool simgear::OsgEarthHeightCache::m_IsHeightFieldDirtyFlag’
/home/hooray/sources/simgear/simgear/scene/util/OsgEarthHeightCache.hxx:123: warning: when initialized here
/home/hooray/sources/simgear/simgear/scene/util/OsgEarthHeightCache.hxx:305: warning: ‘simgear::OsgEarthHeightCache::m_IsHeightFieldDirtyFlag’ will be initialized after
/home/hooray/sources/simgear/simgear/scene/util/OsgEarthHeightCache.hxx:299: warning: ‘std::string simgear::OsgEarthHeightCache::m_OsgEarthCachePath’
/home/hooray/sources/simgear/simgear/scene/util/OsgEarthHeightCache.hxx:123: warning: when initialized here
PS: i didn't have to make any GDAL related changes so far, but I happen to have the GDAL headers installed system-wide ...