Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
mantidproject
mantid
Commits
c12936d2
Commit
c12936d2
authored
Jul 26, 2021
by
Stephen
Browse files
Setting up export targets
parent
3d10baac
Changes
22
Hide whitespace changes
Inline
Side-by-side
CMakePresets.json
View file @
c12936d2
...
...
@@ -31,7 +31,7 @@
"cacheVariables"
:
{
"CMAKE_PREFIX_PATH"
:
"$env{CONDA_PREFIX}"
,
"CONDA_BUILD"
:
true
,
"HDF5_
DIR
"
:
"$env{CONDA_PREFIX}/Library
/cmake/hdf5
"
"HDF5_
ROOT
"
:
"$env{CONDA_PREFIX}/Library"
}
},
{
...
...
Framework/API/CMakeLists.txt
View file @
c12936d2
...
...
@@ -546,20 +546,16 @@ endif()
# Add to the 'Framework' group in VS
set_property
(
TARGET API PROPERTY FOLDER
"MantidFramework"
)
target_include_directories
(
API SYSTEM PUBLIC
${
NEXUS_INCLUDE_DIR
}
${
Boost_INCLUDE_DIRS
}
)
target_link_libraries
(
API
PUBLIC
${
NEXUS_LIBRARIES
}
${
Boost_LIBRARIES
}
Mantid::HistogramData
Mantid::Types
Mantid::Kernel
Mantid::Geometry
Mantid::Indexing
Mantid::Parallel
Nexus::nexus
PRIVATE
${
WINSOCK
}
${
BCRYPT
}
...
...
@@ -581,8 +577,8 @@ generate_mantid_export_header(API TRUE)
set
(
TARGET_EXPORT_NAME
"MantidAPITargets"
)
mtd_install_dylib
(
TARGETS API 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/Mantid
# )
\ No newline at end of file
install
(
EXPORT
${
TARGET_EXPORT_NAME
}
FILE
${
TARGET_EXPORT_NAME
}
.cmake
NAMESPACE Mantid::
DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
/cmake/MantidFramework
)
\ No newline at end of file
Framework/Algorithms/CMakeLists.txt
View file @
c12936d2
...
...
@@ -1060,7 +1060,7 @@ endif()
# Add to the 'Framework' group in VS
set_property
(
TARGET Algorithms PROPERTY FOLDER
"MantidFramework"
)
target_link_libraries
(
Algorithms PUBLIC Mantid::API Mantid::HistogramData Mantid::Kernel Mantid::Geometry Mantid::Indexing PRIVATE Mantid::DataObjects Mantid::Parallel Mantid::Types
)
target_link_libraries
(
Algorithms PUBLIC Mantid::API Mantid::HistogramData Mantid::Kernel Mantid::Geometry Mantid::Indexing PRIVATE Mantid::DataObjects Mantid::Parallel Mantid::Types
Boost::filesystem
)
# Add the unit tests directory
add_subdirectory
(
test
)
...
...
Framework/Beamline/CMakeLists.txt
View file @
c12936d2
...
...
@@ -60,12 +60,18 @@ target_link_libraries(Beamline
add_subdirectory
(
test
)
# Auto-generate exports header
target_include_directories
(
Beamline PUBLIC
${
CMAKE_BINARY_DIR
}
/Framework/Beamline
)
target_include_directories
(
Beamline PUBLIC
$<BUILD_INTERFACE:
${
CMAKE_BINARY_DIR
}
/Framework/Beamline>
$<INSTALL_INTERFACE:include/Mantid>
)
generate_mantid_export_header
(
Beamline FALSE
)
# Installation settings
mtd_install_dylib
(
TARGETS
Beamline
INSTALL_DIRS
${
LIB_DIR
}
${
WORKBENCH_LIB_DIR
}
)
set
(
TARGET_EXPORT_NAME
"MantidBeamlineTargets"
)
mtd_install_dylib
(
TARGETS Beamline 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
Framework/CMakeLists.txt
View file @
c12936d2
...
...
@@ -202,3 +202,12 @@ install(FILES
"
${
CMAKE_CURRENT_BINARY_DIR
}
/MantidFrameworkConfigVersion.cmake"
DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
/cmake/MantidFramework
)
install
(
FILES
${
CMAKE_SOURCE_DIR
}
/buildconfig/CMake/FindNexus.cmake
${
CMAKE_SOURCE_DIR
}
/buildconfig/CMake/FindJsonCPP.cmake
${
CMAKE_SOURCE_DIR
}
/buildconfig/CMake/FindTBB.cmake
${
CMAKE_SOURCE_DIR
}
/buildconfig/CMake/FindMuParser.cmake
DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
/cmake/MantidFramework/find_modules
)
Framework/Crystal/CMakeLists.txt
View file @
c12936d2
...
...
@@ -263,7 +263,7 @@ set_property(TARGET Crystal PROPERTY FOLDER "MantidFramework")
include_directories
(
inc
)
target_link_libraries
(
Crystal PUBLIC Mantid::API Mantid::Geometry Mantid::Kernel PRIVATE Mantid::DataObjects Mantid::Indexing
)
target_link_libraries
(
Crystal PUBLIC Mantid::API Mantid::Geometry Mantid::Kernel PRIVATE Mantid::DataObjects Mantid::Indexing
Boost::filesystem
)
# Add the unit tests directory
add_subdirectory
(
test
)
...
...
Framework/DataHandling/CMakeLists.txt
View file @
c12936d2
...
...
@@ -691,6 +691,7 @@ target_link_libraries(DataHandling
Mantid::Parallel
PRIVATE
Mantid::Json
Boost::filesystem
Mantid::NexusGeometry
)
target_include_directories
(
DataHandling SYSTEM PUBLIC
${
HDF5_INCLUDE_DIRS
}
)
...
...
Framework/Geometry/CMakeLists.txt
View file @
c12936d2
...
...
@@ -470,8 +470,6 @@ target_include_directories(Geometry PUBLIC
$<INSTALL_INTERFACE:include/Mantid>
)
target_include_directories
(
Geometry SYSTEM PUBLIC
${
NEXUS_INCLUDE_DIR
}
${
TBB_INCLUDE_DIRS
}
${
MUPARSER_INCLUDE_DIR
}
)
# Set the name of the generated library
set_target_properties
(
Geometry
PROPERTIES OUTPUT_NAME
...
...
@@ -494,7 +492,11 @@ endif()
# Add to the 'Framework' group in VS
set_property
(
TARGET Geometry PROPERTY FOLDER
"MantidFramework"
)
target_link_libraries
(
Geometry PUBLIC Mantid::Kernel Mantid::Beamline
${
NEXUS_LIBRARIES
}
${
TBB_LIBRARIES
}
${
TBB_MALLOC_LIBRARIES
}
${
MUPARSER_LIBRARIES
}
target_link_libraries
(
Geometry
PUBLIC
Mantid::Kernel
Mantid::Beamline
MuParser::MuParser
PRIVATE
Mantid::Json
)
...
...
@@ -514,9 +516,18 @@ endif()
add_subdirectory
(
test
)
# Installation settings
# Auto-generate exports header
target_include_directories
(
Geometry PUBLIC
$<BUILD_INTERFACE:
${
CMAKE_BINARY_DIR
}
/Framework/Geometry>
$<INSTALL_INTERFACE:include/Mantid>
)
# Installation settings
set
(
TARGET_EXPORT_NAME
"MantidGeometryTargets"
)
mtd_install_dylib
(
TARGETS Geometry EXPORT_NAME
${
TARGET_EXPORT_NAME
}
INSTALL_DIRS
${
LIB_DIR
}
${
WORKBENCH_LIB_DIR
}
)
mtd_
install
_dylib
(
TARGETS
Geometry
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
Framework/HistogramData/CMakeLists.txt
View file @
c12936d2
...
...
@@ -143,12 +143,18 @@ target_link_libraries(HistogramData PUBLIC Kernel)
add_subdirectory
(
test
)
# Auto-generate exports header
target_include_directories
(
HistogramData PUBLIC
${
CMAKE_BINARY_DIR
}
/Framework/HistogramData
)
target_include_directories
(
HistogramData PUBLIC
$<BUILD_INTERFACE:
${
CMAKE_BINARY_DIR
}
/Framework/HistogramData>
$<INSTALL_INTERFACE:include/Mantid>
)
generate_mantid_export_header
(
HistogramData FALSE
)
# Installation settings
mtd_install_dylib
(
TARGETS
HistogramData
INSTALL_DIRS
${
LIB_DIR
}
${
WORKBENCH_LIB_DIR
}
)
set
(
TARGET_EXPORT_NAME
"MantidHistogramDataTargets"
)
mtd_install_dylib
(
TARGETS HistogramData 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
Framework/Indexing/CMakeLists.txt
View file @
c12936d2
...
...
@@ -98,12 +98,18 @@ endif()
add_subdirectory
(
test
)
# Auto-generate exports header
target_include_directories
(
Indexing PUBLIC
${
CMAKE_BINARY_DIR
}
/Framework/Indexing
)
target_include_directories
(
Indexing PUBLIC
$<BUILD_INTERFACE:
${
CMAKE_BINARY_DIR
}
/Framework/Indexing>
$<INSTALL_INTERFACE:include/Mantid>
)
generate_mantid_export_header
(
Indexing TRUE
)
# Installation settings
mtd_install_dylib
(
TARGETS
Indexing
INSTALL_DIRS
${
LIB_DIR
}
${
WORKBENCH_LIB_DIR
}
)
set
(
TARGET_EXPORT_NAME
"MantidIndexingTargets"
)
mtd_install_dylib
(
TARGETS Indexing 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
)
Framework/Json/CMakeLists.txt
View file @
c12936d2
...
...
@@ -31,7 +31,6 @@ target_include_directories(Json PUBLIC
$<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
/inc>
$<INSTALL_INTERFACE:include/Mantid>
)
message
(
"BOOST LIBRARIEES ARE THESE
${
Boost_LIBRARIES
}
JSON ARE
${
JSONCPP_LIBRARIES
}
"
)
# Add to the 'Framework' group in VS
set_property
(
TARGET Json PROPERTY FOLDER
"MantidFramework"
)
...
...
Framework/Kernel/CMakeLists.txt
View file @
c12936d2
...
...
@@ -495,12 +495,6 @@ target_include_directories(Kernel PUBLIC
$<INSTALL_INTERFACE:include/Mantid>
)
target_include_directories
(
Kernel SYSTEM
PUBLIC
${
Boost_INCLUDE_DIRS
}
${
POCO_INCLUDE_DIRS
}
${
NEXUS_INCLUDE_DIR
}
${
GSL_INCLUDE_DIR
}
${
OPENSSL_INCLUDE_DIR
}
${
HDF5_INCLUDE_DIRS
}
)
if
(
${
CMAKE_SYSTEM_NAME
}
MATCHES
"Darwin"
)
set_target_properties
(
Kernel PROPERTIES INSTALL_RPATH
"@loader_path/../MacOS;@loader_path/../Frameworks"
)
elseif
(
${
CMAKE_SYSTEM_NAME
}
STREQUAL
"Linux"
)
...
...
@@ -510,18 +504,24 @@ endif()
# Add to the 'Framework' group in VS
set_property
(
TARGET Kernel PROPERTY FOLDER
"MantidFramework"
)
target_compile_features
(
Kernel PUBLIC cxx_std_17
)
target_link_libraries
(
Kernel
PUBLIC
Mantid::Types
Mantid::Json
${
NEXUS_LIBRARIES
}
Nexus::nexuscpp
Eigen3::Eigen
${
TBB_LIBRARIES
}
${
TBB_MALLOC_LIBRARIES
}
${
POCO_LIBRARIES
}
${
GSL_LIBRARIES
}
${
HDF5_LIBRARIES
}
TBB::tbb
Poco::Foundation
Poco::Net
Poco::XML
Poco::Util
Poco::NetSSL
GSL::gsl
hdf5::hdf5_cpp
hdf5::hdf5_hl
hdf5::hdf5
PRIVATE
${
NETWORK_LIBRARIES
}
span
...
...
@@ -531,6 +531,9 @@ if(WIN32)
# queries
endif
()
# H5_BUILT_AS_DYNAMIC_LIB required https://github.com/conda-forge/hdf5-feedstock/issues/58
target_compile_definitions
(
Kernel PUBLIC -DH5_BUILT_AS_DYNAMIC_LIB
)
# Add the unit tests directory
add_subdirectory
(
test
)
...
...
@@ -612,8 +615,15 @@ else()
endif
()
# Installation settings
set
(
TARGET_EXPORT_NAME
"MantidKernelTargets"
)
mtd_install_dylib
(
TARGETS Kernel EXPORT_NAME
${
TARGET_EXPORT_NAME
}
INSTALL_DIRS
${
LIB_DIR
}
${
WORKBENCH_LIB_DIR
}
)
mtd_install_dylib
(
TARGETS Kernel 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
)
# Create the properties file for the installer
set
(
MANTID_ROOT_BUILD
${
MANTID_ROOT
}
)
...
...
Framework/NexusGeometry/CMakeLists.txt
View file @
c12936d2
...
...
@@ -71,7 +71,9 @@ target_link_libraries(NexusGeometry PUBLIC Mantid::Geometry Mantid::API
PRIVATE
Mantid::Kernel
Mantid::Json
Mantid::Indexing
)
Mantid::Indexing
Boost::filesystem
)
# Add the unit tests directory
add_subdirectory
(
test
)
...
...
Framework/Parallel/CMakeLists.txt
View file @
c12936d2
...
...
@@ -61,7 +61,7 @@ endif()
# Add the target for this directory
add_library
(
Parallel
${
SRC_FILES
}
${
INC_FILES
}
)
add_library
(
Mantid::Parallel ALIAS Parallel
)
add_dependencies
(
Parallel EventParallelLoader Kernel
)
add_dependencies
(
Parallel EventParallelLoader
Mantid::
Kernel
)
target_include_directories
(
Parallel PUBLIC
$<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
/inc>
...
...
@@ -99,7 +99,7 @@ target_include_directories(EventParallelLoader PUBLIC
$<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
/inc>
$<INSTALL_INTERFACE:include/Mantid>
)
add_dependencies
(
EventParallelLoader Kernel
)
add_dependencies
(
EventParallelLoader
Mantid::
Kernel
)
# set the name of generated executable
set_target_properties
(
EventParallelLoader
PROPERTIES OUTPUT_NAME
...
...
@@ -119,7 +119,7 @@ endif()
set_property
(
TARGET EventParallelLoader PROPERTY FOLDER
"MantidFramework"
)
target_link_libraries
(
EventParallelLoader PUBLIC Mantid::Kernel Boost::serialization
)
target_link_libraries
(
EventParallelLoader PUBLIC Mantid::Kernel
PRIVATE
Boost::serialization
)
if
(
UNIX AND NOT APPLE
)
target_link_libraries
(
EventParallelLoader PRIVATE rt
)
...
...
@@ -134,6 +134,18 @@ mtd_install_dylib(TARGETS
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
)
mtd_install_targets
(
TARGETS
EventParallelLoader
INSTALL_DIRS
...
...
Framework/WorkflowAlgorithms/CMakeLists.txt
View file @
c12936d2
...
...
@@ -137,7 +137,7 @@ endif()
set_property
(
TARGET WorkflowAlgorithms PROPERTY FOLDER
"MantidFramework"
)
target_link_libraries
(
WorkflowAlgorithms PUBLIC Mantid::Nexus Mantid::API Mantid::DataObjects PRIVATE Mantid::Kernel
)
target_link_libraries
(
WorkflowAlgorithms PUBLIC Mantid::Nexus Mantid::API Mantid::DataObjects PRIVATE Mantid::Kernel
Boost::filesystem
)
# Add the unit tests directory
add_subdirectory
(
test
)
...
...
buildconfig/CMake/CommonSetup.cmake
View file @
c12936d2
...
...
@@ -104,17 +104,19 @@ if(CMAKE_HOST_WIN32 AND NOT CONDA_BUILD)
set
(
HDF5_DIR
"
${
THIRD_PARTY_DIR
}
/cmake/hdf5"
)
find_package
(
HDF5
COMPONENTS CXX HL
COMPONENTS
C
CXX HL
REQUIRED CONFIGS hdf5-config.cmake
)
set
(
HDF5_LIBRARIES hdf5::hdf5_cpp-shared hdf5::hdf5_hl-shared
)
add_library
(
hdf5::hdf5_cpp ALIAS hdf5::hdf5_cpp-shared
)
add_library
(
hdf5::hdf5_hl ALIAS hdf5::hdf5_hl-shared
)
add_library
(
hdf5::hdf5 ALIAS hdf5::hdf5-shared
)
else
()
# We'll use the cmake finder
# This will define HDF5_LIBRARIES and HDF5_HL_LIBRARIES
# We'll use the cmake finder
find_package
(
ZLIB REQUIRED
)
find_package
(
HDF5
COMPONENTS CXX HL
COMPONENTS
C
CXX HL
REQUIRED
)
endif
()
...
...
buildconfig/CMake/FindMuParser.cmake
View file @
c12936d2
...
...
@@ -52,3 +52,17 @@ if(MUPARSER_FOUND)
endif
()
mark_as_advanced
(
MUPARSER_INCLUDE_DIR MUPARSER_LIBRARY MUPARSER_LIBRARY_DEBUG
)
if
(
NOT TARGET MuParser::MuParser
)
add_library
(
MuParser::MuParser UNKNOWN IMPORTED
)
set_target_properties
(
MuParser::MuParser PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES
${
MUPARSER_INCLUDE_DIR
}
IMPORTED_LOCATION
${
MUPARSER_LIBRARY
}
)
if
(
EXISTS
"
${
MUPARSER_LIBRARY_DEBUG
}
"
)
set_target_properties
(
MuParser::MuParser PROPERTIES
IMPORTED_LOCATION_DEBUG
${
MUPARSER_LIBRARY_DEBUG
}
)
endif
()
endif
()
\ No newline at end of file
buildconfig/CMake/FindNexus.cmake
View file @
c12936d2
...
...
@@ -66,3 +66,85 @@ else (NEXUS_VERSION)
message
(
WARNING
"Failed to determine version: Ignoring version requirement"
)
find_package_handle_standard_args
(
Nexus DEFAULT_MSG NEXUS_LIBRARIES NEXUS_INCLUDE_DIR
)
endif
(
NEXUS_VERSION
)
if
(
WIN32
)
# c library
string
(
REPLACE
".lib"
".dll"
NEXUS_C_LIBRARIES_DLL
"
${
NEXUS_C_LIBRARIES
}
"
)
string
(
REPLACE
".lib"
".dll"
NEXUS_C_LIBRARIES_DEBUG_DLL
"
${
NEXUS_C_LIBRARIES_DEBUG
}
"
)
get_filename_component
(
NEXUS_C_LIBRARIES_DLL
${
NEXUS_C_LIBRARIES_DLL
}
NAME
)
get_filename_component
(
NEXUS_C_LIBRARIES_DEBUG_DLL
${
NEXUS_C_LIBRARIES_DEBUG_DLL
}
NAME
)
find_file
(
NEXUS_C_LIBRARIES_DLL PATH_SUFFIXES bin/
)
find_file
(
NEXUS_C_LIBRARIES_DEBUG_DLL PATH_SUFFIXES bin/
)
# cpp library
string
(
REPLACE
".lib"
".dll"
NEXUS_CPP_LIBRARIES_DLL
"
${
NEXUS_CPP_LIBRARIES
}
"
)
string
(
REPLACE
".lib"
".dll"
NEXUS_CPP_LIBRARIES_DEBUG_DLL
"
${
NEXUS_CPP_LIBRARIES_DEBUG
}
"
)
get_filename_component
(
NEXUS_CPP_LIBRARIES_DLL
${
NEXUS_CPP_LIBRARIES_DLL
}
NAME
)
get_filename_component
(
NEXUS_CPP_LIBRARIES_DEBUG_DLL
${
NEXUS_CPP_LIBRARIES_DEBUG_DLL
}
NAME
)
find_file
(
NEXUS_CPP_LIBRARIES_DLL PATH_SUFFIXES bin/
)
find_file
(
NEXUS_CPP_LIBRARIES_DEBUG_DLL PATH_SUFFIXES bin/
)
endif
()
if
(
NEXUS_FOUND AND NOT TARGET Nexus::nexus AND NOT TARGET Nexus::nexuscpp
)
if
(
NEXUS_C_LIBRARIES_DLL AND NEXUS_CPP_LIBRARIES_DLL
)
# Nexus c library
# Windows systems with dll libraries.
add_library
(
Nexus::nexus SHARED IMPORTED
)
# Windows with dlls, but only Release libraries.
set_target_properties
(
Nexus::nexus PROPERTIES
IMPORTED_LOCATION_RELEASE
"
${
NEXUS_C_LIBRARIES_DLL
}
"
IMPORTED_IMPLIB
"
${
NEXUS_C_LIBRARIES
}
"
INTERFACE_INCLUDE_DIRECTORIES
"
${
NEXUS_INCLUDE_DIR
}
"
IMPORTED_CONFIGURATIONS Release
IMPORTED_LINK_INTERFACE_LANGUAGES
"C"
)
# If we have both Debug and Release libraries
if
(
NEXUS_C_LIBRARIES_DEBUG_DLL
)
set_property
(
TARGET Nexus::nexus APPEND PROPERTY IMPORTED_CONFIGURATIONS Debug
)
set_target_properties
(
Nexus::nexus PROPERTIES
IMPORTED_LOCATION_DEBUG
"
${
NEXUS_C_LIBRARIES_DEBUG_DLL
}
"
IMPORTED_IMPLIB_DEBUG
"
${
NEXUS_C_LIBRARIES_DEBUG
}
"
)
endif
()
# Nexus cpp library
# Windows systems with dll libraries.
add_library
(
Nexus::nexuscpp SHARED IMPORTED
)
# Windows with dlls, but only Release libraries.
set_target_properties
(
Nexus::nexuscpp PROPERTIES
IMPORTED_LOCATION_RELEASE
"
${
NEXUS_CPP_LIBRARIES_DLL
}
"
IMPORTED_IMPLIB
"
${
NEXUS_CPP_LIBRARIES
}
"
INTERFACE_INCLUDE_DIRECTORIES
"
${
NEXUS_INCLUDE_DIR
}
"
IMPORTED_CONFIGURATIONS Release
IMPORTED_LINK_INTERFACE_LANGUAGES
"CXX"
)
# If we have both Debug and Release libraries
if
(
NEXUS_CPP_LIBRARIES_DEBUG_DLL
)
set_property
(
TARGET Nexus::nexuscpp APPEND PROPERTY IMPORTED_CONFIGURATIONS Debug
)
set_target_properties
(
Nexus::nexuscpp PROPERTIES
IMPORTED_LOCATION_DEBUG
"
${
NEXUS_CPP_LIBRARIES_DEBUG_DLL
}
"
IMPORTED_IMPLIB_DEBUG
"
${
NEXUS_CPP_LIBRARIES_DEBUG
}
"
)
endif
()
else
()
add_library
(
Nexus::nexus UNKNOWN IMPORTED
)
set_target_properties
(
Nexus::nexus PROPERTIES
IMPORTED_LOCATION
"
${
NEXUS_C_LIBRARIES
}
"
INTERFACE_INCLUDE_DIRECTORIES
"
${
NEXUS_INCLUDE_DIR
}
"
IMPORTED_LINK_INTERFACE_LANGUAGES
"C"
)
add_library
(
Nexus::nexuscpp UNKNOWN IMPORTED
)
set_target_properties
(
Nexus::nexuscpp PROPERTIES
IMPORTED_LOCATION
"
${
NEXUS_CPP_LIBRARIES
}
"
INTERFACE_INCLUDE_DIRECTORIES
"
${
NEXUS_INCLUDE_DIR
}
"
IMPORTED_LINK_INTERFACE_LANGUAGES
"CXX"
)
endif
()
endif
()
\ No newline at end of file
buildconfig/CMake/FindPoco.cmake
View file @
c12936d2
...
...
@@ -19,7 +19,7 @@ find_library ( POCO_LIB_NET_DEBUG NAMES PocoNetd )
find_library
(
POCO_LIB_CRYPTO_DEBUG NAMES PocoCryptod
)
find_library
(
POCO_LIB_NETSSL_DEBUG NAMES PocoNetSSLd
)
function
(
add_poco_lib POCO_LIB_MODULE POCO_DEBUG_LIB_MODULE
)
function
(
add_poco_lib
POCO_COMPONENT
POCO_LIB_MODULE POCO_DEBUG_LIB_MODULE
)
# Add poco library to list and also the corresponding debug library if it is available
if
(
EXISTS
"
${
POCO_DEBUG_LIB_MODULE
}
"
AND NOT
${
CONDA_BUILD
}
)
...
...
@@ -31,14 +31,28 @@ function( add_poco_lib POCO_LIB_MODULE POCO_DEBUG_LIB_MODULE )
set
(
POCO_LIBRARIES
${
POCO_LIBRARIES
}
${
POCO_LIB_MODULE
}
PARENT_SCOPE
)
endif
()
if
(
NOT TARGET Poco::
${
POCO_COMPONENT
}
)
add_library
(
Poco::
${
POCO_COMPONENT
}
UNKNOWN IMPORTED
)
set_target_properties
(
Poco::
${
POCO_COMPONENT
}
PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES
${
POCO_INCLUDE_DIR
}
IMPORTED_LOCATION
${
POCO_LIB_MODULE
}
)
if
(
EXISTS
"
${
POCO_DEBUG_LIB_MODULE
}
"
AND NOT
${
CONDA_BUILD
}
)
set_target_properties
(
Poco::
${
POCO_COMPONENT
}
PROPERTIES
IMPORTED_LOCATION_DEBUG
${
POCO_DEBUG_LIB_MODULE
}
)
endif
()
endif
()
endfunction
(
add_poco_lib
)
add_poco_lib
(
${
POCO_LIB_FOUNDATION
}
${
POCO_LIB_FOUNDATION_DEBUG
}
)
add_poco_lib
(
${
POCO_LIB_UTIL
}
${
POCO_LIB_UTIL_DEBUG
}
)
add_poco_lib
(
${
POCO_LIB_XML
}
${
POCO_LIB_XML_DEBUG
}
)
add_poco_lib
(
${
POCO_LIB_NET
}
${
POCO_LIB_NET_DEBUG
}
)
add_poco_lib
(
${
POCO_LIB_CRYPTO
}
${
POCO_LIB_CRYPTO_DEBUG
}
)
add_poco_lib
(
${
POCO_LIB_NETSSL
}
${
POCO_LIB_NETSSL_DEBUG
}
)
add_poco_lib
(
Foundation
${
POCO_LIB_FOUNDATION
}
${
POCO_LIB_FOUNDATION_DEBUG
}
)
add_poco_lib
(
Util
${
POCO_LIB_UTIL
}
${
POCO_LIB_UTIL_DEBUG
}
)
add_poco_lib
(
XML
${
POCO_LIB_XML
}
${
POCO_LIB_XML_DEBUG
}
)
add_poco_lib
(
Net
${
POCO_LIB_NET
}
${
POCO_LIB_NET_DEBUG
}
)
add_poco_lib
(
Crypto
${
POCO_LIB_CRYPTO
}
${
POCO_LIB_CRYPTO_DEBUG
}
)
add_poco_lib
(
NetSSL
${
POCO_LIB_NETSSL
}
${
POCO_LIB_NETSSL_DEBUG
}
)
# Set a version string by examining either the Poco/Version.h header or
# the Poco/Foundation.h header if Version.h does not exist
...
...
buildconfig/CMake/FindTBB.cmake
View file @
c12936d2
...
...
@@ -9,6 +9,7 @@
# TBB_INCLUDE_DIRS - the TBB include directories
# TBB_LIBRARIES - TBB libraries to be lined, doesn't include malloc or
# malloc proxy
# TBB::tbb - imported target for the TBB library
#
# TBB_VERSION_MAJOR - Major Product Version Number
# TBB_VERSION_MINOR - Minor Product Version Number
...
...
@@ -20,10 +21,12 @@
# TBB_MALLOC_FOUND - system has TBB malloc library
# TBB_MALLOC_INCLUDE_DIRS - the TBB malloc include directories
# TBB_MALLOC_LIBRARIES - The TBB malloc libraries to be lined
# TBB::malloc - imported target for the TBB malloc library
#
# TBB_MALLOC_PROXY_FOUND - system has TBB malloc proxy library
# TBB_MALLOC_PROXY_INCLUDE_DIRS = the TBB malloc proxy include directories
# TBB_MALLOC_PROXY_LIBRARIES - The TBB malloc proxy libraries to be lined
# TBB::malloc_proxy - imported target for the TBB malloc proxy library
#
#
# This module reads hints about search locations from variables:
...
...
@@ -65,38 +68,120 @@
# FindTBB helper functions and macros
#
# Use TBBConfig.cmake if possible.
set
(
_tbb_find_quiet
)
if
(
TBB_FIND_QUIETLY
)
set
(
_tbb_find_quiet QUIET
)
endif
()
set
(
_tbb_find_components
)
set
(
_tbb_find_optional_components
)
foreach
(
_tbb_find_component IN LISTS TBB_FIND_COMPONENTS
)
if
(
TBB_FIND_REQUIRED_
${
_tbb_find_component
}
)
list
(
APPEND _tbb_find_components
"
${
_tbb_find_component
}
"
)
else
()
list
(
APPEND _tbb_find_optional_components
"
${
_tbb_find_component
}
"
)
endif
()
endforeach
()
unset
(
_tbb_find_component
)
find_package
(
TBB CONFIG
${
_tbb_find_quiet
}
COMPONENTS
${
_tbb_find_components
}
OPTIONAL_COMPONENTS
${
_tbb_find_optional_components
}
)
unset
(
_tbb_find_quiet
)
unset
(
_tbb_find_components
)
unset
(
_tbb_find_optional_components
)
if
(
TBB_FOUND
)
return
()
endif
()
#====================================================
# Fix the library path in case it is a linker script
#====================================================
function
(
tbb_extract_real_library library real_library
)
if
(
NOT UNIX OR NOT EXISTS
${
library
}
)
set
(
${
real_library
}
"
${
library
}
"
PARENT_SCOPE
)
return
()
endif
()
#Read in the first 4 bytes and see if they are the ELF magic number
set
(
_elf_magic
"7f454c46"
)
file
(
READ
${
library
}
_hex_data OFFSET 0 LIMIT 4 HEX
)
if
(
_hex_data STREQUAL _elf_magic
)
#we have opened a elf binary so this is what
#we should link to
set
(
${
real_library
}
"
${
library
}
"
PARENT_SCOPE
)
return
()
endif
()
file
(
READ
${
library
}
_data OFFSET 0 LIMIT 1024
)
if
(
"
${
_data
}
"
MATCHES
"INPUT
\\
(([^(]+)
\\
)"
)
#extract out the .so name from REGEX MATCH command
set
(
_proper_so_name
"
${
CMAKE_MATCH_1
}
"
)
#construct path to the real .so which is presumed to be in the same directory
#as the input file
get_filename_component
(
_so_dir
"
${
library
}
"
DIRECTORY
)
set
(
${
real_library
}
"
${
_so_dir
}
/
${
_proper_so_name
}
"
PARENT_SCOPE
)
else
()
#unable to determine what this library is so just hope everything works
#and pass it unmodified.
set
(
${
real_library
}
"
${
library
}
"
PARENT_SCOPE
)
endif
()
endfunction
()
#===============================================
# Do the final processing for the package find.
#===============================================
macro
(
findpkg_finish PREFIX
)