]> git.lizzy.rs Git - irrlicht.git/commitdiff
Work around bug installing targets created in a subdirectory
authorJosiahWI <41302989+JosiahWI@users.noreply.github.com>
Sat, 24 Apr 2021 09:03:09 +0000 (04:03 -0500)
committerGitHub <noreply@github.com>
Sat, 24 Apr 2021 09:03:09 +0000 (11:03 +0200)
CMakeLists.txt
source/Irrlicht/CMakeLists.txt

index 58e706e79e260cb989eef31946c22d643be311ff..c9065b04f64ab36cd8ced0326ce68c16c260c55e 100644 (file)
@@ -7,6 +7,8 @@ project(Irrlicht
 
 message(STATUS "*** Building IrrlichtMt ${PROJECT_VERSION} ***")
 
+include(GNUInstallDirs)
+
 if(ANDROID)
        set(sysname Android)
 elseif(APPLE)
@@ -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"
 )
@@ -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
index d709546b31b870a7f50c4d1e93ac992c123ecf54..5732f7e4ddc230ec6629c3a270b128f0de64af2c 100644 (file)
@@ -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}"
+)