From 4d6c0b7788ad13b9b5dcf5a92b627148c8b159f6 Mon Sep 17 00:00:00 2001 From: Juan Miguel Carceller <22276694+jmcarcell@users.noreply.github.com> Date: Wed, 4 Oct 2023 11:54:24 +0200 Subject: [PATCH] Move podio_PYTHON_DIR to the top level CMakeLists (#497) Co-authored-by: jmcarcell --- CMakeLists.txt | 5 +++++ tests/CMakeLists.txt | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0198f8c43..0055a00d2 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -178,6 +178,11 @@ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/NOTICE #--- project specific subdirectories ------------------------------------------- add_subdirectory(src) + +# Set the podio_PYTHON_DIR manually here because the macros in tests expect it +# If testing is not build this helps when building together with other packages +SET(podio_PYTHON_DIR ${PROJECT_SOURCE_DIR}/python CACHE PATH "Path to the podio python directory") + if(BUILD_TESTING) include(cmake/podioTest.cmake) add_subdirectory(tests) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 50d2846ab..b09c6efa6 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -5,9 +5,6 @@ foreach( _conf ${CMAKE_CONFIGURATION_TYPES} ) set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${_conf} ${CMAKE_CURRENT_BINARY_DIR} ) endforeach() -# Set the podio_PYTHON_DIR manually here because the macros below expect it -SET(podio_PYTHON_DIR ${PROJECT_SOURCE_DIR}/python CACHE PATH "Path to the podio python directory") - PODIO_GENERATE_DATAMODEL(datamodel datalayout.yaml headers sources IO_BACKEND_HANDLERS ${PODIO_IO_HANDLERS} )