Skip to content

Commit

Permalink
Use cmake targets
Browse files Browse the repository at this point in the history
  • Loading branch information
YanzhaoW authored and jose-luis-rs committed Jun 11, 2024
1 parent c82d4a4 commit 839db3a
Show file tree
Hide file tree
Showing 5 changed files with 132 additions and 219 deletions.
88 changes: 33 additions & 55 deletions gtpc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,64 +12,42 @@
##############################################################################
# Create a library called "libR3BGTPC" which includes the source files given in
# the array .
# The extension is already found. Any number of sources could be listed here.

Set(SYSTEM_INCLUDE_DIRECTORIES
${SYSTEM_INCLUDE_DIRECTORIES}
${BASE_INCLUDE_DIRECTORIES}
)

set(INCLUDE_DIRECTORIES
#put here all directories where header files are located
${R3BROOT_SOURCE_DIR}/r3bbase
${R3BROOT_SOURCE_DIR}/r3bdata
${R3BGTPC_SOURCE_DIR}/gtpc
${R3BGTPC_SOURCE_DIR}/gtpcmap
${R3BGTPC_SOURCE_DIR}/gtpcdata
#${R3BGTPC_SOURCE_DIR}/gtpcreconstruction/triplclust/src
#${R3BGTPC_SOURCE_DIR}/gtpcreconstruction/
${R3BROOT_SOURCE_DIR}/field
${Boost_INCLUDE_DIRS}
)

include_directories( ${INCLUDE_DIRECTORIES})
include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES})

set(LINK_DIRECTORIES
${ROOT_LIBRARY_DIR}
${FAIRROOT_LIBRARY_DIR}
)

link_directories( ${LINK_DIRECTORIES})

set(SRCS
#Put here your sourcefiles
R3BGTPC.cxx
R3BGTPCProjector.cxx
R3BGTPCLangevin.cxx
R3BGTPCLangevinTest.cxx
R3BGTPCContFact.cxx
R3BGTPCGeoPar.cxx
R3BGTPCGasPar.cxx
R3BGTPCElecPar.cxx
#R3BGTPCHitPar.cxx
R3BGTPCCalPar.cxx
#R3BGTPCMappedPar.cxx
R3BGTPCCal2Hit.cxx
R3BGTPCMapped2Cal.cxx
#R3BGTPCHit2Track.cxx
#R3BGTPCCal2HitPar.cxx
#R3BGTPCMapped2CalPar.cxx
#Put here your sourcefiles
R3BGTPC.cxx
R3BGTPCProjector.cxx
R3BGTPCLangevin.cxx
R3BGTPCLangevinTest.cxx
R3BGTPCContFact.cxx
R3BGTPCGeoPar.cxx
R3BGTPCGasPar.cxx
R3BGTPCElecPar.cxx
#R3BGTPCHitPar.cxx
R3BGTPCCalPar.cxx
#R3BGTPCMappedPar.cxx
R3BGTPCCal2Hit.cxx
R3BGTPCMapped2Cal.cxx
#R3BGTPCHit2Track.cxx
#R3BGTPCCal2HitPar.cxx
#R3BGTPCMapped2CalPar.cxx
)

# fill list of header files from list of source files
# by exchanging the file extension
CHANGE_FILE_EXTENSION(*.cxx *.h HEADERS "${SRCS}")

set(LINKDEF GTPCLinkDef.h)
set(LIBRARY_NAME R3BGTPC)
set(DEPENDENCIES
R3BBase R3BGTPCData R3BGTPCMap)
#R3BGTPCReconstruction)

GENERATE_LIBRARY()
change_file_extension(*.cxx *.h HEADERS "${SRCS}")

add_library_with_dictionary(
LIBNAME
R3BGTPC
LINKDEF
GTPCLinkDef.h
HEADERS
${HEADERS}
SRCS
${SRCS}
INCLUDEDIRS
${CMAKE_CURRENT_SOURCE_DIR}
DEPENDENCIES
R3BGTPCData
R3BGTPCMap)
62 changes: 24 additions & 38 deletions gtpcdata/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,31 @@
# the array .
# The extension is already found. Any number of sources could be listed here.

Set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-overloaded-virtual")

Set(SYSTEM_INCLUDE_DIRECTORIES
${SYSTEM_INCLUDE_DIRECTORIES}
${BASE_INCLUDE_DIRECTORIES}
)

set(INCLUDE_DIRECTORIES
${R3BROOT_SOURCE_DIR}/r3bdata
${R3BGTPC_SOURCE_DIR}/gtpcdata
)

include_directories( ${INCLUDE_DIRECTORIES})
include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES})

set(LINK_DIRECTORIES
${ROOT_LIBRARY_DIR}
${FAIRROOT_LIBRARY_DIR}
)

link_directories( ${LINK_DIRECTORIES})

set(SRCS
R3BGTPCPoint.cxx
R3BGTPCProjPoint.cxx
R3BGTPCMappedData.cxx
R3BGTPCCalData.cxx
R3BGTPCHitData.cxx
R3BGTPCHitClusterData.cxx
R3BGTPCTrackData.cxx
)
R3BGTPCPoint.cxx
R3BGTPCProjPoint.cxx
R3BGTPCMappedData.cxx
R3BGTPCCalData.cxx
R3BGTPCHitData.cxx
R3BGTPCHitClusterData.cxx
R3BGTPCTrackData.cxx)

# fill list of header files from list of source files
# by exchanging the file extension
CHANGE_FILE_EXTENSION(*.cxx *.h HEADERS "${SRCS}")

set(LINKDEF R3BGTPCDataLinkDef.h)
set(LIBRARY_NAME R3BGTPCData)
set(DEPENDENCIES
R3BTracking Core m)

GENERATE_LIBRARY()
change_file_extension(*.cxx *.h HEADERS "${SRCS}")

add_library_with_dictionary(
LIBNAME
R3BGTPCData
LINKDEF
R3BGTPCDataLinkDef.h
HEADERS
${HEADERS}
SRCS
${SRCS}
INCLUDEDIRS
${CMAKE_CURRENT_SOURCE_DIR}
DEPENDENCIES
R3BTracking)

target_compile_options(R3BGTPCData PRIVATE -Wno-overloaded-virtual)
57 changes: 17 additions & 40 deletions gtpceve/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,47 +12,24 @@
##############################################################################
# Create a library called "libR3BGTPC" which includes the source files given in
# the array .
# The extension is already found. Any number of sources could be listed here.

Set(SYSTEM_INCLUDE_DIRECTORIES
${SYSTEM_INCLUDE_DIRECTORIES}
${BASE_INCLUDE_DIRECTORIES}
)

set(INCLUDE_DIRECTORIES
#put here all directories where header files are located
${R3BROOT_SOURCE_DIR}/r3bbase
${R3BROOT_SOURCE_DIR}/r3bdata
${R3BGTPC_SOURCE_DIR}/gtpc
${R3BGTPC_SOURCE_DIR}/gtpcdata
${R3BGTPC_SOURCE_DIR}/gtpceve
${R3BGTPC_SOURCE_DIR}/gtpcmap
${R3BROOT_SOURCE_DIR}/field
)

include_directories( ${INCLUDE_DIRECTORIES})
include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES})

set(LINK_DIRECTORIES
${ROOT_LIBRARY_DIR}
${FAIRROOT_LIBRARY_DIR}
)

link_directories( ${LINK_DIRECTORIES})

set(SRCS
#Put here your sourcefiles
R3BGTPCEventManager.cxx
R3BGTPCEventDrawTask.cxx
)
set(SRCS R3BGTPCEventManager.cxx R3BGTPCEventDrawTask.cxx)

# fill list of header files from list of source files
# by exchanging the file extension
CHANGE_FILE_EXTENSION(*.cxx *.h HEADERS "${SRCS}")

set(LINKDEF GTPCEveLinkDef.h)
set(LIBRARY_NAME R3BGTPCEve)
set(DEPENDENCIES
R3BBase R3BGTPCData R3BGTPCMap EventDisplay Eve Gui Ged RGL Graf3d)

GENERATE_LIBRARY()
change_file_extension(*.cxx *.h HEADERS "${SRCS}")

add_library_with_dictionary(
LIBNAME
R3BGTPCEve
LINKDEF
GTPCEveLinkDef.h
HEADERS
${HEADERS}
SRCS
${SRCS}
INCLUDEDIRS
${CMAKE_CURRENT_SOURCE_DIR}
DEPENDENCIES
R3BGTPCData
R3BGTPCMap)
66 changes: 30 additions & 36 deletions gtpcmap/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,42 +1,36 @@
##############################################################################
# Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH #
# Copyright (C) 2019 Members of R3B Collaboration #
# #
# This software is distributed under the terms of the #
# GNU General Public Licence (GPL) version 3, #
# copied verbatim in the file "LICENSE". #
# #
# In applying this license GSI does not waive the privileges and immunities #
# granted to it by virtue of its status as an Intergovernmental Organization #
# or submit itself to any jurisdiction. #
##############################################################################
# Create a library called "libR3BGTPCMAP" which includes the source files given in
# the array .
# The extension is already found. Any number of sources could be listed here.

Set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-overloaded-virtual")

Set(SYSTEM_INCLUDE_DIRECTORIES
${SYSTEM_INCLUDE_DIRECTORIES}
${BASE_INCLUDE_DIRECTORIES}
)

set(INCLUDE_DIRECTORIES
${ROOT_INCLUDE_DIR}
${Boost_INCLUDE_DIRS}
${R3BGTPC_SOURCE_DIR}/gtpcmap
)

include_directories( ${INCLUDE_DIRECTORIES})
include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES})

set(LINK_DIRECTORIES
${ROOT_LIBRARY_DIR}
${FAIRROOT_LIBRARY_DIR}
)

link_directories( ${LINK_DIRECTORIES})

set(SRCS
R3BGTPCMap.cxx
)
set(SRCS R3BGTPCMap.cxx)

# fill list of header files from list of source files
# by exchanging the file extension
CHANGE_FILE_EXTENSION(*.cxx *.h HEADERS "${SRCS}")

set(LINKDEF R3BGTPCMapLinkDef.h)
set(LIBRARY_NAME R3BGTPCMap)
set(DEPENDENCIES
Hist Core m)

GENERATE_LIBRARY()

change_file_extension(*.cxx *.h HEADERS "${SRCS}")

add_library_with_dictionary(
LIBNAME
R3BGTPCMap
LINKDEF
R3BGTPCMapLinkDef.h
HEADERS
${HEADERS}
SRCS
${SRCS}
INCLUDEDIRS
${CMAKE_CURRENT_SOURCE_DIR}
DEPENDENCIES
R3BBase)

target_compile_options(R3BGTPCMap PRIVATE -Wno-overloaded-virtual)
78 changes: 28 additions & 50 deletions gtpcreconstruction/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,58 +12,36 @@
##############################################################################
# Create a library called "libR3BGTPCReconstruction" which includes the source files given in
# the array .
# The extension is already found. Any number of sources could be listed here.

Set(SYSTEM_INCLUDE_DIRECTORIES
${SYSTEM_INCLUDE_DIRECTORIES}
${BASE_INCLUDE_DIRECTORIES}
)

set(INCLUDE_DIRECTORIES
#put here all directories where header files are located
${R3BROOT_SOURCE_DIR}/r3bbase
${R3BROOT_SOURCE_DIR}/r3bdata
${R3BGTPC_SOURCE_DIR}/gtpc
${R3BGTPC_SOURCE_DIR}/gtpcdata
${R3BROOT_SOURCE_DIR}/field
${R3BGTPC_SOURCE_DIR}/gtpcreconstruction
${R3BGTPC_SOURCE_DIR}/gtpcreconstruction/triplclust/src
${R3BGTPC_SOURCE_DIR}/gtpcreconstruction/triplclust/src/hclust
${R3BGTPC_SOURCE_DIR}/gtpcreconstruction/triplclust/src/kdtree
)

include_directories( ${INCLUDE_DIRECTORIES})
include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES})

set(LINK_DIRECTORIES
${ROOT_LIBRARY_DIR}
${FAIRROOT_LIBRARY_DIR}
)

link_directories( ${LINK_DIRECTORIES})

set(SRCS
triplclust/src/cluster.cxx
triplclust/src/triplet.cxx
#triplclust/src/main.cpp
triplclust/src/dnn.cxx
triplclust/src/hclust/fastcluster.cxx
triplclust/src/kdtree/kdtree.cxx
triplclust/src/pointcloud.cxx
triplclust/src/output.cxx
triplclust/src/option.cxx
triplclust/src/util.cxx
triplclust/src/graph.cxx
R3BGTPCTrackFinder.cxx
)
triplclust/src/cluster.cxx
triplclust/src/triplet.cxx
#triplclust/src/main.cpp
triplclust/src/dnn.cxx
triplclust/src/hclust/fastcluster.cxx
triplclust/src/kdtree/kdtree.cxx
triplclust/src/pointcloud.cxx
triplclust/src/output.cxx
triplclust/src/option.cxx
triplclust/src/util.cxx
triplclust/src/graph.cxx
R3BGTPCTrackFinder.cxx)

# fill list of header files from list of source files
# by exchanging the file extension
CHANGE_FILE_EXTENSION(*.cxx *.h HEADERS "${SRCS}")

set(LINKDEF R3BGTPCReconstructionLinkDef.h)
set(LIBRARY_NAME R3BGTPCReconstruction)
set(DEPENDENCIES
R3BBase R3BGTPCData)

GENERATE_LIBRARY()
change_file_extension(*.cxx *.h HEADERS "${SRCS}")

add_library_with_dictionary(
LIBNAME
R3BGTPCReconstruction
LINKDEF
R3BGTPCReconstructionLinkDef.h
HEADERS
${HEADERS}
SRCS
${SRCS}
INCLUDEDIRS
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/triplclust/src
DEPENDENCIES
R3BGTPCData)

0 comments on commit 839db3a

Please sign in to comment.