aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Rusakov <Kitsune-Ral@users.sf.net>2022-09-10 09:05:47 +0200
committerAlexey Rusakov <Kitsune-Ral@users.sf.net>2022-09-10 09:05:47 +0200
commit06d2ddafd856af68f39aa701570443a033e24643 (patch)
tree7a44ff82f10991a05e67a914a5755a8dc7d0e169
parentd863324d07ffafc2afcd65ab1655f1d1d01d1abc (diff)
downloadlibquotient-06d2ddafd856af68f39aa701570443a033e24643.tar.gz
libquotient-06d2ddafd856af68f39aa701570443a033e24643.zip
CMakeLists: adjust .cmake files install path on Windows
With CMAKE_INSTALL_LIBDIR set to ".", the place .cmake files land in was not discoverable by find_package(), assuming a conventional CMAKE_PREFIX_PATH.
-rw-r--r--CMakeLists.txt15
1 files changed, 9 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1c4d9545..f3149a19 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -50,18 +50,22 @@ endif()
if (WIN32)
if (NOT CMAKE_INSTALL_LIBDIR)
set(CMAKE_INSTALL_LIBDIR ".")
- endif ()
+ set(CMakeFilesLocation "cmake")
+ else()
+ set(CMakeFilesLocation "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
+ endif()
if (NOT CMAKE_INSTALL_BINDIR)
set(CMAKE_INSTALL_BINDIR ".")
- endif ()
+ endif()
if (NOT CMAKE_INSTALL_INCLUDEDIR)
set(CMAKE_INSTALL_INCLUDEDIR "include")
- endif ()
+ endif()
else()
include(GNUInstallDirs)
set(INCLUDEDIR_INIT ${PROJECT_NAME})
+ set(CMakeFilesLocation "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
endif(WIN32)
set(${PROJECT_NAME}_INSTALL_INCLUDEDIR
"${CMAKE_INSTALL_INCLUDEDIR}/${INCLUDEDIR_INIT}" CACHE PATH
@@ -357,14 +361,13 @@ configure_file(cmake/${PROJECT_NAME}Config.cmake.in
@ONLY
)
-set(ConfigFilesLocation "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
install(EXPORT ${PROJECT_NAME}Targets
- FILE ${PROJECT_NAME}Targets.cmake DESTINATION ${ConfigFilesLocation})
+ FILE ${PROJECT_NAME}Targets.cmake DESTINATION ${CMakeFilesLocation})
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}Config.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}ConfigVersion.cmake"
- DESTINATION ${ConfigFilesLocation}
+ DESTINATION ${CMakeFilesLocation}
)
install(EXPORT_ANDROID_MK ${PROJECT_NAME}Targets DESTINATION ${CMAKE_INSTALL_DATADIR}/ndk-modules)