-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
55 lines (45 loc) · 1.8 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# GramsG4
if (NOT Geant4_FOUND)
message(STATUS "Geant4 not found; skipping GramsG4 compilation.")
return()
endif()
#----------------------------------------------------------------------------
# Locate sources and headers for this project
#
include_directories(include
g4util/include
${PROJECT_SOURCE_DIR}/util/include
${Geant4_INCLUDE_DIR}
${ROOT_INCLUDE_DIR}
)
file(GLOB sources src/*.cc
g4util/src/*.cc
)
#----------------------------------------------------------------------------
# Add the executables, and link them to the libraries
# Add an extension determined by GramsSim/CMakeLists.txt
set (PROG "gramsg4${EXE}")
add_executable(${PROG} gramsg4.cc ${sources})
# Include any internal libraries, such as this project's utilities and
# its data objects.
target_link_libraries(${PROG} Utilities )
target_link_libraries(${PROG} Dictionary)
if (NOT MACOSX)
# The following line is needed to make sure Dictionary is linked with the executable.
target_link_options(${PROG} PRIVATE "LINKER:-no-as-needed")
endif()
#message(STATUS "GramsG4 link library ${CMAKE_PROJECT_NAME}Utilities")
#message(STATUS "GramsG4 link library Dictionary")
target_link_libraries(${PROG} ${HEPMC3_LIBRARIES} )
target_link_libraries(${PROG} ${ROOT_LIBRARIES} )
target_link_libraries(${PROG} ${Geant4_LIBRARIES} )
#message(STATUS "Geant4_LIBRARIES = ${Geant4_LIBRARIES}")
#message(STATUS "ROOT_LIBRARIES = ${ROOT_LIBRARIES}")
#message(STATUS "HEPMC3_LIBRARIES = ${HEPMC3_LIBRARIES}")
# Put the compiled binary into the main GramsSim build directory.
# Without this statement, the binary would be placed in
# <build-directory>/GramsG4/gramsg4.
set_target_properties( ${PROG}
PROPERTIES RUNTIME_OUTPUT_DIRECTORY
"${CMAKE_BINARY_DIR}"
)