diff --git a/CMakeLists.txt b/CMakeLists.txt index b04ff00..3fe9c50 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -176,7 +176,11 @@ if(AARE_FETCH_MINUIT2) set(BUILD_TESTING OFF CACHE BOOL "") + set(MINUIT2_INSTALL + ON + CACHE BOOL "") FetchContent_MakeAvailable(Minuit2) + set_property(TARGET Minuit2Math PROPERTY POSITION_INDEPENDENT_CODE ON) set_property(TARGET Minuit2 PROPERTY POSITION_INDEPENDENT_CODE ON) else() @@ -245,17 +249,8 @@ if(AARE_FETCH_FMT) 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() @@ -268,10 +263,6 @@ if(AARE_FETCH_JSON) ON CACHE BOOL "") FetchContent_MakeAvailable(json) - set(NLOHMANN_JSON_TARGET_NAME nlohmann_json) - - install(TARGETS nlohmann_json EXPORT "${TARGETS_EXPORT_NAME}") - message(STATUS "target: ${NLOHMANN_JSON_TARGET_NAME}") else() find_package(nlohmann_json 3.11.3 REQUIRED) endif() diff --git a/include/aare/ClusterFile.hpp b/include/aare/ClusterFile.hpp index db0a694..885d4b4 100644 --- a/include/aare/ClusterFile.hpp +++ b/include/aare/ClusterFile.hpp @@ -383,7 +383,7 @@ ClusterFile::read_frame_without_cut() { "Unexpected error (not feof or ferror) when reading frame number"); } - int32_t n_clusters; // Saved as 32bit integer in the cluster file + uint32_t n_clusters; if (fread(&n_clusters, sizeof(n_clusters), 1, fp) != 1) { throw std::runtime_error(LOCATION + "Could not read number of clusters"); diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 6d3ff60..4cb6d17 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -34,6 +34,7 @@ target_include_directories( # List of python files to be copied to the build directory set(PYTHON_FILES aare/__init__.py + aare/_version.py aare/CtbRawFile.py aare/ClusterFinder.py aare/ClusterVector.py diff --git a/python/aare/__init__.py b/python/aare/__init__.py index 33c499d..256fff7 100644 --- a/python/aare/__init__.py +++ b/python/aare/__init__.py @@ -13,6 +13,7 @@ from ._aare import corner # from ._aare import ClusterFinderMT, ClusterCollector, ClusterFileSink, ClusterVector_i +from ._version import __version__ from .ClusterFinder import ClusterFinder, ClusterCollector, ClusterFinderMT, ClusterFileSink, ClusterFile from .ClusterVector import ClusterVector from .Cluster import Cluster diff --git a/python/aare/_version.py b/python/aare/_version.py new file mode 100644 index 0000000..d8e2b01 --- /dev/null +++ b/python/aare/_version.py @@ -0,0 +1,8 @@ +# This file is used to get the version of the package from the VERSION file +from importlib.metadata import PackageNotFoundError, version +from pathlib import Path + +try: + __version__ = version('aare') +except PackageNotFoundError: + __version__ = Path(__file__).parents[2].joinpath('VERSION').read_text().strip() \ No newline at end of file