Skip to content

Commit

Permalink
cmake: use CMAKE_INSTALL_DATAROOTDIR if CMAKE_LIBRARY_ARCHITECTURE is…
Browse files Browse the repository at this point in the history
… unset

This causes files on NixOS to be put in the proper architecture
independent place, which otherwise was selecting the architecture
dependent location.
  • Loading branch information
dcbaker committed Mar 5, 2024
1 parent b27571c commit 14df2db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmake/cxxopts.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function(cxxopts_install_logic)
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}")
set(CMAKE_INSTALL_LIBDIR_ARCHIND "${CMAKE_INSTALL_DATAROOTDIR}")
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")
Expand Down

0 comments on commit 14df2db

Please sign in to comment.