properly added fmt as a dependency

This commit is contained in:
2026-03-05 15:00:07 +01:00
parent 317c3187f5
commit ea1edc02d8
5 changed files with 131 additions and 90 deletions
+37 -28
View File
@@ -40,7 +40,7 @@ option(SLS_USE_SYSTEM_ZMQ "Use system installed libzmq" OFF)
include(FetchContent)
option(SLS_FETCH_ZMQ_FROM_GITHUB "Fetch zmq from github" OFF)
option(SLS_FETCH_PYBIND11_FROM_GITHUB "Fetch pybind11 from github" OFF)
option(SLS_FETCH_FTMT_FROM_GITHUB "Fetch ftmt from github" ON)
option(SLS_FETCH_FMT_FROM_GITHUB "Fetch fmt from github" OFF)
# Allow FetchContent_Populate to be called with a single argument
# otherwise deprecated warning is issued
@@ -165,30 +165,6 @@ else()
endif()
if (SLS_FETCH_FMT_FROM_GITHUB)
set(FMT_TEST OFF CACHE INTERNAL "disabling fmt tests")
FetchContent_Declare(
fmt
GIT_REPOSITORY https://github.com/fmtlib/fmt.git
GIT_TAG 10.2.1
GIT_PROGRESS TRUE
USES_TERMINAL_DOWNLOAD TRUE
)
set(FMT_INSTALL ON CACHE BOOL "")
# set(FMT_CMAKE_DIR "")
FetchContent_MakeAvailable(fmt)
set_property(TARGET fmt PROPERTY POSITION_INDEPENDENT_CODE ON)
install(TARGETS fmt
EXPORT ${project}-targets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
else()
find_package(fmt 6 REQUIRED)
endif()
include(GNUInstallDirs)
# If conda build, always set lib dir to 'lib'
@@ -213,6 +189,40 @@ if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
set(SLS_MASTER_PROJECT ON)
endif()
if (SLS_FETCH_FMT_FROM_GITHUB)
set(FMT_TEST OFF CACHE INTERNAL "disabling fmt tests")
FetchContent_Declare(
fmt
GIT_REPOSITORY https://github.com/fmtlib/fmt.git
GIT_TAG 12.1.0
GIT_PROGRESS TRUE
USES_TERMINAL_DOWNLOAD TRUE
)
set(FMT_INSTALL ON CACHE BOOL "")
# set(FMT_CMAKE_DIR "")
FetchContent_MakeAvailable(fmt)
set_property(TARGET fmt PROPERTY POSITION_INDEPENDENT_CODE ON)
else()
# downloaded from https://github.com/fmtlib/fmt/releases/tag/12.1.0
FetchContent_Declare(
fmt
URL ${CMAKE_CURRENT_SOURCE_DIR}/libs/fmt/fmt-12.1.0.tar.gz
# Compute hash: md5sum fmt-12.1.0.tar.gz
URL_HASH MD5=92eb6f492e4838e5f024ce5207beafc7)
FetchContent_MakeAvailable(fmt)
endif()
# Export fmt
if(SLS_MASTER_PROJECT)
install(TARGETS fmt
EXPORT ${TARGETS_EXPORT_NAME}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
endif()
option(SLS_USE_HDF5 "HDF5 File format" OFF)
@@ -312,10 +322,9 @@ endif()
# to control options for the libraries
if(NOT TARGET slsProjectOptions)
add_library(slsProjectOptions INTERFACE)
target_compile_features(slsProjectOptions INTERFACE cxx_std_17)
target_compile_definitions(slsProjectOptions
target_compile_features(slsProjectOptions INTERFACE cxx_std_17)
target_compile_definitions(slsProjectOptions
INTERFACE LOG_MAX_REPORTING_LEVEL=${SLS_LOG_MAX_REPORTING_LEVEL})
target_link_libraries(slsProjectOptions INTERFACE fmt::fmt)
endif()
+35 -24
View File
@@ -83,51 +83,62 @@ To use the basic building blocks, meaning sls_detector_get/put and the shared li
> **Note:** For v9.x.x of slsDetectorPackage and older, C++11 compatible compiler.
#### Python bindings
* Python >= 3.8
Additionally the core requires the following dependencies:
* pybind11 2.13.6 (packaged in libs)
* fmt 12.1.0 (packaged in libs)
* ZeroMQ 4.3.4 (packaged in libs)
* rapidjson (packaged in libs)
> **Note:** Refer [pybind11 notes](#4-pybind-and-zeromq).
#### ZeroMQ
* Zeromq 4.3.4 (packaged in libs)
> **Note:** Both fmt, ZeroMQ and rapidjson are bundled in libs. One does not need to pre-install them on the system. Alternatively, one can fetch fmt and ZeroMQ from GitHub by passing the cmake options ``-DSLS_FETCH_FMT_FROM_GITHUB=ON`` and ``-DSLS_FETCH_ZEROMQ_FROM_GITHUB=ON`` respectively.
> **Note:** Refer [zeromq notes](#4-pybind-and-zeromq).
#### GUI
#### Dependencies to build Python module
* Qt 5.9
To build the python module the following dependencies are needed:
* Qwt 6.1.5 (packaged in libs)
* Python >= 3.8
* pybind11 2.13.6 (packaged in libs)
> **Note:** pybind11 is bundled in libs. One does not need to pre-install it on the system. Alternatively, one can fetch pybind11 from GitHub by passing the cmake option ``-DSLS_FETCH_PYBIND11_FROM_GITHUB=ON``.
#### Moench executables
> **Note:** Refer [pybind11 notes](#4-pybind-and-zeromq).
* libtiff
#### Documentation
#### Dependencies to build documentation
The documentation is built with
* Doxygen (to extract C++ classes etc.)
To build this documentation that you are reading now the following dependencies are needed:
* Breathe (Sphinx plugin to handle doxygen xml)
* Doxygen (to extract C++ classes etc.)
* Breathe (Sphinx plugin to handle doxygen xml)
* Sphinx with sphinx_rtd_theme
* Sphinx with sphinx_rtd_theme
#### Dependencies to build GUI
#### Packaged in libs/
To build the GUI the following dependencies are needed:
* catch2 (unit testing)
* Qt 5.9
* Qwt 6.1.5 (packaged in libs)
* rapidjson (streaming from receiver)
> **Note:** Qwt is bundled in libs. One does not need to pre-install it on the system.
* pybind11 (python bindings)
* qwt (gui plotting)
#### Dependencies to build Moench and Jungfrau executables
* libzmq (streaming to/from receiver)
To build the Moench and Jungfrau executables for preprocessing and calibration the following dependencies are needed:
* libtiff
#### Dependencies to build Tests
To build the tests the following dependencies are needed:
* Catch2 3.4.0 (packaged in libs)
> **Note:** Catch2 is bundled in libs. One does not need to pre-install it on the system.
### 3.2. Download Source Code from github
```
+58 -37
View File
@@ -16,61 +16,82 @@ the shared libraries these are needed:
* CMake >= 3.14
* C++17 compatible compiler. (We test with gcc and clang)
.. note ::
.. note::
For v9.x.x of slsDetectorPackage and older, C++11 compatible compiler.
-----------------------
Python bindings
-----------------------
Additionally the core requires the following dependencies:
* Python >= 3.8
* pybind11 2.13.6 (packaged in libs)
* fmt 12.1.0 (packaged in libs)
* ZeroMQ 4.3.4 (packaged in libs)
* rapidjson (packaged in libs)
.. note ::
.. note::
Refer :ref:`pybind11 notes. <pybind for different slsDetectorPackage versions>`
Both fmt, ZeroMQ and rapidjson are bundled in libs. One does not need to pre-install them on the system. Alternatively, one can fetch fmt and ZeroMQ from GitHub by passing the cmake options ``-DSLS_FETCH_FMT_FROM_GITHUB=ON`` and ``-DSLS_FETCH_ZEROMQ_FROM_GITHUB=ON`` respectively.
-----------------------
ZeroMQ
-----------------------
* Zeromq 4.3.4 (packaged in libs)
.. note ::
.. note::
Refer :ref:`zeromq notes. <zeromq for different slsDetectorPackage versions>`
-----------------------
GUI
-----------------------
------------------------------------
Dependencies to build Python module
------------------------------------
To build the python module the following dependencies are needed:
* Python >= 3.8
* pybind11 2.13.6 (packaged in libs)
.. note::
pybind11 is bundled in libs. One does not need to pre-install it on the system. Alternatively, one can fetch pybind11 from GitHub by passing the cmake option ``-DSLS_FETCH_PYBIND11_FROM_GITHUB=ON``.
.. note::
Refer :ref:`pybind11 notes. <pybind for different slsDetectorPackage versions>`
-------------------------------
Dependencies to build documentation
-------------------------------
To build this documentation that you are reading now the following dependencies are needed:
* Doxygen (to extract C++ classes etc.)
* Breathe (Sphinx plugin to handle doxygen xml)
* Sphinx with sphinx_rtd_theme
-------------------------
Dependencies to build GUI
-------------------------
To build the GUI the following dependencies are needed:
* Qt 5.9
* Qwt 6.1.5 (packaged in libs)
-----------------------
Moench executables
-----------------------
.. note::
Qwt is bundled in libs. One does not need to pre-install it on the system.
------------------------------------------------------
Dependencies to build Moench and Jungfrau executables
-----------------------------------------------------
To build the Moench and Jungfrau executables for preprocessing and calibration the following dependencies are needed:
* libtiff
-----------------------
Documentation
-----------------------
--------------------------------------------------
Dependencies to build Tests
--------------------------------------------------
The documentation that you are reading now is built with
To build the tests the following dependencies are needed:
* Doxygen (to extract C++ classes etc.)
* Breathe (Sphinx plugin to handle doxygen xml)
* Sphinx with sphinx_rtd_theme
* Catch2 3.4.0 (packaged in libs)
-----------------------
Packaged in libs/
-----------------------
* catch2 (unit testing)
* rapidjson (streaming from receiver)
* pybind11 (python bindings)
* qwt (gui plotting)
* libzmq (streaming to/from receiver)
.. note::
Catch2 is bundled in libs. One does not need to pre-install it on the system.
Binary file not shown.
+1 -1
View File
@@ -95,7 +95,7 @@ target_link_libraries(slsSupportObject
slsProjectOptions
${STD_FS_LIB} # from helpers.cmake
Threads::Threads # slsDetector and Receiver need this
fmt::fmt
PRIVATE
slsProjectWarnings
md5sls