From 15642f9bcb77525857817fad5c04d9846c55e02f Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Wed, 27 May 2026 09:43:48 -0500 Subject: [PATCH] fix: require BUILD_EXAMPLES for tests with USE_PODIO --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 955836b76..cd53a7599 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -72,6 +72,10 @@ option(BUILD_SHARED_LIBS "Build into both shared and static libs." ON) option(BUILD_EXAMPLES "Build and install examples" ON) option(BUILD_TESTS "Build and install tests" ON) +if (${BUILD_TESTS} AND ${USE_PODIO} AND NOT ${BUILD_EXAMPLES}) + message(FATAL_ERROR "BUILD_TESTS=ON requires BUILD_EXAMPLES=ON when USE_PODIO=ON (unit tests depend on the PODIO example datamodel)") +endif() + if (${USE_PODIO}) find_package(podio REQUIRED) set(JANA2_HAVE_PODIO 1)