Skip to content

Commit

Permalink
Work around bug installing targets created in a subdirectory
Browse files Browse the repository at this point in the history
  • Loading branch information
JosiahWI authored Apr 24, 2021
1 parent 2461e89 commit 826de9f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
12 changes: 4 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ project(Irrlicht

message(STATUS "*** Building IrrlichtMt ${PROJECT_VERSION} ***")

include(GNUInstallDirs)

if(ANDROID)
set(sysname Android)
elseif(APPLE)
Expand Down Expand Up @@ -34,13 +36,7 @@ if(BUILD_EXAMPLES)
add_subdirectory(examples)
endif()

# Installation of library and headers.
include(GNUInstallDirs)
install(TARGETS ${INSTALL_TARGETS}
EXPORT IrrlichtMt-export
DESTINATION "${CMAKE_INSTALL_LIBDIR}"
)

# Installation of headers.
install(DIRECTORY "${PROJECT_SOURCE_DIR}/include/"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/irrlichtmt"
)
Expand All @@ -53,7 +49,7 @@ install(EXPORT IrrlichtMt-export
)

include(CMakePackageConfigHelpers)
configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in"
configure_package_config_file("${PROJECT_SOURCE_DIR}/Config.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/IrrlichtMtConfig.cmake"
INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/IrrlichtMt"
NO_SET_AND_CHECK_MACRO
Expand Down
10 changes: 8 additions & 2 deletions source/Irrlicht/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,14 @@ if(WIN32)
set_target_properties(IrrlichtMt PROPERTIES PREFIX "") # for DLL name
endif()

# Installation of library
if(ANDROID)
set(INSTALL_TARGETS IrrlichtMt native_app_glue PARENT_SCOPE)
set(INSTALL_TARGETS IrrlichtMt native_app_glue)
else()
set(INSTALL_TARGETS IrrlichtMt PARENT_SCOPE)
set(INSTALL_TARGETS IrrlichtMt)
endif()

install(TARGETS ${INSTALL_TARGETS}
EXPORT IrrlichtMt-export
DESTINATION "${CMAKE_INSTALL_LIBDIR}"
)

0 comments on commit 826de9f

Please sign in to comment.