From f4c6f063d312e1bd81eecd5f3ef4b0f0be3d0bec Mon Sep 17 00:00:00 2001 From: Yen-Chen Chen <yen-chen.chen@kit.edu> Date: Tue, 3 Dec 2024 13:28:38 +0000 Subject: [PATCH] Fix cmake install (icon-libraries/libfortran-support!103) ## What is the bug CMake install prefix using `${CMAKE_INSTALL_PREFIX}` does not take environmental install path, but rather hardcoded to the explicit path. See [Sergey's comment](https://gitlab.dkrz.de/icon-libraries/libfortran-support/-/merge_requests/95#note_280056) ## How do you fix it Use `$<INSTALL_PREFIX>` instead. Approved-by: Sergey Kosukhin <sergey.kosukhin@mpimet.mpg.de> Merged-by: Yen-Chen Chen <yen-chen.chen@kit.edu> Changelog: bugfix --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 08134de..350a051 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -107,7 +107,7 @@ target_include_directories( PUBLIC # Path to the Fortran modules: $<BUILD_INTERFACE:$<$<COMPILE_LANGUAGE:Fortran>:${Fortran_MODULE_DIRECTORY}>> - $<INSTALL_INTERFACE:$<$<COMPILE_LANGUAGE:Fortran>:${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}>> + $<INSTALL_INTERFACE:$<$<COMPILE_LANGUAGE:Fortran>:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>> INTERFACE # Path to the internal C/C++ headers (for testing): Requires CMake 3.15+ for # multiple compile languages -- GitLab