Work around bug installing targets created in a subdirectory

This commit is contained in:
JosiahWI 2021-04-24 04:03:09 -05:00 committed by GitHub
parent 2461e899ba
commit 826de9f6dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 10 deletions

@ -7,6 +7,8 @@ project(Irrlicht
message(STATUS "*** Building IrrlichtMt ${PROJECT_VERSION} ***") message(STATUS "*** Building IrrlichtMt ${PROJECT_VERSION} ***")
include(GNUInstallDirs)
if(ANDROID) if(ANDROID)
set(sysname Android) set(sysname Android)
elseif(APPLE) elseif(APPLE)
@ -34,13 +36,7 @@ if(BUILD_EXAMPLES)
add_subdirectory(examples) add_subdirectory(examples)
endif() endif()
# Installation of library and headers. # Installation of headers.
include(GNUInstallDirs)
install(TARGETS ${INSTALL_TARGETS}
EXPORT IrrlichtMt-export
DESTINATION "${CMAKE_INSTALL_LIBDIR}"
)
install(DIRECTORY "${PROJECT_SOURCE_DIR}/include/" install(DIRECTORY "${PROJECT_SOURCE_DIR}/include/"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/irrlichtmt" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/irrlichtmt"
) )
@ -53,7 +49,7 @@ install(EXPORT IrrlichtMt-export
) )
include(CMakePackageConfigHelpers) 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" "${CMAKE_CURRENT_BINARY_DIR}/IrrlichtMtConfig.cmake"
INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/IrrlichtMt" INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/IrrlichtMt"
NO_SET_AND_CHECK_MACRO NO_SET_AND_CHECK_MACRO

@ -402,8 +402,14 @@ if(WIN32)
set_target_properties(IrrlichtMt PROPERTIES PREFIX "") # for DLL name set_target_properties(IrrlichtMt PROPERTIES PREFIX "") # for DLL name
endif() endif()
# Installation of library
if(ANDROID) if(ANDROID)
set(INSTALL_TARGETS IrrlichtMt native_app_glue PARENT_SCOPE) set(INSTALL_TARGETS IrrlichtMt native_app_glue)
else() else()
set(INSTALL_TARGETS IrrlichtMt PARENT_SCOPE) set(INSTALL_TARGETS IrrlichtMt)
endif() endif()
install(TARGETS ${INSTALL_TARGETS}
EXPORT IrrlichtMt-export
DESTINATION "${CMAKE_INSTALL_LIBDIR}"
)