Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake Install: Capitalization fixes data and CMake directories; fixed include settings #2693

Merged
merged 1 commit into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ set(OSGEARTH_EMBEDDED_THIRD_PARTY_DIR ${PROJECT_SOURCE_DIR}/src/third_party)

include(GNUInstallDirs)
set(OSGEARTH_INSTALL_PLUGINSDIR "${CMAKE_INSTALL_LIBDIR}" CACHE STRING "Parent folder of OSG plugins folder")
set(OSGEARTH_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/osgearth" CACHE STRING "osgEarth CMake package install directory")
set(OSGEARTH_INSTALL_DATADIR "${CMAKE_INSTALL_DATADIR}/osgearth" CACHE STRING "osgEarth data directory")
set(OSGEARTH_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/osgEarth" CACHE STRING "osgEarth CMake package install directory")
set(OSGEARTH_INSTALL_DATADIR "${CMAKE_INSTALL_DATADIR}/osgEarth" CACHE STRING "osgEarth data directory")

# Platform-specific settings ............................................

Expand Down
2 changes: 1 addition & 1 deletion cmake/install-package-config-files.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function(osgearth_package_install_config_files)
include(CMakePackageConfigHelpers)

# main target include dir
set(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}/osgearth")
set(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}")

configure_package_config_file(
"${PROJECT_SOURCE_DIR}/cmake/osgearth-config.cmake.in"
Expand Down
11 changes: 5 additions & 6 deletions cmake/osgearth-macros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ macro(add_osgearth_library)
cmake_parse_arguments(MY "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

set(INSTALL_INCLUDE_FOLDER ${CMAKE_INSTALL_INCLUDEDIR}/${MY_TARGET})

set(ALL_HEADERS ${MY_HEADERS} ${MY_IMGUI_HEADERS} ${MY_PUBLIC_HEADERS})
include_directories(${MY_INCLUDE_DIRECTORIES})

Expand All @@ -179,11 +179,11 @@ macro(add_osgearth_library)
source_group("Headers" FILES ${ALL_HEADERS})
source_group("Shaders" FILES ${MY_SHADERS} )
source_group("Templates" FILES ${MY_TEMPLATES} )

if(NOT MY_STATIC)
set(MY_STATIC ${OSGEARTH_DYNAMIC_OR_STATIC})
endif()

# create the library.
add_library(
${MY_TARGET}
Expand All @@ -192,8 +192,6 @@ macro(add_osgearth_library)
${MY_SOURCES}
${MY_SHADERS}
${MY_TEMPLATES} )

include_directories(${MY_INCLUDE_DIRECTORIES})

# Link:
if(NOT "${MY_TARGET}" STREQUAL "osgEarth")
Expand All @@ -218,7 +216,8 @@ macro(add_osgearth_library)
# library install and target exports for the cmake config packaging.
install(
TARGETS ${MY_TARGET}
EXPORT ${MY_TARGET}Targets)
EXPORT ${MY_TARGET}Targets
INCLUDES DESTINATION include)

# deploy the shaders for this library, if requested.
if(OSGEARTH_INSTALL_SHADERS)
Expand Down
Loading