From: Debian Science Team Date: Sun, 3 Nov 2024 14:45:53 +0000 (+0000) Subject: lib_rename X-Git-Tag: archive/raspbian/2019.2.0_git20230811.ff54a68+dfsg1-4+rpi1^2~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=8e413ba6b1a727cc0ff3028310226e4ceb3925dd;p=mshr.git lib_rename =================================================================== Gbp-Pq: Name lib_rename.patch --- diff --git a/CMakeLists.txt b/CMakeLists.txt index f1e50be..2aef9ec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -90,6 +90,7 @@ add_subdirectory(3rdparty) include_directories(BEFORE ${EXTERNAL_INCLUDE_DIRS}) add_definitions("${EXTERNAL_DEFINITIONS}") +set(DOLFIN_LIB_NAME_EXT ${LIB_NAME_EXT}) find_package(DOLFIN REQUIRED) include(${DOLFIN_USE_FILE}) @@ -127,6 +128,7 @@ if (MSHR_WITH_LIBRARY_VERSION) set(MSHR_LIBRARY_PROPERTIES ${MSHR_LIBRARY_PROPERTIES} VERSION ${MSHR_LIBRARY_VERSION} SOVERSION ${MSHR_VERSION_MAJOR}.${MSHR_VERSION_MINOR} + OUTPUT_NAME "mshr${LIB_NAME_EXT}" ) endif() set_target_properties(mshr PROPERTIES ${MSHR_LIBRARY_PROPERTIES}) diff --git a/mshr-config.cmake.in b/mshr-config.cmake.in index 7935ef0..1ff461d 100644 --- a/mshr-config.cmake.in +++ b/mshr-config.cmake.in @@ -12,6 +12,6 @@ set(MSHR_LIBRARIES_DIRS "@CONF_LIBRARIES_DIRS@") set(MSHR_EXTERNAL_LIBRARIES "@CONF_EXTERNAL_LIBRARIES@") set(MSHR_CXX_DEFINITIONS "@CONF_CXX_DEFINITIONS@") set(MSHR_CXX_FLAGS "@CONF_CXX_FLAGS@") -set(MSHR_LIBRARIES mshr) +set(MSHR_LIBRARIES mshr${MSHR_LIB_NAME_EXT}) set(MSHR_USE_FILE "${MSHR_CMAKE_DIR}/use-mshr.cmake") \ No newline at end of file diff --git a/mshrConfig.cmake.in b/mshrConfig.cmake.in index 9d27c51..b846118 100644 --- a/mshrConfig.cmake.in +++ b/mshrConfig.cmake.in @@ -12,4 +12,4 @@ set(mshr_LIBRARIES_DIRS "@CONF_LIBRARIES_DIRS@") set(mshr_EXTERNAL_LIBRARIES "@CONF_EXTERNAL_LIBRARIES@") set(mshr_CXX_DEFINITIONS "@CONF_CXX_DEFINITIONS@") set(mshr_CXX_FLAGS "@CONF_CXX_FLAGS@") -set(mshr_LIBRARIES mshr) +set(mshr_LIBRARIES mshr${MSHR_LIB_NAME_EXT}) diff --git a/python/cmake/Findmshr.cmake b/python/cmake/Findmshr.cmake index 21737fd..f14e5bb 100644 --- a/python/cmake/Findmshr.cmake +++ b/python/cmake/Findmshr.cmake @@ -20,7 +20,7 @@ find_path(mshr_INCLUDE_DIR mshr.h DOC "The mshr include directory") -set(mshr_NAMES ${mshr_NAMES} libmshr mshr) +set(mshr_NAMES ${mshr_NAMES} libmshr${MSHR_LIB_NAME_EXT} mshr${MSHR_LIB_NAME_EXT}) find_library(mshr_LIBRARY NAMES ${mshr_NAMES} DOC "The mshr library") @@ -39,7 +39,7 @@ if(mshr_FOUND) set( mshr_FOUND 1 ) # use by setuptools.Extension, mshr_LIBRARIES must be in a form that appends to -l # i.e. mshr not libmshr.so - set( mshr_LIBRARIES "mshr" ) + set( mshr_LIBRARIES "mshr${MSHR_LIB_NAME_EXT}" ) get_filename_component( mshr_LIBRARIES_DIRS ${mshr_LIBRARY} DIRECTORY ) set( mshr_INCLUDE_DIRS ${mshr_INCLUDE_DIR} ) else() diff --git a/python/setup.py b/python/setup.py index 2dde610..ed512f8 100644 --- a/python/setup.py +++ b/python/setup.py @@ -6,15 +6,24 @@ from setuptools import setup, Extension # Call cmake to generate json file with include and link information about dolfin and pybind11 -if not os.path.isfile(os.path.join("build", "config.json")) : - if not os.path.exists("build") : - os.mkdir("build") +MSHR_LIB_NAME_EXT = os.environ.get('MSHR_LIB_NAME_EXT') or '' +DOLFIN_LIB_NAME_EXT = os.environ.get('DOLFIN_LIB_NAME_EXT') or '' +config_dir="build" + MSHR_LIB_NAME_EXT +if not os.path.isfile(os.path.join(config_dir, "config.json")) : + if not os.path.exists(config_dir) : + os.mkdir(config_dir) cmake_command=["cmake", os.getcwd()] if os.environ.get('CMAKE_PREFIX_PATH'): cmake_command.extend(['-DCMAKE_PREFIX_PATH={}'.format(os.environ['CMAKE_PREFIX_PATH'])]) - subprocess.check_call(cmake_command, cwd=os.path.abspath("build")) - -with open(os.path.join("build", "config.json"), 'r') as infile : + if MSHR_LIB_NAME_EXT: + cmake_command.extend(['-DMSHR_LIB_NAME_EXT={}'.format(MSHR_LIB_NAME_EXT)]) + if DOLFIN_LIB_NAME_EXT: + cmake_command.extend(['-DDOLFIN_LIB_NAME_EXT={}'.format(DOLFIN_LIB_NAME_EXT)]) + elif MSHR_LIB_NAME_EXT: + cmake_command.extend(['-DDOLFIN_LIB_NAME_EXT={}'.format(MSHR_LIB_NAME_EXT)]) + subprocess.check_call(cmake_command, cwd=os.path.abspath(config_dir)) + +with open(os.path.join(config_dir, "config.json"), 'r') as infile : config = json.load(infile) include_dirs = config["pybind11"]["include_dirs"].split(";") + \