From d6ef7e05a6f5d363d846ec960aab9779b477d691 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 19 Mar 2022 22:40:49 -0700 Subject: [PATCH] cmake: Use GNUInstallDirs This helps it make it platform independent, some platforms e.g. ppc64/linux use /usr/lib64 for system libraries Signed-off-by: Khem Raj --- CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e6aff61..0b9a3e2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -95,10 +95,12 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") endif() endif() +include(GNUInstallDirs) + install(TARGETS nlohmann_json_schema_validator EXPORT ${PROJECT_NAME}Targets - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib + LIBRARY DESTINATION ${LIBDIR} + ARCHIVE DESTINATION ${LIBDIR} RUNTIME DESTINATION bin) install(FILES src/nlohmann/json-schema.hpp @@ -129,6 +131,7 @@ endif() # Set the install path to the cmake config files (Relative, so install works correctly under Hunter as well) set(INSTALL_CMAKE_DIR "lib/cmake/${PROJECT_NAME}") +set(INSTALL_CMAKE_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}") set(INSTALL_CMAKEDIR_ROOT share/cmake) # Install Targets