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
# Add the target for this directory
set(_target_name PythonInterfaceCore)
add_library(${_target_name} ${SRC_FILES} ${INC_FILES})
add_library(Mantid::${_target_name} ALIAS ${_target_name})
......@@ -79,22 +80,25 @@ target_include_directories(${_target_name} PUBLIC
$<INSTALL_INTERFACE:include/Mantid>
)
target_include_directories(${_target_name} SYSTEM PUBLIC ${Boost_INCLUDE_DIRS})
# Set the name of the generated library
set_target_properties(
${_target_name} PROPERTIES OUTPUT_NAME MantidPythonInterfaceCore
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})
endif()
if(USE_PYTHON_DYNAMIC_LIB)
list(APPEND PUBLIC_TARGETS Python::Python)
endif()
# Dependencies
target_link_libraries(
${_target_name}
PUBLIC ${PUBLIC_TARGETS} Mantid::Kernel ${Boost_LIBRARIES}
PUBLIC ${PUBLIC_TARGETS} Mantid::Kernel
PRIVATE Mantid::Types
)
......@@ -112,6 +116,12 @@ elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
)
endif()
if (CONDA_BUILD)
set(TARGET_EXPORT_NAME "MantidPythonInterfaceCoreTargets")
mtd_install_framework_lib(TARGETS PythonInterfaceCore EXPORT_NAME ${TARGET_EXPORT_NAME})
else()
mtd_install_targets(
TARGETS PythonInterfaceCore INSTALL_DIRS ${LIB_DIR} ${WORKBENCH_LIB_DIR}
)
endif()
......@@ -13,6 +13,7 @@ set_property(TARGET PythonModule PROPERTY FOLDER "MantidFramework/Python")
# Sub modules
# These sub modules are currently not exported by cmake as they are not needed in a dev environment
add_subdirectory(kernel)
# Ensure the module files are in place
add_dependencies(PythonKernelModule PythonModule)
......
......@@ -4,8 +4,9 @@
include(CMakeFindDependencyMacro)
find_dependency(Boost COMPONENTS date_time regex serialization filesystem system)
find_dependency(Python @Python_VERSION_MAJOR@.@Python_VERSION_MINOR@ REQUIRED
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(GSL)
find_dependency(ZLIB)
......@@ -55,6 +56,7 @@ set(MODULES
ScriptRepository
Muon
Reflectometry
PythonInterfaceCore
)
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