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})
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})
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
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})
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")
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()
# 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(";") + \