diff options
| author | Doron Behar <doron.behar@gmail.com> | 2025-10-15 13:43:49 +0300 |
|---|---|---|
| committer | Doron Behar <doron.behar@gmail.com> | 2025-10-30 17:48:58 +0200 |
| commit | 934688c728300341f0f929587bc6393a6eddfcf5 (patch) | |
| tree | 3211ae33890745bb25273f19093a811fb47a3318 | |
| parent | 93a15738fef400c4f03b02f1384ade88128e2bf0 (diff) | |
| download | portable-934688c728300341f0f929587bc6393a6eddfcf5.tar.gz portable-934688c728300341f0f929587bc6393a6eddfcf5.tar.bz2 portable-934688c728300341f0f929587bc6393a6eddfcf5.zip | |
cmake: use CMAKE_INSTALL_*DIR variables as are, if absolute
These variables can be set to absolute paths, in that case ${prefix}
shouldn't be prepended. CMAKE_INSTALL_FULL_*DIR variables could have
also been used, but that would hard-code the relativity to the prefix
pkg-config variable. See also:
https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html
| -rw-r--r-- | CMakeLists.txt | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index bede146..7ab04ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
| @@ -569,8 +569,16 @@ if(ENABLE_LIBRESSL_INSTALL) | |||
| 569 | # Create pkgconfig files. | 569 | # Create pkgconfig files. |
| 570 | set(prefix ${CMAKE_INSTALL_PREFIX}) | 570 | set(prefix ${CMAKE_INSTALL_PREFIX}) |
| 571 | set(exec_prefix \${prefix}) | 571 | set(exec_prefix \${prefix}) |
| 572 | set(libdir \${exec_prefix}/${CMAKE_INSTALL_LIBDIR}) | 572 | if(IS_ABSOLUTE ${CMAKE_INSTALL_LIBDIR}) |
| 573 | set(includedir \${prefix}/${CMAKE_INSTALL_INCLUDEDIR}) | 573 | set(libdir ${CMAKE_INSTALL_LIBDIR}) |
| 574 | else() | ||
| 575 | set(libdir \${exec_prefix}/${CMAKE_INSTALL_LIBDIR}) | ||
| 576 | endif() | ||
| 577 | if(IS_ABSOLUTE ${CMAKE_INSTALL_INCLUDEDIR}) | ||
| 578 | set(includedir ${CMAKE_INSTALL_INCLUDEDIR}) | ||
| 579 | else() | ||
| 580 | set(includedir \${prefix}/${CMAKE_INSTALL_INCLUDEDIR}) | ||
| 581 | endif() | ||
| 574 | if(PLATFORM_LIBS) | 582 | if(PLATFORM_LIBS) |
| 575 | string(REGEX REPLACE ";" " -l" PLATFORM_LDADD ";${PLATFORM_LIBS}") | 583 | string(REGEX REPLACE ";" " -l" PLATFORM_LDADD ";${PLATFORM_LIBS}") |
| 576 | endif() | 584 | endif() |
