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} )