Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Corryvreckan
Corryvreckan
Commits
613c33b7
Commit
613c33b7
authored
Oct 09, 2017
by
Simon Spannagel
Browse files
Build separate shared libs for all algorithms
parent
d7588f61
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/algorithms/CMakeLists.txt
View file @
613c33b7
MACRO
(
corryvreckan_algorithm name
)
# Get the list of sources
SET
(
_list_var
"
${
ARGN
}
"
)
LIST
(
REMOVE_ITEM _list_var
${
name
}
)
# Include directories for dependencies
INCLUDE_DIRECTORIES
(
SYSTEM
${
CORRYVRECKAN_DEPS_INCLUDE_DIRS
}
)
# Build all modules by default if not specified otherwise
OPTION
(
BUILD_
${
name
}
"Build algorithm
${
name
}
?"
ON
)
# Put message
MESSAGE
(
STATUS
"Building algorithm: "
${
name
}
)
# Prepend with the allpix module prefix to create the name of the module
SET
(
LIBNAME
"CorryvreckanAlgorithm
${
name
}
"
)
# Save the module library for prelinking in the executable (NOTE: see exec folder)
SET
(
CORRYVRECKAN_ALGORITHM_LIBRARIES
${
CORRYVRECKAN_ALGORITHM_LIBRARIES
}
${
LIBNAME
}
CACHE INTERNAL
"Algorithm libraries"
)
# Define the library
ADD_LIBRARY
(
${
LIBNAME
}
SHARED
${
_list_var
}
)
# Add the current directory as include directory
TARGET_INCLUDE_DIRECTORIES
(
${
LIBNAME
}
PRIVATE
${
CMAKE_CURRENT_SOURCE_DIR
}
)
# Link the standard allpix libraries
TARGET_LINK_LIBRARIES
(
${
LIBNAME
}
${
CORRYVRECKAN_LIBRARIES
}
${
CORRYVRECKAN_DEPS_LIBRARIES
}
)
INSTALL
(
TARGETS
${
LIBNAME
}
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
ENDMACRO
()
# Include the dependencies
INCLUDE_DIRECTORIES
(
SYSTEM
${
CORRYVRECKAN_DEPS_INCLUDE_DIRS
}
)
# Create Algorithms library
ADD_LIBRARY
(
CorryvreckanAlgorithms SHARED
Alignment.C
BasicTracking.C
Clicpix2Correlator.C
Clicpix2EventLoader.C
ClicpixAnalysis.C
CLICpixEventLoader.C
DataDump.C
DUTAnalysis.C
EventDisplay.C
FileReader.C
FileWriter.C
GenericAlgorithm.C
GUI.C
OnlineMonitor.C
SpatialTracking.C
TestAlgorithm.C
Timepix1Clustering.C
Timepix1Correlator.C
Timepix1EventLoader.C
Timepix3Clustering.C
Timepix3EventLoader.C
Timepix3MaskCreator.C
)
# Link the dependencies
TARGET_LINK_LIBRARIES
(
CorryvreckanAlgorithms
${
CORRYVRECKANX_DEPS_LIBRARIES
}
)
TARGET_LINK_LIBRARIES
(
CorryvreckanAlgorithms
${
CORRYVRECKAN_LIBRARIES
}
)
# Define compile-time library extension
TARGET_COMPILE_DEFINITIONS
(
CorryvreckanAlgorithms PRIVATE SHARED_LIBRARY_SUFFIX=
"
${
CMAKE_SHARED_LIBRARY_SUFFIX
}
"
)
# Link the DL libraries
TARGET_LINK_LIBRARIES
(
CorryvreckanAlgorithms
${
CMAKE_DL_LIBS
}
)
# Create standard install target
INSTALL
(
TARGETS CorryvreckanAlgorithms
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
)
INCLUDE_DIRECTORIES
(
SYSTEM
${
_DEPS_INCLUDE_DIRS
}
)
# Build all the modules
FILE
(
GLOB srcfiles
${
CMAKE_CURRENT_SOURCE_DIR
}
/*.C
)
FOREACH
(
src
${
srcfiles
}
)
GET_FILENAME_COMPONENT
(
name
${
src
}
NAME_WE
)
# Add the library
CORRYVRECKAN_ALGORITHM
(
${
name
}
${
src
}
)
ENDFOREACH
()
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment