From cc0e2202f1db1b914e04590d32aea5d438da2401 Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Fri, 14 Jul 2023 14:57:58 +0200 Subject: [PATCH] Rename CMAKE_BINARY_DIR to PROJECT_BINARY_DIR --- cmake/podioDoxygen.cmake | 2 +- cmake/podioMacros.cmake | 2 +- cmake/podioTest.cmake | 6 +++--- doc/Doxyfile.in | 12 ++++++------ python/CMakeLists.txt | 2 +- tests/CMakeLists.txt | 2 +- tests/dumpmodel/CMakeLists.txt | 8 ++++---- tests/root_io/CMakeLists.txt | 2 +- tests/unittests/CMakeLists.txt | 2 +- tools/CMakeLists.txt | 16 ++++++++-------- 10 files changed, 27 insertions(+), 27 deletions(-) diff --git a/cmake/podioDoxygen.cmake b/cmake/podioDoxygen.cmake index 4a472b154..c8e09b9e1 100644 --- a/cmake/podioDoxygen.cmake +++ b/cmake/podioDoxygen.cmake @@ -8,7 +8,7 @@ if(DOXYGEN_FOUND) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doc/doxy-boot.js.in - ${CMAKE_BINARY_DIR}/doxygen/html/doxy-boot.js) + ${PROJECT_BINARY_DIR}/doxygen/html/doxy-boot.js) add_custom_target(doc ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} diff --git a/cmake/podioMacros.cmake b/cmake/podioMacros.cmake index bb217801c..cf8124d18 100644 --- a/cmake/podioMacros.cmake +++ b/cmake/podioMacros.cmake @@ -368,7 +368,7 @@ function(PODIO_CHECK_CPP_FS FS_LIBS) # After that it should be built-in FOREACH(FS_LIB_NAME "" stdc++fs c++fs) # MESSAGE(STATUS "Linking against ${FS_LIB_NAME}") - try_compile(have_filesystem ${CMAKE_BINARY_DIR}/try ${PROJECT_SOURCE_DIR}/cmake/try_filesystem.cpp + try_compile(have_filesystem ${PROJECT_BINARY_DIR}/try ${PROJECT_SOURCE_DIR}/cmake/try_filesystem.cpp CXX_STANDARD ${CMAKE_CXX_STANDARD} CXX_EXTENSIONS False OUTPUT_VARIABLE HAVE_FS_OUTPUT diff --git a/cmake/podioTest.cmake b/cmake/podioTest.cmake index 0515a45fa..5230af7a3 100644 --- a/cmake/podioTest.cmake +++ b/cmake/podioTest.cmake @@ -5,10 +5,10 @@ function(PODIO_SET_TEST_ENV test) list(JOIN PODIO_IO_HANDLERS " " IO_HANDLERS) set_property(TEST ${test} PROPERTY ENVIRONMENT - LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests:${CMAKE_BINARY_DIR}/src:$:$<$:$>:$ENV{LD_LIBRARY_PATH} + LD_LIBRARY_PATH=${PROJECT_BINARY_DIR}/tests:${PROJECT_BINARY_DIR}/src:$:$<$:$>:$ENV{LD_LIBRARY_PATH} PYTHONPATH=${PROJECT_SOURCE_DIR}/python:$ENV{PYTHONPATH} - PODIO_SIOBLOCK_PATH=${CMAKE_BINARY_DIR}/tests - ROOT_INCLUDE_PATH=${CMAKE_BINARY_DIR}/tests/datamodel:${PROJECT_SOURCE_DIR}/include + PODIO_SIOBLOCK_PATH=${PROJECT_BINARY_DIR}/tests + ROOT_INCLUDE_PATH=${PROJECT_BINARY_DIR}/tests/datamodel:${PROJECT_SOURCE_DIR}/include SKIP_SIO_TESTS=$> IO_HANDLERS=${IO_HANDLERS} PODIO_USE_CLANG_FORMAT=${PODIO_USE_CLANG_FORMAT} diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in index b0f601f8f..d64d9bcda 100644 --- a/doc/Doxyfile.in +++ b/doc/Doxyfile.in @@ -58,7 +58,7 @@ PROJECT_LOGO = # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. -OUTPUT_DIRECTORY = @CMAKE_BINARY_DIR@/doxygen +OUTPUT_DIRECTORY = @PROJECT_BINARY_DIR@/doxygen # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and @@ -144,7 +144,7 @@ FULL_PATH_NAMES = YES # will be relative from the directory where doxygen is started. # This tag requires that the tag FULL_PATH_NAMES is set to YES. -STRIP_FROM_PATH = @PROJECT_SOURCE_DIR@ @CMAKE_BINARY_DIR@ +STRIP_FROM_PATH = @PROJECT_SOURCE_DIR@ @PROJECT_BINARY_DIR@ # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the # path mentioned in the documentation of a class, which tells the reader which @@ -153,7 +153,7 @@ STRIP_FROM_PATH = @PROJECT_SOURCE_DIR@ @CMAKE_BINARY_DIR@ # specify the list of include paths that are normally passed to the compiler # using the -I flag. -STRIP_FROM_INC_PATH = @DOXYGEN_INCLUDE_DIRS@ @CMAKE_BINARY_DIR@/include +STRIP_FROM_INC_PATH = @DOXYGEN_INCLUDE_DIRS@ @PROJECT_BINARY_DIR@/include # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but # less readable) file names. This can be useful is your file systems doesn't @@ -731,7 +731,7 @@ WARN_FORMAT = "$file:$line: $text" # messages should be written. If left blank the output is written to standard # error (stderr). -WARN_LOGFILE = @CMAKE_BINARY_DIR@/doxygen-warnings.log +WARN_LOGFILE = @PROJECT_BINARY_DIR@/doxygen-warnings.log #--------------------------------------------------------------------------- # Configuration options related to the input files @@ -744,7 +744,7 @@ WARN_LOGFILE = @CMAKE_BINARY_DIR@/doxygen-warnings.log # Note: If this tag is empty the current directory is searched. INPUT = @PROJECT_SOURCE_DIR@ -INPUT += @CMAKE_BINARY_DIR@/include +INPUT += @PROJECT_BINARY_DIR@/include INPUT += @CMAKE_CURRENT_BINARY_DIR@ # This tag can be used to specify the character encoding of the source files @@ -801,7 +801,7 @@ EXCLUDE_SYMLINKS = NO # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories for example use the pattern */test/* -EXCLUDE_PATTERNS = */tests/* */dict/* */cmake/* @CMAKE_BINARY_DIR@ +EXCLUDE_PATTERNS = */tests/* */dict/* */cmake/* @PROJECT_BINARY_DIR@ # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index eea3a105a..a17b07748 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -35,5 +35,5 @@ IF (BUILD_TESTING) if (TARGET write_sio) set_property(TEST pyunittest PROPERTY DEPENDS write_sio write_frame_sio) endif() - set_property(TEST pyunittest PROPERTY WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tests) + set_property(TEST pyunittest PROPERTY WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/tests) ENDIF() diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 60b2bdd17..6e71fa2ee 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -63,4 +63,4 @@ CREATE_PODIO_TEST(ostream_operator.cpp "") CREATE_PODIO_TEST(write_ascii.cpp "") # Customize CTest to potentially disable some of the tests with known problems -configure_file(CTestCustom.cmake ${CMAKE_BINARY_DIR}/CTestCustom.cmake @ONLY) +configure_file(CTestCustom.cmake ${PROJECT_BINARY_DIR}/CTestCustom.cmake @ONLY) diff --git a/tests/dumpmodel/CMakeLists.txt b/tests/dumpmodel/CMakeLists.txt index d796325cb..345609210 100644 --- a/tests/dumpmodel/CMakeLists.txt +++ b/tests/dumpmodel/CMakeLists.txt @@ -1,7 +1,7 @@ # Add tests for storing and retrieving the EDM definitions into the produced # files add_test(NAME datamodel_def_store_roundtrip_root COMMAND ${PROJECT_SOURCE_DIR}/tests/scripts/dumpModelRoundTrip.sh - ${CMAKE_BINARY_DIR}/tests/root_io/example_frame.root + ${PROJECT_BINARY_DIR}/tests/root_io/example_frame.root datamodel ${PROJECT_SOURCE_DIR}/tests ) @@ -10,7 +10,7 @@ PODIO_SET_TEST_ENV(datamodel_def_store_roundtrip_root) # The extension model needs to know about the upstream model for generation add_test(NAME datamodel_def_store_roundtrip_root_extension COMMAND ${PROJECT_SOURCE_DIR}/tests/scripts/dumpModelRoundTrip.sh - ${CMAKE_BINARY_DIR}/tests/root_io/example_frame.root + ${PROJECT_BINARY_DIR}/tests/root_io/example_frame.root extension_model ${PROJECT_SOURCE_DIR}/tests/extension_model --upstream-edm=datamodel:${PROJECT_SOURCE_DIR}/tests/datalayout.yaml @@ -28,14 +28,14 @@ set_tests_properties( set(sio_roundtrip_tests "") if (ENABLE_SIO) add_test(NAME datamodel_def_store_roundtrip_sio COMMAND ${PROJECT_SOURCE_DIR}/tests/scripts/dumpModelRoundTrip.sh - ${CMAKE_BINARY_DIR}/tests/sio_io/example_frame.sio + ${PROJECT_BINARY_DIR}/tests/sio_io/example_frame.sio datamodel ${PROJECT_SOURCE_DIR}/tests ) PODIO_SET_TEST_ENV(datamodel_def_store_roundtrip_sio) # The extension model needs to know about the upstream model for generation add_test(NAME datamodel_def_store_roundtrip_sio_extension COMMAND ${PROJECT_SOURCE_DIR}/tests/scripts/dumpModelRoundTrip.sh - ${CMAKE_BINARY_DIR}/tests/sio_io/example_frame.sio + ${PROJECT_BINARY_DIR}/tests/sio_io/example_frame.sio extension_model ${PROJECT_SOURCE_DIR}/tests/extension_model --upstream-edm=datamodel:${PROJECT_SOURCE_DIR}/tests/datalayout.yaml diff --git a/tests/root_io/CMakeLists.txt b/tests/root_io/CMakeLists.txt index ad1537c23..bfa8309f3 100644 --- a/tests/root_io/CMakeLists.txt +++ b/tests/root_io/CMakeLists.txt @@ -54,7 +54,7 @@ if (DEFINED CACHE{PODIO_TEST_INPUT_DATA_DIR}) macro(ADD_PODIO_LEGACY_TEST version base_test input_file) add_test(NAME ${base_test}_${version} COMMAND ${base_test} ${PODIO_TEST_INPUT_DATA_DIR}/${version}/${input_file}) set_property(TEST ${base_test}_${version} PROPERTY ENVIRONMENT - LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests:${CMAKE_BINARY_DIR}/src:$ENV{LD_LIBRARY_PATH} + LD_LIBRARY_PATH=${PROJECT_BINARY_DIR}/tests:${PROJECT_BINARY_DIR}/src:$ENV{LD_LIBRARY_PATH} # Clear the ROOT_INCLUDE_PATH for the tests, to avoid potential conflicts # with existing headers from other installations ROOT_INCLUDE_PATH= diff --git a/tests/unittests/CMakeLists.txt b/tests/unittests/CMakeLists.txt index 1103de315..04f1e019a 100644 --- a/tests/unittests/CMakeLists.txt +++ b/tests/unittests/CMakeLists.txt @@ -83,7 +83,7 @@ else() WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} TEST_PREFIX "UT_" # make it possible to filter easily with -R ^UT TEST_SPEC ${filter_tests} # discover only tests that are known to not fail - DL_PATHS ${CMAKE_CURRENT_BINARY_DIR}:${CMAKE_BINARY_DIR}/src:$:$<$:$>:$ENV{LD_LIBRARY_PATH} + DL_PATHS ${CMAKE_CURRENT_BINARY_DIR}:${PROJECT_BINARY_DIR}/src:$:$<$:$>:$ENV{LD_LIBRARY_PATH} PROPERTIES ENVIRONMENT PODIO_SIOBLOCK_PATH=${CMAKE_CURRENT_BINARY_DIR} diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 4c73df578..beb60e318 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -24,16 +24,16 @@ if(BUILD_TESTING) endfunction() CREATE_DUMP_TEST(podio-dump-help _dummy_target_ --help) - CREATE_DUMP_TEST(podio-dump-root-legacy "write" ${CMAKE_BINARY_DIR}/tests/root_io/example.root) - CREATE_DUMP_TEST(podio-dump-root "write_frame_root" ${CMAKE_BINARY_DIR}/tests/root_io/example_frame.root) - CREATE_DUMP_TEST(podio-dump-detailed-root "write_frame_root" --detailed --category other_events --entries 2:3 ${CMAKE_BINARY_DIR}/tests/root_io/example_frame.root) - CREATE_DUMP_TEST(podio-dump-detailed-root-legacy "write" --detailed --entries 2:3 ${CMAKE_BINARY_DIR}/tests/root_io/example.root) + CREATE_DUMP_TEST(podio-dump-root-legacy "write" ${PROJECT_BINARY_DIR}/tests/root_io/example.root) + CREATE_DUMP_TEST(podio-dump-root "write_frame_root" ${PROJECT_BINARY_DIR}/tests/root_io/example_frame.root) + CREATE_DUMP_TEST(podio-dump-detailed-root "write_frame_root" --detailed --category other_events --entries 2:3 ${PROJECT_BINARY_DIR}/tests/root_io/example_frame.root) + CREATE_DUMP_TEST(podio-dump-detailed-root-legacy "write" --detailed --entries 2:3 ${PROJECT_BINARY_DIR}/tests/root_io/example.root) if (ENABLE_SIO) - CREATE_DUMP_TEST(podio-dump-sio-legacy "write_sio" ${CMAKE_BINARY_DIR}/tests/sio_io/example.sio) - CREATE_DUMP_TEST(podio-dump-sio "write_frame_sio" --entries 4:7 ${CMAKE_BINARY_DIR}/tests/sio_io/example_frame.sio) - CREATE_DUMP_TEST(podio-dump-detailed-sio "write_frame_sio" --detailed --entries 9 ${CMAKE_BINARY_DIR}/tests/sio_io/example_frame.sio) - CREATE_DUMP_TEST(podio-dump-detailed-sio-legacy "write_sio" --detailed --entries 9 ${CMAKE_BINARY_DIR}/tests/sio_io/example.sio) + CREATE_DUMP_TEST(podio-dump-sio-legacy "write_sio" ${PROJECT_BINARY_DIR}/tests/sio_io/example.sio) + CREATE_DUMP_TEST(podio-dump-sio "write_frame_sio" --entries 4:7 ${PROJECT_BINARY_DIR}/tests/sio_io/example_frame.sio) + CREATE_DUMP_TEST(podio-dump-detailed-sio "write_frame_sio" --detailed --entries 9 ${PROJECT_BINARY_DIR}/tests/sio_io/example_frame.sio) + CREATE_DUMP_TEST(podio-dump-detailed-sio-legacy "write_sio" --detailed --entries 9 ${PROJECT_BINARY_DIR}/tests/sio_io/example.sio) endif() endif()