Skip to content

Commit

Permalink
CMake: Fixed install to correct include directories and output capita…
Browse files Browse the repository at this point in the history
…lization.
  • Loading branch information
emminizer committed Feb 3, 2025
1 parent 878365d commit 89148ed
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
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

0 comments on commit 89148ed

Please sign in to comment.