-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[CMake] Move towards target-based CMake and partly fix picking up headers from an installed ROOT #8709
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
hageboeck
wants to merge
25
commits into
root-project:master
Choose a base branch
from
hageboeck:target-basedCMake
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[CMake] Move towards target-based CMake and partly fix picking up headers from an installed ROOT #8709
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
9c6485a
Make CppInterOp work with new gtest target names.
hageboeck 1e8e6ba
[sofie] Add missing link to Core.
hageboeck 1156518
[imt] Fix missing include directories for TBB
hageboeck 938f13f
[Tree] Remove res/ header from tests.
hageboeck 02dc777
[RDF] Remove an unused include from the datasetspec test.
hageboeck dd0f33b
Add missing includes of gtest.h
hageboeck 92095ef
Remove gtest include from TestSupport.hxx.
hageboeck c628b2f
[cling] Add parsing of -isystem arguments to rootcling.
hageboeck 377987d
[CMake] Make VDT an IMPORTED target; convert to target-based cmake.
hageboeck 3158318
[CMake] Make XRootD config target-based.
hageboeck 9641c3f
[CMake] Require OpenSSL when XRootD is a builtin.
hageboeck 8ebed97
[CMake] Save location of the builtin openssl.
hageboeck 4ae0deb
[CMake] Make nlohmann_json config target-based.
hageboeck 1422dac
[CMake] Make lzma config target-based.
hageboeck e36077c
[CMake] Remove manual lists of include directories.
hageboeck 0c17e88
[CMake] Consolidate dependency management for ROOT_LINKER_LIBRARY.
hageboeck b3aed70
[CMake] Use modern target_link_library syntax for exectuables.
hageboeck dce6f64
[CMake] Improve ROOT_GENERATE_DICTIONARY
hageboeck fb0097f
[CMake] Fix unit test config for core/thread.
hageboeck b674226
[CMake][NFC] Clarify arguments of ROOT_STANDARD_LIBRARY_PACKAGE.
hageboeck 556b623
[CMake][NFC] Remove an unused argument for ROOT_ADD_TEST.
hageboeck bd78653
[CMake] Move to CMake's native FindGTest
hageboeck 054aff5
[core] Add missing gmock dependencies.
hageboeck 3583493
[CMake] Use CMAKE_CXX_COMPILER_LAUNCHER for ccache.
hageboeck e9ae5bb
[CMake] Move setting of OSX_SYSROOT before project().
hageboeck File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,21 +7,10 @@ | |
include(ExternalProject) | ||
|
||
set(XROOTD_VERSION "5.8.0") | ||
set(XROOTD_PREFIX ${CMAKE_BINARY_DIR}/XROOTD-prefix) | ||
|
||
set(XROOTD_PREFIX ${CMAKE_BINARY_DIR}) | ||
message(STATUS "Downloading and building XROOTD version ${XROOTD_VERSION}") | ||
|
||
list(REMOVE_ITEM XROOTD_CLIENT_LIBRARIES OpenSSL::SSL) | ||
list(REMOVE_ITEM XROOTD_UTILS_LIBRARIES OpenSSL::SSL) | ||
|
||
set(libname ${CMAKE_SHARED_LIBRARY_PREFIX}XrdCl${CMAKE_SHARED_LIBRARY_SUFFIX}) | ||
list(APPEND XROOTD_CLIENT_LIBRARIES ${XROOTD_PREFIX}/lib/${libname}) | ||
list(REMOVE_DUPLICATES XROOTD_CLIENT_LIBRARIES) | ||
|
||
set(libname ${CMAKE_SHARED_LIBRARY_PREFIX}XrdUtils${CMAKE_SHARED_LIBRARY_SUFFIX}) | ||
list(APPEND XROOTD_UTILS_LIBRARIES ${XROOTD_PREFIX}/lib/${libname}) | ||
list(REMOVE_DUPLICATES XROOTD_UTILS_LIBRARIES) | ||
|
||
ExternalProject_Add( | ||
BUILTIN_XROOTD | ||
URL http://lcgpackages.web.cern.ch/lcgpackages/tarFiles/sources/xrootd-${XROOTD_VERSION}.tar.gz | ||
|
@@ -41,10 +30,11 @@ ExternalProject_Add( | |
-DENABLE_CEPH=OFF | ||
-DXRDCL_LIB_ONLY=ON | ||
-DCMAKE_INSTALL_RPATH:STRING=${XROOTD_PREFIX}/lib | ||
-DOPENSSL_ROOT_DIR=${OPENSSL_ROOT_DIR} | ||
-DOpenSSL_ROOT=${OPENSSL_ROOT} #For CMake <3.27 | ||
-DOPENSSL_ROOT=${OPENSSL_ROOT} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can probably keep only There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's try |
||
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install | ||
LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1 LOG_OUTPUT_ON_FAILURE 1 | ||
BUILD_BYPRODUCTS ${XROOTD_CLIENT_LIBRARIES} ${XROOTD_UTILS_LIBRARIES} | ||
BUILD_BYPRODUCTS XrdUtils XrdCl | ||
hageboeck marked this conversation as resolved.
Show resolved
Hide resolved
|
||
TIMEOUT 600 | ||
) | ||
|
||
|
@@ -55,22 +45,19 @@ if(builtin_openssl) | |
add_dependencies(BUILTIN_XROOTD OPENSSL) | ||
endif() | ||
|
||
list(APPEND XROOTD_CLIENT_LIBRARIES OpenSSL::SSL) | ||
list(REMOVE_DUPLICATES XROOTD_CLIENT_LIBRARIES) | ||
list(APPEND XROOTD_UTILS_LIBRARIES OpenSSL::SSL) | ||
list(REMOVE_DUPLICATES XROOTD_UTILS_LIBRARIES) | ||
|
||
set(XROOTD_INCLUDE_DIRS ${XROOTD_PREFIX}/include/xrootd CACHE INTERNAL "" FORCE) | ||
set(XROOTD_CLIENT_LIBRARIES ${XROOTD_CLIENT_LIBRARIES} CACHE INTERNAL "" FORCE) | ||
set(XROOTD_UTILS_LIBRARIES ${XROOTD_UTILS_LIBRARIES} CACHE INTERNAL "" FORCE) | ||
set(XRDCL_NAME ${CMAKE_SHARED_LIBRARY_PREFIX}XrdCl${CMAKE_SHARED_LIBRARY_SUFFIX}) | ||
set(XRDUTILS_NAME ${CMAKE_SHARED_LIBRARY_PREFIX}XrdUtils${CMAKE_SHARED_LIBRARY_SUFFIX}) | ||
set(XROOTD_CLIENT_LIBRARIES ${XROOTD_PREFIX}/lib/${XRDCL_NAME} CACHE INTERNAL "" FORCE) | ||
set(XROOTD_UTILS_LIBRARIES ${XROOTD_PREFIX}/lib/${XRDUTILS_NAME} CACHE INTERNAL "" FORCE) | ||
set(XROOTD_LIBRARIES ${XROOTD_PREFIX}/lib/${XRDCL_NAME} CACHE INTERNAL "" FORCE) | ||
|
||
list(APPEND CMAKE_BUILD_RPATH ${XROOTD_PREFIX}/lib) | ||
add_dependencies(XRootD BUILTIN_XROOTD) | ||
install(DIRECTORY ${XROOTD_PREFIX}/lib/ DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries FILES_MATCHING PATTERN "libXrd*") | ||
install(DIRECTORY ${XROOTD_PREFIX}/include/xrootd/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/xrootd COMPONENT headers) | ||
set(CMAKE_BUILD_RPATH ${CMAKE_BUILD_RPATH} ${XROOTD_PREFIX}/lib PARENT_SCOPE) | ||
|
||
set_property(GLOBAL APPEND PROPERTY ROOT_BUILTIN_TARGETS BUILTIN_XROOTD) | ||
|
||
install(DIRECTORY ${XROOTD_PREFIX}/lib/ DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries FILES_MATCHING PATTERN "libXrd*") | ||
install(DIRECTORY ${XROOTD_PREFIX}/include/xrootd/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/xrootd COMPONENT headers) | ||
if(APPLE) | ||
# XRootD libraries on mac need the LC_RPATH variable set. The build process already takes care of setting | ||
# * BUILD_RPATH = build/XROOTD-prefix/../src | ||
|
@@ -81,3 +68,4 @@ if(APPLE) | |
CODE "xrootd_libs_change_rpath(${XROOTD_PREFIX}/lib ${CMAKE_INSTALL_FULL_LIBDIR})" | ||
) | ||
endif() | ||
|
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.