From 04310494366312cd5c031cd82a6abd0d41b7cbc1 Mon Sep 17 00:00:00 2001 From: Sebastian Ehlert <28669218+awvwgk@users.noreply.github.com> Date: Fri, 3 Sep 2021 19:23:34 +0200 Subject: [PATCH] Correctly set CMAKE_INSTALL_MODULEDIR cache variable --- config/CMakeLists.txt | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/config/CMakeLists.txt b/config/CMakeLists.txt index 430cef2af..31b08e284 100644 --- a/config/CMakeLists.txt +++ b/config/CMakeLists.txt @@ -1,10 +1,14 @@ # SPDX-Identifier: MIT -option( - CMAKE_INSTALL_MODULEDIR - "Directory in prefix to install generated module files" - "${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/${CMAKE_Fortran_COMPILER_ID}-${CMAKE_Fortran_COMPILER_VERSION}" -) +if(NOT DEFINED CMAKE_INSTALL_MODULEDIR) + set( + CMAKE_INSTALL_MODULEDIR + "${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/${CMAKE_Fortran_COMPILER_ID}-${CMAKE_Fortran_COMPILER_VERSION}" + CACHE + STRING + "Directory in prefix to install generated module files" + ) +endif() # Export a pkg-config file configure_file(