Files
Jungfraujoch/common/CMakeLists.txt
T

155 lines
4.9 KiB
CMake

# git header
# the commit's SHA1, and whether the building workspace was dirty or not
FIND_PACKAGE(Git)
EXECUTE_PROCESS(COMMAND
"${GIT_EXECUTABLE}" describe --match=NeVeRmAtCh --always --abbrev=8
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
OUTPUT_VARIABLE GIT_SHA1
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
# the date of the commit
EXECUTE_PROCESS(COMMAND
"${GIT_EXECUTABLE}" log -1 --format=%ad --date=local
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
OUTPUT_VARIABLE GIT_DATE
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
set (THREADS_PREFER_PTHREAD_FLAG ON)
find_package (Threads REQUIRED)
FILE(STRINGS ../VERSION PACKAGE_VERSION)
MESSAGE(STATUS "Jungfraujoch git SHA1: ${GIT_SHA1}")
MESSAGE(STATUS "Jungfraujoch git date: ${GIT_DATE}")
MESSAGE(STATUS "Jungfraujoch version: ${PACKAGE_VERSION}")
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/GitInfo.cpp.in" "${CMAKE_CURRENT_BINARY_DIR}/GitInfo.cpp" @ONLY)
ADD_LIBRARY(JFJochVersion STATIC
${CMAKE_CURRENT_BINARY_DIR}/GitInfo.cpp GitInfo.h)
set_target_properties(JFJochVersion PROPERTIES
POSITION_INDEPENDENT_CODE ON
)
ADD_LIBRARY(JFJochLogger STATIC
Logger.cpp Logger.h
)
TARGET_LINK_LIBRARIES(JFJochLogger PUBLIC spdlog::spdlog JFJochVersion)
ADD_LIBRARY(JFJochZMQ STATIC ZMQWrappers.cpp ZMQWrappers.h)
ADD_LIBRARY(JFJochCommon STATIC
Coord.cpp Coord.h
DiffractionExperiment.cpp DiffractionExperiment.h
RawToConvertedGeometry.h
JFJochException.h
Definitions.h
ThreadSafeFIFO.h
DiffractionSpot.cpp DiffractionSpot.h
StatusVector.cpp StatusVector.h
SpotToSave.h
NetworkAddressConvert.h NetworkAddressConvert.cpp
DetectorGeometry.h
DetectorModuleGeometry.cpp DetectorModuleGeometry.h
DetectorSetup.h DetectorSetup.cpp ZeroCopyReturnValue.h Histogram.h DiffractionGeometry.h
CUDAWrapper.cpp CUDAWrapper.h
ADUHistogram.cpp ADUHistogram.h
RawToConvertedGeometryCore.h
Plot.h
../fpga/pcie_driver/jfjoch_fpga.h
DatasetSettings.cpp DatasetSettings.h
ROIMap.cpp ROIMap.h
ROIElement.cpp ROIElement.h
ROICircle.cpp ROICircle.h
ROIBox.cpp ROIBox.h
ImageBuffer.cpp ImageBuffer.h
time_utc.h
PixelMask.cpp PixelMask.h
InstrumentMetadata.cpp InstrumentMetadata.h
ImageFormatSettings.cpp
ImageFormatSettings.h
DetectorSettings.cpp
DetectorSettings.h
AzimuthalIntegrationSettings.cpp
AzimuthalIntegrationSettings.h
AzimuthalIntegrationProfile.h
AzimuthalIntegrationProfile.cpp
AzimuthalIntegrationMapping.h
AzimuthalIntegrationMapping.cpp
CheckPath.h
AutoIncrVector.h
ModuleSummation.cpp
ModuleSummation.h
ROIDefinition.cpp
ROIDefinition.h
ZeroCopyReturnValue.cpp
ColorScale.cpp ColorScale.h
FileWriterSettings.cpp
FileWriterSettings.h
MovingAverage.cpp
MovingAverage.h
DiffractionGeometry.cpp
ROIAzimuthal.cpp
ROIAzimuthal.h
print_license.h
DetectorGeometryModular.cpp
DetectorGeometryModular.h
DetectorGeometryFixed.cpp
DetectorGeometryFixed.h
GridScanSettings.cpp
GridScanSettings.h
JFJochMessages.h
GoniometerAxis.cpp
GoniometerAxis.h
CompressedImage.cpp
CompressedImage.h
Reflection.h
MultiLinePlot.cpp
MultiLinePlot.h
IndexingSettings.cpp
IndexingSettings.h
CrystalLattice.cpp
CrystalLattice.h
ScanResult.cpp
ScanResult.h
ScanResultGenerator.cpp
ScanResultGenerator.h
BraggIntegrationSettings.cpp
BraggIntegrationSettings.h
SpotToSave.cpp
XrayFluorescenceSpectrum.cpp
XrayFluorescenceSpectrum.h
ResolutionShells.cpp
ResolutionShells.h
DarkMaskSettings.cpp
DarkMaskSettings.h
TopPixels.cpp
TopPixels.h
hkl_key.h
JfjochTCP.h
BrokerStatus.h
ScalingSettings.cpp
ScalingSettings.h
UnitCell.cpp
UnitCell.h
CorrelationCoefficient.cpp
CorrelationCoefficient.h
JFJochReceiverPlots.cpp
JFJochReceiverPlots.h
)
# librt is Linux/glibc-only (older glibc keeps clock_gettime/timer_*/sem_* there, and some
# distros are picky about it for pthreads); it does not exist on macOS/Windows.
TARGET_LINK_LIBRARIES(JFJochCommon JFJochLogger Compression JFCalibration gemmi Threads::Threads
$<$<PLATFORM_ID:Linux>:rt>)
TARGET_LINK_LIBRARIES(JFJochZMQ "$<BUILD_INTERFACE:libzmq-static>")
IF (JFJOCH_CUDA_AVAILABLE)
TARGET_SOURCES(JFJochCommon PRIVATE CUDAWrapper.cu )
TARGET_LINK_LIBRARIES(JFJochCommon CUDA::cudart_static
${CMAKE_DL_LIBS} $<$<PLATFORM_ID:Linux>:rt>)
ENDIF()