-
Notifications
You must be signed in to change notification settings - Fork 787
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,48 @@ | ||
function(osgearth_install_package_config_files TARGET TARGET_VERSION INCLUDE_INSTALL_DIR LIBRARY_INSTALL_DIR) | ||
# osgearth_package_install_config_file | ||
# | ||
# Creates and installs the top-level LIBNAME-config.cmake file for a library | ||
# | ||
function(osgearth_package_install_config_files INCLUDE_INSTALL_DIR LIBRARY_INSTALL_DIR) | ||
|
||
include(CMakePackageConfigHelpers) | ||
set(PACKAGE_INSTALL_DIR share/osgEarth) | ||
|
||
set(PACKAGE_INSTALL_DIR share/osgearth) | ||
#set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR}) | ||
#set(LIBRARY_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}) | ||
include(CMakePackageConfigHelpers) | ||
|
||
configure_package_config_file( | ||
"${TARGET}-config.cmake.in" | ||
"${TARGET}-config.cmake" | ||
"${CMAKE_SOURCE_DIR}/cmake/osgEarth-config.cmake.in" | ||
"${CMAKE_CURRENT_BINARY_DIR}/osgEarth-config.cmake" | ||
INSTALL_DESTINATION ${PACKAGE_INSTALL_DIR} | ||
PATH_VARS INCLUDE_INSTALL_DIR LIBRARY_INSTALL_DIR) | ||
|
||
write_basic_package_version_file( | ||
"${TARGET}-configVersion.cmake" | ||
VERSION ${TARGET_VERSION} | ||
"${CMAKE_CURRENT_BINARY_DIR}/osgEarth-configVersion.cmake" | ||
VERSION ${OSGEARTH_VERSION} | ||
COMPATIBILITY AnyNewerVersion) | ||
|
||
install( | ||
EXPORT ${TARGET}Targets | ||
FILE ${TARGET}-targets.cmake | ||
NAMESPACE ${TARGET}:: | ||
DESTINATION ${PACKAGE_INSTALL_DIR} ) | ||
|
||
install( | ||
FILES | ||
"${CMAKE_CURRENT_BINARY_DIR}/${TARGET}-config.cmake" | ||
"${CMAKE_CURRENT_BINARY_DIR}/${TARGET}-configVersion.cmake" | ||
"${CMAKE_CURRENT_BINARY_DIR}/osgEarth-config.cmake" | ||
"${CMAKE_CURRENT_BINARY_DIR}/osgEarth-configVersion.cmake" | ||
DESTINATION | ||
${PACKAGE_INSTALL_DIR} ) | ||
|
||
endfunction() | ||
|
||
|
||
# osgearth_package_install_library_target | ||
# | ||
# Installs the -targets.cmake file for the library "MY_TARGET". | ||
# Each -targets.cmaks file corresond to one "component" or "nodekit" library, | ||
# and is included from the top-level osgEarth-config.cmake file. | ||
# | ||
function(osgearth_package_install_library_target MY_TARGET) | ||
|
||
set(PACKAGE_INSTALL_DIR share/osgEarth) | ||
|
||
install( | ||
EXPORT ${MY_TARGET}Targets | ||
FILE ${MY_TARGET}-targets.cmake | ||
NAMESPACE osgEarth:: | ||
DESTINATION ${PACKAGE_INSTALL_DIR} ) | ||
|
||
endfunction() |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# | ||
# CMake Config TEMPLATE | ||
# Inputs: | ||
# OSGEARTH_VERSION : osgEarth version string | ||
# OSGEARTH_COMPONENTS : list of libraries for which to create namespaced imports | ||
# | ||
cmake_minimum_required(VERSION 3.10.0) | ||
|
||
@PACKAGE_INIT@ | ||
|
||
set(osgEarth_VERSION @OSGEARTH_VERSION@) | ||
set(OSGEARTH_VERSION @OSGEARTH_VERSION@) | ||
|
||
if(NOT CMAKE_CXX_STANDARD) | ||
set(CMAKE_CXX_STANDARD 14) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
set(CMAKE_CXX_EXTENSIONS OFF) | ||
endif() | ||
|
||
set(osgEarth_INCLUDE_DIR "${PACKAGE_PREFIX_DIR}/include") | ||
set(osgEarth_SHARE_DIR "${PACKAGE_PREFIX_DIR}/share/osgEarth") | ||
set_and_check(osgEarth_BUILD_DIR "${PACKAGE_PREFIX_DIR}") | ||
|
||
# always depend on the public-facing OSG libraries | ||
include(CMakeFindDependencyMacro) | ||
find_dependency(OpenSceneGraph REQUIRED COMPONENTS osg osgDB osgGA osgUtil osgViewer OpenThreads) | ||
|
||
# must foreably include the OSG include root | ||
include_directories(${OPENSCENEGRAPH_INCLUDE_DIR}) | ||
|
||
# include the target for each library in OSGEARTH_COMPONENTS: | ||
foreach(MY_COMPONENT @OSGEARTH_COMPONENTS@) | ||
if(NOT TARGET osgEarth::${MY_COMPONENT}) | ||
include("${CMAKE_CURRENT_LIST_DIR}/${MY_COMPONENT}-targets.cmake") | ||
endif() | ||
endforeach() | ||
|
||
set(osgEarth_FOUND TRUE) | ||
set(OSGEARTH_FOUND TRUE) |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,5 +58,5 @@ add_osgearth_library( | |
TARGET ${LIB_NAME} | ||
SOURCES ${LIB_SOURCES} ${IMGUI_SOURCES} | ||
PUBLIC_HEADERS ${LIB_HEADERS} ${IMGUI_HEADERS} ${STOCK_PANELS} | ||
LIBRARIES PUBLIC GLEW::GLEW OpenGL::GL | ||
LIBRARIES PRIVATE GLEW::GLEW OpenGL::GL | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
emminizer
Contributor
|
||
FOLDER "NodeKits") |
Switched here to private, so external application doesn't need GLEW includes for osgEarthImGui.
But in osgEarthImGui/Common it has:
Error:
Then, one need to remove
#include <GL/glew.h>
right? But this doesn't compile :)or
the application osgearth_imgui need GLEW as dependency ?