-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[cmake] move ExternalProject_Add to subdir for consistency, and define proper GSL,FFTW,TBB targets #21904
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
ferdymercury
wants to merge
8
commits into
root-project:master
Choose a base branch
from
ferdymercury:builtinsub
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 ExternalProject_Add to subdir for consistency, and define proper GSL,FFTW,TBB targets #21904
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
6b708a5
[ci] enable builtins in alma10-clangninja as dpiparo suggested
ferdymercury d47230f
[cmake] move ExternalProject_Add to subdir for consistency
ferdymercury be12e35
[gsl] define proper CMake target
ferdymercury 78a55ce
[fftw3] use proper CMake target
ferdymercury a28b8f1
[tbb] use proper CMake target
ferdymercury 2653dad
[vdt] export canonical vars to parent scope
ferdymercury 78db3b5
[cmake] encapsulate builtin dependencies behind CMake target
ferdymercury c6499ae
[fftw] add script license file as header
ferdymercury 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| set(ROOT_FFTW_VERSION 3.3.10) | ||
| message(STATUS "Downloading and building FFTW version ${ROOT_FFTW_VERSION}") | ||
| set(ROOT_FFTW_PREFIX ${CMAKE_BINARY_DIR}/builtins/FFTW3-prefix) | ||
| set(ROOT_FFTW_LIBRARY ${ROOT_FFTW_PREFIX}/lib/libfftw3.a) | ||
| ExternalProject_Add( | ||
| BUILTIN_FFTW3 | ||
| PREFIX ${ROOT_FFTW_PREFIX} | ||
| URL ${lcgpackages}/fftw-${ROOT_FFTW_VERSION}.tar.gz | ||
| URL_HASH SHA256=56c932549852cddcfafdab3820b0200c7742675be92179e59e6215b340e26467 | ||
| CONFIGURE_COMMAND ./configure --prefix=<INSTALL_DIR> | ||
| BUILD_COMMAND make CFLAGS=-fPIC | ||
| LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1 LOG_OUTPUT_ON_FAILURE 1 | ||
| BUILD_IN_SOURCE 1 | ||
| BUILD_BYPRODUCTS ${ROOT_FFTW_LIBRARY} | ||
| TIMEOUT 600 | ||
| ) | ||
|
|
||
| set(ROOT_FFTW_INCLUDE_DIR ${ROOT_FFTW_PREFIX}/include) | ||
|
|
||
| file(MAKE_DIRECTORY ${ROOT_FFTW_INCLUDE_DIR}) | ||
| add_library(FFTW::Double IMPORTED STATIC GLOBAL) | ||
| add_dependencies(FFTW::Double BUILTIN_FFTW3) | ||
| set_target_properties(FFTW::Double PROPERTIES | ||
| IMPORTED_LOCATION ${ROOT_FFTW_LIBRARY} | ||
| INTERFACE_INCLUDE_DIRECTORIES ${ROOT_FFTW_INCLUDE_DIR}) | ||
|
|
||
| set(FFTW_INCLUDE_DIRS ${ROOT_FFTW_INCLUDE_DIR} PARENT_SCOPE) | ||
| set(FFTW_FOUND ON PARENT_SCOPE) | ||
| set(FFTW_VERSION ${ROOT_FFTW_VERSION} PARENT_SCOPE) | ||
| set(FFTW_LIBRARIES ${ROOT_FFTW_LIBRARY} PARENT_SCOPE) |
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 |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| set(ROOT_GSL_VERSION 2.8) | ||
| message(STATUS "Downloading and building GSL version ${ROOT_GSL_VERSION}") | ||
| set(ROOT_GSL_PREFIX ${CMAKE_BINARY_DIR}/builtins/GSL-prefix) | ||
| set(ROOT_GSL_LIBRARY ${ROOT_GSL_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}gsl${CMAKE_STATIC_LIBRARY_SUFFIX}) | ||
| set(ROOT_GSL_CBLAS_LIBRARY ${ROOT_GSL_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}gslcblas${CMAKE_STATIC_LIBRARY_SUFFIX}) | ||
| set(ROOT_GSL_LIBRARIES ${ROOT_GSL_LIBRARY} ${ROOT_GSL_CBLAS_LIBRARY}) | ||
| if(CMAKE_OSX_SYSROOT) | ||
| set(_gsl_cppflags "-isysroot ${CMAKE_OSX_SYSROOT}") | ||
| set(_gsl_ldflags "-isysroot ${CMAKE_OSX_SYSROOT}") | ||
| endif() | ||
| ExternalProject_Add( | ||
| BUILTIN_GSL | ||
| PREFIX ${ROOT_GSL_PREFIX} | ||
| # http://mirror.switch.ch/ftp/mirror/gnu/gsl/gsl-${ROOT_GSL_VERSION}.tar.gz | ||
| URL ${lcgpackages}/gsl-${ROOT_GSL_VERSION}.tar.gz | ||
| URL_HASH SHA256=6a99eeed15632c6354895b1dd542ed5a855c0f15d9ad1326c6fe2b2c9e423190 | ||
| SOURCE_DIR GSL-src # prevent "<gsl/...>" vs GSL/ macOS warning | ||
| INSTALL_DIR ${ROOT_GSL_PREFIX} | ||
| CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix <INSTALL_DIR> | ||
| --libdir=<INSTALL_DIR>/lib | ||
| --enable-shared=no --with-pic | ||
| CC=${CMAKE_C_COMPILER} | ||
| CFLAGS=${CMAKE_C_FLAGS} | ||
| CPPFLAGS=${_gsl_cppflags} | ||
| LDFLAGS=${_gsl_ldflags} | ||
| LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1 LOG_OUTPUT_ON_FAILURE 1 | ||
| BUILD_BYPRODUCTS ${ROOT_GSL_LIBRARIES} | ||
| TIMEOUT 600 | ||
| ) | ||
|
|
||
| # FIXME: one need to find better way to extract path with GSL include files | ||
| set(ROOT_GSL_INCLUDE_DIR ${ROOT_GSL_PREFIX}/src/BUILTIN_GSL-build) | ||
|
|
||
| file(MAKE_DIRECTORY ${ROOT_GSL_INCLUDE_DIR}) | ||
| add_library(GSL::gsl IMPORTED STATIC GLOBAL) | ||
| add_dependencies(GSL::gsl BUILTIN_GSL) | ||
| set_target_properties(GSL::gsl PROPERTIES | ||
| IMPORTED_LOCATION ${ROOT_GSL_LIBRARY} | ||
| INTERFACE_INCLUDE_DIRECTORIES ${ROOT_GSL_INCLUDE_DIR}) | ||
| add_library(GSL::gslcblas IMPORTED STATIC GLOBAL) | ||
| add_dependencies(GSL::gslcblas BUILTIN_GSL) | ||
| set_target_properties(GSL::gslcblas PROPERTIES | ||
| IMPORTED_LOCATION ${ROOT_GSL_CBLAS_LIBRARY} | ||
| INTERFACE_INCLUDE_DIRECTORIES ${ROOT_GSL_INCLUDE_DIR}) | ||
|
|
||
| set(GSL_INCLUDE_DIRS ${ROOT_GSL_INCLUDE_DIR}) | ||
| set(GSL_FOUND ON PARENT_SCOPE) | ||
| set(GSL_VERSION ${ROOT_GSL_VERSION} PARENT_SCOPE) | ||
| set(GSL_LIBRARIES ${ROOT_GSL_LIBRARIES} PARENT_SCOPE) |
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 | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,111 @@ | ||||||||
| # Add googletest | ||||||||
| # http://stackoverflow.com/questions/9689183/cmake-googletest | ||||||||
|
|
||||||||
| set(_gtest_byproduct_binary_dir | ||||||||
| ${CMAKE_CURRENT_BINARY_DIR}/googletest-prefix/src/googletest-build) | ||||||||
| set(_gtest_byproducts | ||||||||
| ${_gtest_byproduct_binary_dir}/lib/libgtest.a | ||||||||
| ${_gtest_byproduct_binary_dir}/lib/libgtest_main.a | ||||||||
| ${_gtest_byproduct_binary_dir}/lib/libgmock.a | ||||||||
| ${_gtest_byproduct_binary_dir}/lib/libgmock_main.a | ||||||||
| ) | ||||||||
|
|
||||||||
| set(GTEST_CXX_FLAGS "${ROOT_EXTERNAL_CXX_FLAGS}") | ||||||||
| if(MSVC) | ||||||||
| if(winrtdebug) | ||||||||
| set(GTEST_BUILD_TYPE Debug) | ||||||||
| else() | ||||||||
| set(GTEST_BUILD_TYPE Release) | ||||||||
| endif() | ||||||||
| set(_gtest_byproducts | ||||||||
| ${_gtest_byproduct_binary_dir}/lib/gtest.lib | ||||||||
| ${_gtest_byproduct_binary_dir}/lib/gtest_main.lib | ||||||||
| ${_gtest_byproduct_binary_dir}/lib/gmock.lib | ||||||||
| ${_gtest_byproduct_binary_dir}/lib/gmock_main.lib | ||||||||
| ) | ||||||||
| if(CMAKE_GENERATOR MATCHES Ninja) | ||||||||
| set(GTEST_BUILD_COMMAND "BUILD_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR>") | ||||||||
| else() | ||||||||
| set(GTEST_BUILD_COMMAND "BUILD_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> --config ${GTEST_BUILD_TYPE}") | ||||||||
| endif() | ||||||||
| if(asan) | ||||||||
| if(NOT winrtdebug) | ||||||||
| set(gtestbuild "RelWithDebInfo") | ||||||||
| endif() | ||||||||
| set(GTEST_CXX_FLAGS "${ROOT_EXTERNAL_CXX_FLAGS} ${ASAN_EXTRA_CXX_FLAGS}") | ||||||||
| endif() | ||||||||
| set(EXTRA_GTEST_OPTS | ||||||||
| -DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG} | ||||||||
| -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG:PATH=${_gtest_byproduct_binary_dir}/lib/ | ||||||||
| -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_MINSIZEREL:PATH=${_gtest_byproduct_binary_dir}/lib/ | ||||||||
| -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE:PATH=${_gtest_byproduct_binary_dir}/lib/ | ||||||||
| -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELWITHDEBINFO:PATH=${_gtest_byproduct_binary_dir}/lib/ | ||||||||
| -Dgtest_force_shared_crt=ON | ||||||||
| ${GTEST_BUILD_COMMAND}) | ||||||||
| else() | ||||||||
| set(GTEST_BUILD_TYPE Release) | ||||||||
| endif() | ||||||||
| if(APPLE) | ||||||||
| set(EXTRA_GTEST_OPTS | ||||||||
| -DCMAKE_OSX_SYSROOT=${CMAKE_OSX_SYSROOT}) | ||||||||
| endif() | ||||||||
|
|
||||||||
| ExternalProject_Add( | ||||||||
| googletest | ||||||||
| GIT_REPOSITORY https://github.com/google/googletest.git | ||||||||
| GIT_SHALLOW 1 | ||||||||
| GIT_TAG v1.17.0 | ||||||||
| UPDATE_COMMAND "" | ||||||||
| # # Force separate output paths for debug and release builds to allow easy | ||||||||
| # # identification of correct lib in subsequent TARGET_LINK_LIBRARIES commands | ||||||||
| # CMAKE_ARGS -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG:PATH=DebugLibs | ||||||||
| # -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE:PATH=ReleaseLibs | ||||||||
| # -Dgtest_force_shared_crt=ON | ||||||||
| CMAKE_ARGS -G ${CMAKE_GENERATOR} | ||||||||
| -DCMAKE_BUILD_TYPE=${GTEST_BUILD_TYPE} | ||||||||
| -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} | ||||||||
| -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} | ||||||||
| -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} | ||||||||
| -DCMAKE_CXX_FLAGS=${GTEST_CXX_FLAGS} | ||||||||
| -DCMAKE_AR=${CMAKE_AR} | ||||||||
| -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} | ||||||||
| ${EXTRA_GTEST_OPTS} | ||||||||
| # Disable install step | ||||||||
| INSTALL_COMMAND "" | ||||||||
| BUILD_BYPRODUCTS ${_gtest_byproducts} | ||||||||
| # Wrap download, configure and build steps in a script to log output | ||||||||
| LOG_DOWNLOAD ON LOG_CONFIGURE ON LOG_BUILD ON LOG_OUTPUT_ON_FAILURE ON | ||||||||
| TIMEOUT 600 | ||||||||
| ) | ||||||||
|
|
||||||||
| # Specify include dirs for gtest and gmock | ||||||||
| ExternalProject_Get_Property(googletest source_dir) | ||||||||
| set(GTEST_INCLUDE_DIR ${source_dir}/googletest/include) | ||||||||
| set(GMOCK_INCLUDE_DIR ${source_dir}/googlemock/include) | ||||||||
| # Create the directories. Prevents bug https://gitlab.kitware.com/cmake/cmake/issues/15052 | ||||||||
| file(MAKE_DIRECTORY ${GTEST_INCLUDE_DIR} ${GMOCK_INCLUDE_DIR}) | ||||||||
|
|
||||||||
| # Libraries | ||||||||
| ExternalProject_Get_Property(googletest binary_dir) | ||||||||
| set(_G_LIBRARY_PATH ${binary_dir}/lib/) | ||||||||
|
|
||||||||
| # Use gmock_main instead of gtest_main because it initializes gtest as well. | ||||||||
| # Note: The libraries are listed in reverse order of their dependencies. | ||||||||
| foreach(lib gtest gtest_main gmock gmock_main) | ||||||||
| add_library(${lib} IMPORTED STATIC GLOBAL) | ||||||||
| set_target_properties(${lib} PROPERTIES | ||||||||
| IMPORTED_LOCATION "${_G_LIBRARY_PATH}${CMAKE_STATIC_LIBRARY_PREFIX}${lib}${CMAKE_STATIC_LIBRARY_SUFFIX}" | ||||||||
| ) | ||||||||
| add_dependencies(${lib} googletest) | ||||||||
|
Member
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 add the "canonical" names that are now used in ROOT:
Suggested change
|
||||||||
| if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND | ||||||||
| ${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER_EQUAL 9) | ||||||||
| target_compile_options(${lib} INTERFACE -Wno-deprecated-copy) | ||||||||
| endif() | ||||||||
| endforeach() | ||||||||
| target_include_directories(gtest INTERFACE ${GTEST_INCLUDE_DIR}) | ||||||||
| target_include_directories(gmock INTERFACE ${GMOCK_INCLUDE_DIR}) | ||||||||
|
|
||||||||
| set_property(TARGET gtest PROPERTY IMPORTED_LOCATION ${_G_LIBRARY_PATH}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}) | ||||||||
| set_property(TARGET gtest_main PROPERTY IMPORTED_LOCATION ${_G_LIBRARY_PATH}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}) | ||||||||
| set_property(TARGET gmock PROPERTY IMPORTED_LOCATION ${_G_LIBRARY_PATH}/${CMAKE_STATIC_LIBRARY_PREFIX}gmock${CMAKE_STATIC_LIBRARY_SUFFIX}) | ||||||||
| set_property(TARGET gmock_main PROPERTY IMPORTED_LOCATION ${_G_LIBRARY_PATH}/${CMAKE_STATIC_LIBRARY_PREFIX}gmock_main${CMAKE_STATIC_LIBRARY_SUFFIX}) | ||||||||
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 |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| ExternalProject_Add( | ||
| MATHJAX | ||
| URL ${CMAKE_SOURCE_DIR}/documentation/doxygen/mathjax.tar.gz # TODO move to LCGpackages | ||
| URL_HASH SHA256=c5e22e60430a65963a87ab4dcc8856b9be5bd434d3b3871f27ee65b584c3c3ea | ||
| CONFIGURE_COMMAND "" | ||
| BUILD_COMMAND "" | ||
| INSTALL_COMMAND "" | ||
| SOURCE_DIR ${CMAKE_BINARY_DIR}/js/mathjax/ | ||
| TIMEOUT 600 | ||
| ) |
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 |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| if(builtin_openui5) | ||
| ExternalProject_Add( | ||
| OPENUI5 | ||
| URL ${CMAKE_SOURCE_DIR}/builtins/openui5/openui5.tar.gz | ||
| URL_HASH SHA256=b9e6495d8640302d9cf2fe3c99331311335aaab0f48794565ebd69ecc7449e58 | ||
| CONFIGURE_COMMAND "" | ||
| BUILD_COMMAND "" | ||
| INSTALL_COMMAND "" | ||
| SOURCE_DIR ${CMAKE_BINARY_DIR}/ui5/distribution | ||
| TIMEOUT 600 | ||
| ) | ||
| else() | ||
| ExternalProject_Add( | ||
| OPENUI5 | ||
| URL https://github.com/SAP/openui5/releases/download/1.135.0/openui5-runtime-1.135.0.zip | ||
| URL_HASH SHA256=13acdb88a7f3f1d4afef6d1d500b53bccc4b593e7acf442721bb4e3da4e2690b | ||
| CONFIGURE_COMMAND "" | ||
| BUILD_COMMAND "" | ||
| INSTALL_COMMAND "" | ||
| SOURCE_DIR ${CMAKE_BINARY_DIR}/ui5/distribution | ||
| TIMEOUT 600 | ||
| ) | ||
| endif() | ||
| install(DIRECTORY ${CMAKE_BINARY_DIR}/ui5/distribution/ DESTINATION ${CMAKE_INSTALL_OPENUI5DIR}/distribution/ COMPONENT libraries FILES_MATCHING PATTERN "*") |
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 |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| ExternalProject_Add( | ||
| RENDERCORE | ||
| URL ${CMAKE_SOURCE_DIR}/builtins/rendercore/RenderCore-1.9.tar.gz # TODO move to LCG | ||
| URL_HASH SHA256=7728f00ee5e907c36b25aad56fbc73881c7c9faf47a36bee5efd2054bc4ecc6c | ||
| CONFIGURE_COMMAND "" | ||
| BUILD_COMMAND "" | ||
| INSTALL_COMMAND "" | ||
| SOURCE_DIR ${CMAKE_BINARY_DIR}/ui5/eve7/rcore | ||
| TIMEOUT 600 | ||
| ) | ||
| install(DIRECTORY ${CMAKE_BINARY_DIR}/ui5/eve7/rcore/ DESTINATION ${CMAKE_INSTALL_OPENUI5DIR}/eve7/rcore/ COMPONENT libraries FILES_MATCHING PATTERN "*") |
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 |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| set(ROOT_TBB_URL ${lcgpackages}/oneTBB-2021.9.0.tar.gz) | ||
| set(ROOT_TBB_HASH 1ce48f34dada7837f510735ff1172f6e2c261b09460e3bf773b49791d247d24e) | ||
|
|
||
| if(MSVC) | ||
| if(CMAKE_GENERATOR MATCHES Ninja) | ||
| if(CMAKE_BUILD_TYPE MATCHES Debug) | ||
| set(tbbsuffix "_debug") | ||
| endif() | ||
| else() | ||
| set(tbb_build Release) | ||
| if(winrtdebug) | ||
| set(tbb_build Debug) | ||
| set(tbbsuffix "_debug") | ||
| endif() | ||
| endif() | ||
| set(ROOT_TBB_LIBRARY ${CMAKE_BINARY_DIR}/lib/tbb12${tbbsuffix}.lib) | ||
| install(DIRECTORY ${CMAKE_BINARY_DIR}/bin/ DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT libraries FILES_MATCHING PATTERN "tbb*.dll") | ||
| install(DIRECTORY ${CMAKE_BINARY_DIR}/lib/ DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries FILES_MATCHING PATTERN "tbb*.lib") | ||
| else() | ||
| if (CMAKE_BUILD_TYPE STREQUAL "Debug") | ||
| set(tbbsuffix "_debug") | ||
| endif() | ||
| set(ROOT_TBB_LIBRARY ${CMAKE_BINARY_DIR}/lib/libtbb${tbbsuffix}${CMAKE_SHARED_LIBRARY_SUFFIX}) | ||
| install(DIRECTORY ${CMAKE_BINARY_DIR}/lib/ DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries FILES_MATCHING PATTERN "libtbb*") | ||
| endif() | ||
| if(tbb_build) | ||
| set(TBB_EXTRA_BUILD_ARGS --config ${tbb_build}) | ||
| endif() | ||
|
|
||
| ExternalProject_Add( | ||
| BUILTIN_TBB | ||
| URL ${ROOT_TBB_URL} | ||
| URL_HASH SHA256=${ROOT_TBB_HASH} | ||
| INSTALL_DIR ${CMAKE_BINARY_DIR} | ||
| CMAKE_ARGS -G ${CMAKE_GENERATOR} | ||
| -DCMAKE_POLICY_VERSION_MINIMUM=3.5 | ||
| -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} | ||
| -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} | ||
| -DCMAKE_CXX_FLAGS=${ROOT_EXTERNAL_CXX_FLAGS} | ||
| -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} | ||
| -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} | ||
| -DCMAKE_INSTALL_INCLUDEDIR=${CMAKE_BINARY_DIR}/include | ||
| -DCMAKE_INSTALL_BINDIR=${CMAKE_BINARY_DIR}/bin | ||
| -DCMAKE_INSTALL_LIBDIR=${CMAKE_BINARY_DIR}/lib | ||
|
ferdymercury marked this conversation as resolved.
|
||
| -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR} | ||
| -DTBBMALLOC_BUILD=OFF | ||
| -DTBBMALLOC_PROXY_BUILD=OFF | ||
| -DTBB_ENABLE_IPO=OFF | ||
| -DTBB_STRICT=OFF | ||
| -DTBB_TEST=OFF | ||
| BUILD_COMMAND ${CMAKE_COMMAND} --build . ${TBB_EXTRA_BUILD_ARGS} | ||
| INSTALL_COMMAND ${CMAKE_COMMAND} --install . ${TBB_EXTRA_BUILD_ARGS} | ||
| LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1 LOG_OUTPUT_ON_FAILURE 1 | ||
| BUILD_BYPRODUCTS ${ROOT_TBB_LIBRARY} | ||
| TIMEOUT 600 | ||
| ) | ||
|
|
||
| set(ROOT_TBB_INCLUDE_DIR ${CMAKE_BINARY_DIR}/ginclude) | ||
|
|
||
| ExternalProject_Add_Step( | ||
| BUILTIN_TBB tbb2externals | ||
| COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/include/tbb ${ROOT_TBB_INCLUDE_DIR}/tbb | ||
| COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/include/oneapi ${ROOT_TBB_INCLUDE_DIR}/oneapi | ||
| DEPENDEES install | ||
| ) | ||
|
|
||
| file(MAKE_DIRECTORY ${ROOT_TBB_INCLUDE_DIR}) | ||
| add_library(TBB::tbb IMPORTED STATIC GLOBAL) | ||
| add_dependencies(TBB::tbb BUILTIN_TBB) | ||
| set_target_properties(TBB::tbb PROPERTIES | ||
| IMPORTED_LOCATION ${ROOT_TBB_LIBRARY} | ||
| INTERFACE_INCLUDE_DIRECTORIES ${ROOT_TBB_INCLUDE_DIR}) | ||
| target_compile_definitions(TBB::tbb INTERFACE TBB_SUPPRESS_DEPRECATED_MESSAGES=1) | ||
| if(MSVC) | ||
| target_compile_definitions(TBB::tbb INTERFACE __TBB_NO_IMPLICIT_LINKAGE=1) | ||
| endif() | ||
|
|
||
| set(TBB_FOUND ON PARENT_SCOPE) | ||
| set(TBB_VERSION ${ROOT_TBB_VERSION} PARENT_SCOPE) | ||
| set(TBB_INCLUDE_DIRS ${ROOT_TBB_INCLUDE_DIR} PARENT_SCOPE) | ||
| set(TBB_LIBRARIES ${ROOT_TBB_LIBRARY} PARENT_SCOPE) | ||
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 |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| set(vdt_version 0.4.6) | ||
| set(VDT_FOUND True) | ||
| set(VDT_LIBRARIES "${CMAKE_BINARY_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}vdt${CMAKE_SHARED_LIBRARY_SUFFIX}") | ||
| ExternalProject_Add( | ||
| BUILTIN_VDT | ||
| URL ${lcgpackages}/vdt-${vdt_version}.tar.gz | ||
| URL_HASH SHA256=1820feae446780763ec8bbb60a0dbcf3ae1ee548bdd01415b1fb905fd4f90c54 | ||
| INSTALL_DIR ${CMAKE_BINARY_DIR} | ||
| CMAKE_ARGS | ||
| -DCMAKE_POLICY_VERSION_MINIMUM=3.5 | ||
| -DSSE=OFF # breaks on ARM without this | ||
| -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} | ||
| -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} | ||
| -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} | ||
| -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} | ||
| -DCMAKE_CXX_FLAGS=${ROOT_EXTERNAL_CXX_FLAGS} | ||
| -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR> | ||
| LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1 LOG_OUTPUT_ON_FAILURE 1 | ||
| BUILD_BYPRODUCTS ${VDT_LIBRARIES} | ||
| TIMEOUT 600 | ||
| ) | ||
| ExternalProject_Add_Step( | ||
| BUILTIN_VDT copy2externals | ||
| COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/include/vdt ${CMAKE_BINARY_DIR}/ginclude/vdt | ||
| DEPENDEES install | ||
| ) | ||
| set(VDT_INCLUDE_DIR ${CMAKE_BINARY_DIR}/ginclude) | ||
| set(VDT_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/ginclude) | ||
|
|
||
| add_library(VDT::VDT SHARED IMPORTED GLOBAL) | ||
| add_dependencies(VDT::VDT BUILTIN_VDT) | ||
| set_target_properties(VDT::VDT PROPERTIES IMPORTED_LOCATION ${VDT_LIBRARIES}) | ||
| target_include_directories(VDT::VDT INTERFACE $<BUILD_INTERFACE:${VDT_INCLUDE_DIR}> $<INSTALL_INTERFACE:include/>) | ||
|
|
||
| install(FILES ${VDT_LIBRARIES} | ||
| DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries) | ||
| install(DIRECTORY ${CMAKE_BINARY_DIR}/include/vdt | ||
| DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT extra-headers) | ||
| set_property(GLOBAL APPEND PROPERTY ROOT_BUILTIN_TARGETS VDT::VDT) | ||
|
|
||
| set(VDT_VERSION ${ROOT_GSL_VERSION} PARENT_SCOPE) | ||
| set(VDT_FOUND ${vdt_version} PARENT_SCOPE) | ||
| set(VDT_LIBRARIES ${VDT_LIBRARIES} PARENT_SCOPE) | ||
| set(VDT_INCLUDE_DIRS ${VDT_INCLUDE_DIRS} PARENT_SCOPE) |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I'm not mistaken, this would try to install gtest in something like
/usr/local. Instead of disabling the install command, once could make this:${CMAKE_BINARY_DIR}/builtins/gtestEdit: I see that you only moved that code over. I think we can leave it for a later time to simplify this file a bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, just moved. Shall I apply all / none / or a part of the commits you suggested on this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is also VDT building in binary-dir rather than in builtins/ as the others but did not change that either. Was thinking to do the uniformization later on transversally for all once we get the overview of all.