From 17ffa4b36ce9e9bb30ce5cd4a85f153e50866337 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20B=C3=B6ger?= Date: Mon, 31 May 2021 10:35:49 +0100 Subject: [PATCH] use sensible default module paths for Linux/Unix --- CMakeLists.txt | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e1b2b76d..f03977a3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,7 @@ project(chibi-scheme LANGUAGES C VERSION ${version} include(CheckIncludeFile) include(CheckSymbolExists) +include(GNUInstallDirs) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) @@ -339,18 +340,6 @@ bless_chibi_scheme_executable(chibi-scheme) # Generate "chibi/install.h" # -if(CYGWIN OR WIN32) - set(thePrefix "bin") -else() - set(thePrefix "lib") -endif() - -if(WIN32) - set(pathsep "\\;") -else() - set(pathsep ":") -endif() - if(WIN32) set(platform "windows") elseif(CYGWIN) @@ -370,10 +359,11 @@ else() endif() -set(default_module_path - "" - #"${CMAKE_INSTALL_PREFIX}/${thePrefix}${pathsep}${CMAKE_INSTALL_PREFIX}/bin" - ) +string(JOIN ":" default_module_path + ${CMAKE_INSTALL_FULL_DATAROOTDIR}/chibi + ${CMAKE_INSTALL_FULL_LIBDIR}/chibi + ${CMAKE_INSTALL_FULL_DATAROOTDIR}/snow + ${CMAKE_INSTALL_FULL_LIBDIR}/snow) configure_file(include/chibi/install.h.in include/chibi/install.h)