Commit 6b298607 authored by Stephen's avatar Stephen
Browse files

Change install call to use original if not conda build

parent 333510d4
......@@ -83,14 +83,16 @@ target_include_directories(NexusGeometry PUBLIC
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/Framework/NexusGeometry>
$<INSTALL_INTERFACE:include/Mantid>
)
generate_mantid_export_header(NexusGeometry FALSE)
generate_mantid_export_header(NexusGeometry TRUE)
# Installation settings
if (CONDA_BUILD)
set(TARGET_EXPORT_NAME "MantidNexusGeometryTargets")
mtd_install_dylib(TARGETS NexusGeometry INSTALL_EXPORT_FILE EXPORT_NAME ${TARGET_EXPORT_NAME} INSTALL_DIRS ${LIB_DIR} ${WORKBENCH_LIB_DIR})
install(EXPORT ${TARGET_EXPORT_NAME}
FILE ${TARGET_EXPORT_NAME}.cmake
NAMESPACE Mantid::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/MantidFramework
)
\ No newline at end of file
mtd_install_framework_lib(TARGETS NexusGeometry INSTALL_EXPORT_FILE EXPORT_NAME ${TARGET_EXPORT_NAME})
else()
mtd_install_targets(TARGETS
NexusGeometry
INSTALL_DIRS
${LIB_DIR}
${WORKBENCH_LIB_DIR})
endif()
\ No newline at end of file
......@@ -128,23 +128,18 @@ endif()
# Add the unit tests directory
add_subdirectory(test)
# Installation settings
mtd_install_dylib(TARGETS
if (CONDA_BUILD)
set(TARGET_EXPORT_NAME "MantidParallelTargets")
mtd_install_framework_lib(TARGETS Parallel EXPORT_NAME ${TARGET_EXPORT_NAME})
else()
mtd_install_targets(TARGETS
Parallel
INSTALL_DIRS
${LIB_DIR}
${WORKBENCH_LIB_DIR})
# Installation settings
set(TARGET_EXPORT_NAME "MantidParallelTargets")
mtd_install_dylib(TARGETS Parallel EXPORT_NAME ${TARGET_EXPORT_NAME} INSTALL_DIRS ${LIB_DIR} ${WORKBENCH_LIB_DIR})
install(EXPORT ${TARGET_EXPORT_NAME}
FILE ${TARGET_EXPORT_NAME}.cmake
NAMESPACE Mantid::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/MantidFramework
)
endif()
mtd_install_targets(TARGETS
EventParallelLoader
......
......@@ -123,11 +123,14 @@ target_include_directories(Reflectometry PUBLIC
generate_mantid_export_header(Reflectometry FALSE)
# Installation settings
if (CONDA_BUILD)
set(TARGET_EXPORT_NAME "MantidReflectometryTargets")
mtd_install_dylib(TARGETS Reflectometry INSTALL_EXPORT_FILE EXPORT_NAME ${TARGET_EXPORT_NAME} INSTALL_DIRS ${LIB_DIR} ${WORKBENCH_LIB_DIR})
mtd_install_framework_lib(TARGETS Reflectometry INSTALL_EXPORT_FILE EXPORT_NAME ${TARGET_EXPORT_NAME})
else()
mtd_install_targets(TARGETS
Reflectometry
INSTALL_DIRS
${PLUGINS_DIR}
${WORKBENCH_PLUGINS_DIR})
endif()
install(EXPORT ${TARGET_EXPORT_NAME}
FILE ${TARGET_EXPORT_NAME}.cmake
NAMESPACE Mantid::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/MantidFramework
)
......@@ -80,11 +80,13 @@ target_link_libraries(RemoteAlgorithms PUBLIC Mantid::API PRIVATE Mantid::Kernel
add_subdirectory(test) # Note: No tests yet for many remote algorithms...
# Installation settings
if (CONDA_BUILD)
set(TARGET_EXPORT_NAME "MantidRemoteAlgorithmsTargets")
mtd_install_dylib(TARGETS RemoteAlgorithms EXPORT_NAME ${TARGET_EXPORT_NAME} INSTALL_DIRS ${LIB_DIR} ${WORKBENCH_LIB_DIR})
install(EXPORT ${TARGET_EXPORT_NAME}
FILE ${TARGET_EXPORT_NAME}.cmake
NAMESPACE Mantid::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/MantidFramework
)
mtd_install_framework_lib(TARGETS RemoteAlgorithms EXPORT_NAME ${TARGET_EXPORT_NAME})
else()
mtd_install_targets(TARGETS
RemoteAlgorithms
INSTALL_DIRS
${PLUGINS_DIR}
${WORKBENCH_PLUGINS_DIR})
endif()
......@@ -57,11 +57,13 @@ target_link_libraries(RemoteJobManagers PUBLIC Mantid::Kernel Mantid::API)
add_subdirectory(test)
# Installation settings
if (CONDA_BUILD)
set(TARGET_EXPORT_NAME "MantidRemoteJobManagersTargets")
mtd_install_dylib(TARGETS RemoteJobManagers EXPORT_NAME ${TARGET_EXPORT_NAME} INSTALL_DIRS ${LIB_DIR} ${WORKBENCH_LIB_DIR})
install(EXPORT ${TARGET_EXPORT_NAME}
FILE ${TARGET_EXPORT_NAME}.cmake
NAMESPACE Mantid::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/MantidFramework
)
\ No newline at end of file
mtd_install_framework_lib(TARGETS RemoteJobManagers EXPORT_NAME ${TARGET_EXPORT_NAME})
else()
mtd_install_targets(TARGETS
RemoteJobManagers
INSTALL_DIRS
${PLUGINS_DIR}
${WORKBENCH_PLUGINS_DIR})
endif()
\ No newline at end of file
......@@ -176,11 +176,14 @@ target_link_libraries(SINQ PUBLIC Mantid::Kernel Mantid::Geometry Mantid::API Ma
add_subdirectory(test)
# Installation settings
if (CONDA_BUILD)
set(TARGET_EXPORT_NAME "MantidSINQTargets")
mtd_install_dylib(TARGETS SINQ EXPORT_NAME ${TARGET_EXPORT_NAME} INSTALL_DIRS ${LIB_DIR} ${WORKBENCH_LIB_DIR})
mtd_install_framework_lib(TARGETS SINQ EXPORT_NAME ${TARGET_EXPORT_NAME})
else()
mtd_install_targets(TARGETS
SINQ
INSTALL_DIRS
${PLUGINS_DIR}
${WORKBENCH_PLUGINS_DIR})
endif()
install(EXPORT ${TARGET_EXPORT_NAME}
FILE ${TARGET_EXPORT_NAME}.cmake
NAMESPACE Mantid::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/MantidFramework
)
......@@ -47,8 +47,13 @@ set_property(TARGET ScriptRepository PROPERTY FOLDER "MantidFramework")
target_link_libraries(ScriptRepository PUBLIC Mantid::Kernel Mantid::API PRIVATE Mantid::Json)
mtd_install_dylib(TARGETS
if (CONDA_BUILD)
set(TARGET_EXPORT_NAME "MantidScriptRepositoryTargets")
mtd_install_framework_lib(TARGETS ScriptRepository EXPORT_NAME ${TARGET_EXPORT_NAME})
else()
mtd_install_targets(TARGETS
ScriptRepository
INSTALL_DIRS
${PLUGINS_DIR}
${WORKBENCH_PLUGINS_DIR})
endif()
\ No newline at end of file
......@@ -48,16 +48,12 @@ target_link_libraries(Types PUBLIC Boost::date_time Boost::regex)
generate_mantid_export_header(Types FALSE)
# Installation settings
if (CONDA_BUILD)
set(TARGET_EXPORT_NAME "MantidTypesTargets")
mtd_install_dylib(TARGETS Types INSTALL_EXPORT_FILE EXPORT_NAME ${TARGET_EXPORT_NAME} INSTALL_DIRS ${LIB_DIR} ${WORKBENCH_LIB_DIR})
install(EXPORT ${TARGET_EXPORT_NAME}
FILE ${TARGET_EXPORT_NAME}.cmake
NAMESPACE Mantid::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/MantidFramework
)
mtd_install_framework_lib(TARGETS Types INSTALL_EXPORT_FILE EXPORT_NAME ${TARGET_EXPORT_NAME})
else()
mtd_install_targets(TARGETS Types INSTALL_DIRS ${LIB_DIR} ${WORKBENCH_LIB_DIR})
endif()
# Add the unit tests directory
add_subdirectory(test)
......@@ -143,11 +143,13 @@ target_link_libraries(WorkflowAlgorithms PUBLIC Mantid::Nexus Mantid::API Mantid
add_subdirectory(test)
# Installation settings
if (CONDA_BUILD)
set(TARGET_EXPORT_NAME "MantidWorkflowAlgorithmsTargets")
mtd_install_dylib(TARGETS WorkflowAlgorithms EXPORT_NAME ${TARGET_EXPORT_NAME} INSTALL_DIRS ${LIB_DIR} ${WORKBENCH_LIB_DIR})
install(EXPORT ${TARGET_EXPORT_NAME}
FILE ${TARGET_EXPORT_NAME}.cmake
NAMESPACE Mantid::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/MantidFramework
)
mtd_install_framework_lib(TARGETS WorkflowAlgorithms EXPORT_NAME ${TARGET_EXPORT_NAME})
else()
mtd_install_targets(TARGETS
WorkflowAlgorithms
INSTALL_DIRS
${PLUGINS_DIR}
${WORKBENCH_PLUGINS_DIR})
endif()
......@@ -45,6 +45,7 @@ set(MODULES
Algorithms
WorkflowAlgorithms
CurveFitting
MDAlgorithms
Crystal
ICat
LiveData
......
......@@ -22,42 +22,36 @@ function (mtd_install_targets)
endfunction()
# Install a target into multiple directories
# This respects ENABLE_WORKBENCH flags for macOS
function (mtd_install_dylib)
set (options INSTALL_EXPORT_FILE)
set (oneValueArgs TARGETS EXPORT_NAME)
set (multiValueArgs INSTALL_DIRS)
cmake_parse_arguments (PARSED "${options}" "${oneValueArgs}"
"${multiValueArgs}" ${ARGN})
if (NOT PARSED_INSTALL_DIRS)
message(FATAL_ERROR "Empty argument INSTALL_DIRS")
return()
endif()
if (NOT PARSED_TARGETS)
message(FATAL_ERROR "Empty argument TARGETS")
return()
endif()
install(
DIRECTORY inc/
DESTINATION include/Mantid
COMPONENT Devel
PATTERN ".in" EXCLUDE
)
if(PARSED_INSTALL_EXPORT_FILE)
# Install a framework library (used primarily for a conda install)
function (mtd_install_framework_lib)
set (options INSTALL_EXPORT_FILE)
set (oneValueArgs TARGETS EXPORT_NAME)
set (multiValueArgs INSTALL_DIRS)
cmake_parse_arguments (PARSED "${options}" "${oneValueArgs}"
"${multiValueArgs}" ${ARGN})
install(
DIRECTORY inc/
DESTINATION include/Mantid
COMPONENT Devel
PATTERN ".in" EXCLUDE)
if(PARSED_INSTALL_EXPORT_FILE)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/Mantid${PARSED_TARGETS}/DllConfig.h
DESTINATION include/Mantid/Mantid${PARSED_TARGETS}
COMPONENT Devel
)
endif()
install ( TARGETS ${PARSED_TARGETS}
EXPORT ${PARSED_EXPORT_NAME}
COMPONENT Devel)
endif()
install ( TARGETS ${PARSED_TARGETS}
EXPORT ${PARSED_EXPORT_NAME}
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin
)
RUNTIME DESTINATION bin)
install(EXPORT ${PARSED_EXPORT_NAME}
FILE ${PARSED_EXPORT_NAME}.cmake
NAMESPACE Mantid::
COMPONENT Devel
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/MantidFramework
)
endfunction()
......
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