[Openmp-commits] [openmp] [OpenMP] Allow setting OPENMP_INSTALL_LIBDIR (PR #77533)

Martin Storsjö via Openmp-commits openmp-commits at lists.llvm.org
Tue Jan 9 14:32:32 PST 2024


https://github.com/mstorsjo created https://github.com/llvm/llvm-project/pull/77533

The comment indicate that it should be possible, but as long as it wasn't a cache variable, the cmake script overwrote whatever variable the user had set.

>From b96001d1f44e556e095c748b3790661f8fc4d31a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin at martin.st>
Date: Tue, 9 Jan 2024 11:20:01 +0200
Subject: [PATCH] [OpenMP] Allow setting OPENMP_INSTALL_LIBDIR

The comment indicate that it should be possible, but as long as it
wasn't a cache variable, the cmake script overwrote whatever
variable the user had set.
---
 openmp/CMakeLists.txt | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/openmp/CMakeLists.txt b/openmp/CMakeLists.txt
index c1c79f8e0ca93c..03068af22629f7 100644
--- a/openmp/CMakeLists.txt
+++ b/openmp/CMakeLists.txt
@@ -29,7 +29,8 @@ if (OPENMP_STANDALONE_BUILD)
   set(OPENMP_LIBDIR_SUFFIX "" CACHE STRING
     "Suffix of lib installation directory, e.g. 64 => lib64")
   # Do not use OPENMP_LIBDIR_SUFFIX directly, use OPENMP_INSTALL_LIBDIR.
-  set(OPENMP_INSTALL_LIBDIR "lib${OPENMP_LIBDIR_SUFFIX}")
+  set(OPENMP_INSTALL_LIBDIR "lib${OPENMP_LIBDIR_SUFFIX}" CACHE STRING
+      "Path where built OpenMP libraries should be installed.")
 
   # Group test settings.
   set(OPENMP_TEST_C_COMPILER ${CMAKE_C_COMPILER} CACHE STRING
@@ -46,7 +47,8 @@ if (OPENMP_STANDALONE_BUILD)
 else()
   set(OPENMP_ENABLE_WERROR ${LLVM_ENABLE_WERROR})
   # If building in tree, we honor the same install suffix LLVM uses.
-  set(OPENMP_INSTALL_LIBDIR "lib${LLVM_LIBDIR_SUFFIX}")
+  set(OPENMP_INSTALL_LIBDIR "lib${LLVM_LIBDIR_SUFFIX}" CACHE STRING
+      "Path where built OpenMP libraries should be installed.")
 
   if (NOT MSVC)
     set(OPENMP_TEST_C_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang)



More information about the Openmp-commits mailing list