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 <noreply@anthropic.com>
This commit is contained in:
@@ -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})
|
||||
|
||||
|
||||
@@ -43,6 +43,8 @@ ExternalProject_Add(run_pbwo4
|
||||
-DCMAKE_PREFIX_PATH=${G4_INSTALL}
|
||||
-DWITH_GEANT4_UIVIS=OFF
|
||||
BUILD_COMMAND cmake --build <BINARY_DIR> --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
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user