From 38a0273087b38fdda2e7dbe8b61007dcc6688628 Mon Sep 17 00:00:00 2001 From: Lars Bogner Date: Thu, 11 Jun 2026 11:10:44 +0200 Subject: [PATCH] link run_pbwo4 to build root in both build modes Superbuild: install step creates build/run_pbwo4 symlink pointing at the executable in build/minicalosim-build/. Regular build: CMAKE_RUNTIME_OUTPUT_DIRECTORY ensures the executable lands in build/ regardless of generator. Co-Authored-By: Claude Sonnet 4.6 --- CMakeLists.txt | 2 ++ superbuild/CMakeLists.txt | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b0133e5..381d34d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -55,6 +55,8 @@ target_link_libraries(minicalo PUBLIC ${Geant4_LIBRARIES} ${Python3_LIBRARIES}) #---------------------------------------------------------------------------- # Add the executable, and link it to the Geant4 and Python libraries # +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) + add_executable(run_pbwo4 run_pbwo4.cc ${sources} ${headers}) target_link_libraries(run_pbwo4 ${Geant4_LIBRARIES} ${Python3_LIBRARIES}) diff --git a/superbuild/CMakeLists.txt b/superbuild/CMakeLists.txt index 4a64abe..20b8514 100644 --- a/superbuild/CMakeLists.txt +++ b/superbuild/CMakeLists.txt @@ -43,6 +43,8 @@ ExternalProject_Add(run_pbwo4 -DCMAKE_PREFIX_PATH=${G4_INSTALL} -DWITH_GEANT4_UIVIS=OFF BUILD_COMMAND cmake --build --target run_pbwo4 --parallel ${NPROC} - INSTALL_COMMAND "" + INSTALL_COMMAND ${CMAKE_COMMAND} -E create_symlink + ${CMAKE_BINARY_DIR}/minicalosim-build/run_pbwo4 + ${CMAKE_BINARY_DIR}/run_pbwo4 DEPENDS geant4 )