Commit fab12fec authored by Stephen's avatar Stephen
Browse files

Export pythoninterfacecore

parent e325bbd4
...@@ -70,6 +70,7 @@ enable_precompiled_headers(inc/MantidPythonInterface/core/PrecompiledHeader.h SR ...@@ -70,6 +70,7 @@ enable_precompiled_headers(inc/MantidPythonInterface/core/PrecompiledHeader.h SR
# Add the target for this directory # Add the target for this directory
set(_target_name PythonInterfaceCore) set(_target_name PythonInterfaceCore)
add_library(${_target_name} ${SRC_FILES} ${INC_FILES}) add_library(${_target_name} ${SRC_FILES} ${INC_FILES})
add_library(Mantid::${_target_name} ALIAS ${_target_name}) add_library(Mantid::${_target_name} ALIAS ${_target_name})
...@@ -79,22 +80,25 @@ target_include_directories(${_target_name} PUBLIC ...@@ -79,22 +80,25 @@ target_include_directories(${_target_name} PUBLIC
$<INSTALL_INTERFACE:include/Mantid> $<INSTALL_INTERFACE:include/Mantid>
) )
target_include_directories(${_target_name} SYSTEM PUBLIC ${Boost_INCLUDE_DIRS})
# Set the name of the generated library # Set the name of the generated library
set_target_properties( set_target_properties(
${_target_name} PROPERTIES OUTPUT_NAME MantidPythonInterfaceCore ${_target_name} PROPERTIES OUTPUT_NAME MantidPythonInterfaceCore
COMPILE_DEFINITIONS IN_MANTID_PYTHONINTERFACE_CORE COMPILE_DEFINITIONS IN_MANTID_PYTHONINTERFACE_CORE
) )
# We need an if check here as older versions of boost won't define this target
# we can remove it once we adopt conda fully.
if (TARGET Boost::python${Python_VERSION_MAJOR}${Python_VERSION_MINOR})
set(PUBLIC_TARGETS Python::NumPy Boost::python${Python_VERSION_MAJOR}${Python_VERSION_MINOR})
else()
set(PUBLIC_TARGETS Python::NumPy ${BoostPython_LIBRARIES}) set(PUBLIC_TARGETS Python::NumPy ${BoostPython_LIBRARIES})
endif()
if(USE_PYTHON_DYNAMIC_LIB) if(USE_PYTHON_DYNAMIC_LIB)
list(APPEND PUBLIC_TARGETS Python::Python) list(APPEND PUBLIC_TARGETS Python::Python)
endif() endif()
# Dependencies # Dependencies
target_link_libraries( target_link_libraries(
${_target_name} ${_target_name}
PUBLIC ${PUBLIC_TARGETS} Mantid::Kernel ${Boost_LIBRARIES} PUBLIC ${PUBLIC_TARGETS} Mantid::Kernel
PRIVATE Mantid::Types PRIVATE Mantid::Types
) )
...@@ -112,6 +116,12 @@ elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") ...@@ -112,6 +116,12 @@ elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
) )
endif() endif()
if (CONDA_BUILD)
set(TARGET_EXPORT_NAME "MantidPythonInterfaceCoreTargets")
mtd_install_framework_lib(TARGETS PythonInterfaceCore EXPORT_NAME ${TARGET_EXPORT_NAME})
else()
mtd_install_targets( mtd_install_targets(
TARGETS PythonInterfaceCore INSTALL_DIRS ${LIB_DIR} ${WORKBENCH_LIB_DIR} TARGETS PythonInterfaceCore INSTALL_DIRS ${LIB_DIR} ${WORKBENCH_LIB_DIR}
) )
endif()
...@@ -13,6 +13,7 @@ set_property(TARGET PythonModule PROPERTY FOLDER "MantidFramework/Python") ...@@ -13,6 +13,7 @@ set_property(TARGET PythonModule PROPERTY FOLDER "MantidFramework/Python")
# Sub modules # Sub modules
# These sub modules are currently not exported by cmake as they are not needed in a dev environment
add_subdirectory(kernel) add_subdirectory(kernel)
# Ensure the module files are in place # Ensure the module files are in place
add_dependencies(PythonKernelModule PythonModule) add_dependencies(PythonKernelModule PythonModule)
......
...@@ -4,8 +4,9 @@ ...@@ -4,8 +4,9 @@
include(CMakeFindDependencyMacro) include(CMakeFindDependencyMacro)
find_dependency(Python @Python_VERSION_MAJOR@.@Python_VERSION_MINOR@ REQUIRED
find_dependency(Boost COMPONENTS date_time regex serialization filesystem system) COMPONENTS Interpreter Development NumPy)
find_dependency(Boost COMPONENTS date_time regex serialization filesystem system python${Python_VERSION_MAJOR}${Python_VERSION_MINOR})
find_dependency(Poco COMPONENTS Foundation Util XML Net Crypto NetSSL) find_dependency(Poco COMPONENTS Foundation Util XML Net Crypto NetSSL)
find_dependency(GSL) find_dependency(GSL)
find_dependency(ZLIB) find_dependency(ZLIB)
...@@ -55,6 +56,7 @@ set(MODULES ...@@ -55,6 +56,7 @@ set(MODULES
ScriptRepository ScriptRepository
Muon Muon
Reflectometry Reflectometry
PythonInterfaceCore
) )
foreach(module ${MODULES}) foreach(module ${MODULES})
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment