[Openmp-commits] [openmp] r333284 - [CMake] Unify install path for libraries
Jonas Hahnfeld via Openmp-commits
openmp-commits at lists.llvm.org
Fri May 25 08:56:42 PDT 2018
Author: hahnfeld
Date: Fri May 25 08:56:41 2018
New Revision: 333284
URL: http://llvm.org/viewvc/llvm-project?rev=333284&view=rev
Log:
[CMake] Unify install path for libraries
Introduce OPENMP_INSTALL_LIBDIR and use in all install() commands.
This also fixes installation of libomptarget-nvptx that previously
didn't honor {OPENMP,LLVM}_LIBDIR_SUFFIX.
Differential Revision: https://reviews.llvm.org/D47130
Modified:
openmp/trunk/CMakeLists.txt
openmp/trunk/libomptarget/deviceRTLs/nvptx/CMakeLists.txt
openmp/trunk/libomptarget/plugins/CMakeLists.txt
openmp/trunk/libomptarget/plugins/cuda/CMakeLists.txt
openmp/trunk/libomptarget/src/CMakeLists.txt
openmp/trunk/runtime/src/CMakeLists.txt
Modified: openmp/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/CMakeLists.txt?rev=333284&r1=333283&r2=333284&view=diff
==============================================================================
--- openmp/trunk/CMakeLists.txt (original)
+++ openmp/trunk/CMakeLists.txt Fri May 25 08:56:41 2018
@@ -18,6 +18,8 @@ if (OPENMP_STANDALONE_BUILD OR "${CMAKE_
"Enable -Werror flags to turn warnings into errors for supporting compilers.")
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}")
# Group test settings.
set(OPENMP_TEST_C_COMPILER ${CMAKE_C_COMPILER} CACHE STRING
@@ -28,7 +30,7 @@ if (OPENMP_STANDALONE_BUILD OR "${CMAKE_
else()
set(OPENMP_ENABLE_WERROR ${LLVM_ENABLE_WERROR})
# If building in tree, we honor the same install suffix LLVM uses.
- set(OPENMP_LIBDIR_SUFFIX ${LLVM_LIBDIR_SUFFIX})
+ set(OPENMP_INSTALL_LIBDIR "lib${LLVM_LIBDIR_SUFFIX}")
if (NOT MSVC)
set(OPENMP_TEST_C_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang)
Modified: openmp/trunk/libomptarget/deviceRTLs/nvptx/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/libomptarget/deviceRTLs/nvptx/CMakeLists.txt?rev=333284&r1=333283&r2=333284&view=diff
==============================================================================
--- openmp/trunk/libomptarget/deviceRTLs/nvptx/CMakeLists.txt (original)
+++ openmp/trunk/libomptarget/deviceRTLs/nvptx/CMakeLists.txt Fri May 25 08:56:41 2018
@@ -89,7 +89,7 @@ if(LIBOMPTARGET_DEP_CUDA_FOUND)
OPTIONS ${CUDA_ARCH} ${CUDA_DEBUG})
# Install device RTL under the lib destination folder.
- install(TARGETS omptarget-nvptx ARCHIVE DESTINATION "lib")
+ install(TARGETS omptarget-nvptx ARCHIVE DESTINATION "${OPENMP_INSTALL_LIBDIR}")
target_link_libraries(omptarget-nvptx ${CUDA_LIBRARIES})
@@ -171,8 +171,8 @@ if(LIBOMPTARGET_DEP_CUDA_FOUND)
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/libomptarget-nvptx-sm_${sm}.bc
$<TARGET_FILE_DIR:omptarget-nvptx>)
- # Install device RTL under the lib destination folder.
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libomptarget-nvptx-sm_${sm}.bc DESTINATION "lib")
+ # Install bitcode library under the lib destination folder.
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libomptarget-nvptx-sm_${sm}.bc DESTINATION "${OPENMP_INSTALL_LIBDIR}")
endforeach()
endif()
Modified: openmp/trunk/libomptarget/plugins/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/libomptarget/plugins/CMakeLists.txt?rev=333284&r1=333283&r2=333284&view=diff
==============================================================================
--- openmp/trunk/libomptarget/plugins/CMakeLists.txt (original)
+++ openmp/trunk/libomptarget/plugins/CMakeLists.txt Fri May 25 08:56:41 2018
@@ -37,7 +37,7 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "${tma
# Install plugin under the lib destination folder.
install(TARGETS "omptarget.rtl.${tmachine_libname}"
- LIBRARY DESTINATION lib${OPENMP_LIBDIR_SUFFIX})
+ LIBRARY DESTINATION "${OPENMP_INSTALL_LIBDIR}")
target_link_libraries(
"omptarget.rtl.${tmachine_libname}"
Modified: openmp/trunk/libomptarget/plugins/cuda/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/libomptarget/plugins/cuda/CMakeLists.txt?rev=333284&r1=333283&r2=333284&view=diff
==============================================================================
--- openmp/trunk/libomptarget/plugins/cuda/CMakeLists.txt (original)
+++ openmp/trunk/libomptarget/plugins/cuda/CMakeLists.txt Fri May 25 08:56:41 2018
@@ -39,7 +39,7 @@ include_directories(${LIBOMPTARGET_DEP_L
add_library(omptarget.rtl.cuda SHARED src/rtl.cpp)
# Install plugin under the lib destination folder.
-install(TARGETS omptarget.rtl.cuda LIBRARY DESTINATION lib${OPENMP_LIBDIR_SUFFIX})
+install(TARGETS omptarget.rtl.cuda LIBRARY DESTINATION "${OPENMP_INSTALL_LIBDIR}")
target_link_libraries(omptarget.rtl.cuda
${LIBOMPTARGET_DEP_CUDA_DRIVER_LIBRARIES}
Modified: openmp/trunk/libomptarget/src/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/libomptarget/src/CMakeLists.txt?rev=333284&r1=333283&r2=333284&view=diff
==============================================================================
--- openmp/trunk/libomptarget/src/CMakeLists.txt (original)
+++ openmp/trunk/libomptarget/src/CMakeLists.txt Fri May 25 08:56:41 2018
@@ -28,4 +28,4 @@ target_link_libraries(omptarget
"-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exports")
# Install libomptarget under the lib destination folder.
-install(TARGETS omptarget LIBRARY DESTINATION lib${OPENMP_LIBDIR_SUFFIX})
+install(TARGETS omptarget LIBRARY DESTINATION "${OPENMP_INSTALL_LIBDIR}")
Modified: openmp/trunk/runtime/src/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/CMakeLists.txt?rev=333284&r1=333283&r2=333284&view=diff
==============================================================================
--- openmp/trunk/runtime/src/CMakeLists.txt (original)
+++ openmp/trunk/runtime/src/CMakeLists.txt Fri May 25 08:56:41 2018
@@ -286,22 +286,22 @@ if(${OPENMP_STANDALONE_BUILD})
set(LIBOMP_HEADERS_INSTALL_PATH include)
else()
string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" CLANG_VERSION ${PACKAGE_VERSION})
- set(LIBOMP_HEADERS_INSTALL_PATH lib${OPENMP_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
+ set(LIBOMP_HEADERS_INSTALL_PATH "${OPENMP_INSTALL_LIBDIR}/clang/${CLANG_VERSION}/include")
endif()
if(WIN32)
install(TARGETS omp RUNTIME DESTINATION bin)
- install(TARGETS ompimp ARCHIVE DESTINATION lib${OPENMP_LIBDIR_SUFFIX})
+ install(TARGETS ompimp ARCHIVE DESTINATION "${OPENMP_INSTALL_LIBDIR}")
# Create aliases (regular copies) of the library for backwards compatibility
set(LIBOMP_ALIASES "libiomp5md")
foreach(alias IN LISTS LIBOMP_ALIASES)
install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E copy \"${LIBOMP_LIB_FILE}\"
\"${alias}${LIBOMP_LIBRARY_SUFFIX}\" WORKING_DIRECTORY \${CMAKE_INSTALL_PREFIX}/bin)")
install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E copy \"${LIBOMP_IMP_LIB_FILE}\"
- \"${alias}${LIBOMP_LIBRARY_SUFFIX}\" WORKING_DIRECTORY \${CMAKE_INSTALL_PREFIX}/lib${OPENMP_LIBDIR_SUFFIX})")
+ \"${alias}${LIBOMP_LIBRARY_SUFFIX}\" WORKING_DIRECTORY \${CMAKE_INSTALL_PREFIX}/${OPENMP_INSTALL_LIBDIR})")
endforeach()
else()
- install(TARGETS omp ${LIBOMP_INSTALL_KIND} DESTINATION lib${OPENMP_LIBDIR_SUFFIX})
+ install(TARGETS omp ${LIBOMP_INSTALL_KIND} DESTINATION "${OPENMP_INSTALL_LIBDIR}")
if(${LIBOMP_INSTALL_ALIASES})
# Create aliases (symlinks) of the library for backwards compatibility
@@ -309,7 +309,7 @@ else()
foreach(alias IN LISTS LIBOMP_ALIASES)
install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E create_symlink \"${LIBOMP_LIB_FILE}\"
\"${alias}${LIBOMP_LIBRARY_SUFFIX}\" WORKING_DIRECTORY
- \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/lib${OPENMP_LIBDIR_SUFFIX})")
+ \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${OPENMP_INSTALL_LIBDIR})")
endforeach()
endif()
endif()
More information about the Openmp-commits
mailing list