Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/jarro2783/cxxopts.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Kiselyov <aleksandr.kiselyov@gmail.com>2022-06-16 00:34:14 +0300
committerGitHub <noreply@github.com>2022-06-16 00:34:14 +0300
commita70771ae894c787337e6393ff016c8e93e4237a3 (patch)
tree33c1317c39a71af5e6c33663287518ee3fe6a7a9
parent5f72b525c2f1f93a6dd454ff6d719d514d86be7d (diff)
Fixed cmake install path in case of empty architecture (#322)
-rw-r--r--cmake/cxxopts.cmake7
1 files changed, 6 insertions, 1 deletions
diff --git a/cmake/cxxopts.cmake b/cmake/cxxopts.cmake
index 46e87ba..0ead543 100644
--- a/cmake/cxxopts.cmake
+++ b/cmake/cxxopts.cmake
@@ -87,7 +87,12 @@ endfunction()
# Helper function to ecapsulate install logic
function(cxxopts_install_logic)
- string(REPLACE "/${CMAKE_LIBRARY_ARCHITECTURE}" "" CMAKE_INSTALL_LIBDIR_ARCHIND "${CMAKE_INSTALL_LIBDIR}")
+ if(CMAKE_LIBRARY_ARCHITECTURE)
+ string(REPLACE "/${CMAKE_LIBRARY_ARCHITECTURE}" "" CMAKE_INSTALL_LIBDIR_ARCHIND "${CMAKE_INSTALL_LIBDIR}")
+ else()
+ # On some systems (e.g. NixOS), `CMAKE_LIBRARY_ARCHITECTURE` can be empty
+ set(CMAKE_INSTALL_LIBDIR_ARCHIND "${CMAKE_INSTALL_LIBDIR}")
+ endif()
set(CXXOPTS_CMAKE_DIR "${CMAKE_INSTALL_LIBDIR_ARCHIND}/cmake/cxxopts" CACHE STRING "Installation directory for cmake files, relative to ${CMAKE_INSTALL_PREFIX}.")
set(version_config "${PROJECT_BINARY_DIR}/cxxopts-config-version.cmake")
set(project_config "${PROJECT_BINARY_DIR}/cxxopts-config.cmake")