Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
science
moab
0001-Generate-moab.make-at-build-time-fix-locat...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-Generate-moab.make-at-build-time-fix-location.patch of Package moab
From 3ddc809e677a8627db2f6f684a092fbe4a9317e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de> Date: Mon, 1 Aug 2022 21:32:36 +0200 Subject: [PATCH] Generate moab.make at build time, fix location `file(APPEND)` does not know about any staging directories (DESTDIR), and would try to mangle a file in the system root directory. Generate the altered version at build time, and then rename it during installation. Fixes #148. --- CMakeLists.txt | 20 +++++++++++--------- moab.gen_make_installed.cmake | 5 +++++ 2 files changed, 16 insertions(+), 9 deletions(-) create mode 100644 moab.gen_make_installed.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index ca69023..f331946 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -635,17 +635,17 @@ if ( MOAB_HAVE_IMESH ) DESTINATION ${CMAKE_INSTALL_LIBDIR} ) endif ( MOAB_HAVE_IMESH ) -INSTALL( - FILES "${PROJECT_BINARY_DIR}/lib/moab.make" - DESTINATION ${CMAKE_INSTALL_LIBDIR} +ADD_CUSTOM_TARGET(moab_make_installed ALL + COMMENT "Create moab.make for install tree" + COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/lib/moab.make ${PROJECT_BINARY_DIR}/lib/moab.make_installed + COMMAND ${CMAKE_COMMAND} -DMOAB_LIBDIR=${CMAKE_INSTALL_FULL_LIBDIR} -DMOAB_INCLUDEDIR=${CMAKE_INSTALL_FULL_INCLUDEDIR} + -DOUTFILE=${PROJECT_BINARY_DIR}/lib/moab.make_installed -P ${PROJECT_SOURCE_DIR}/moab.gen_make_installed.cmake + VERBATIM ) INSTALL( - CODE - "file(APPEND ${CMAKE_INSTALL_FULL_LIBDIR}/moab.make MOAB_LIBDIR=${CMAKE_INSTALL_FULL_LIBDIR}\\n )" - ) -INSTALL( - CODE - "file(APPEND ${CMAKE_INSTALL_FULL_LIBDIR}/moab.make MOAB_INCLUDES=-I${CMAKE_INSTALL_FULL_INCLUDEDIR}\\n )" + FILES "${PROJECT_BINARY_DIR}/lib/moab.make_installed" + RENAME "moab.make" + DESTINATION ${CMAKE_INSTALL_LIBDIR} ) INSTALL( FILES "${PROJECT_BINARY_DIR}/MOABConfig.cmake" diff --git a/moab.gen_make_installed.cmake b/moab.gen_make_installed.cmake new file mode 100644 index 0000000..fef740d --- /dev/null +++ b/moab.gen_make_installed.cmake @@ -0,0 +1,4 @@ +# Append some definitions to installed version of the Makefile + +file(APPEND ${OUTFILE} "MOAB_LIBDIR=${MOAB_LIBDIR}\\n" ) +file(APPEND ${OUTFILE} "MOAB_INCLUDES=-I${MOAB_INCDIR}\\n" ) -- 2.37.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor