Skip to content

Commit

Permalink
added macro for version
Browse files Browse the repository at this point in the history
  • Loading branch information
mdorier committed Aug 23, 2024
1 parent 2f2f144 commit c792c92
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ if (NOT CMAKE_BUILD_TYPE)
"Debug" "Release" "RelWithDebInfo" "MinSizeRel")
endif ()

set (THALLIUM_VERSION_MAJOR 0)
set (THALLIUM_VERSION_MINOR 14)
set (THALLIUM_VERSION_PATCH 0)
set (thallium-vers "${THALLIUM_VERSION_MAJOR}.${THALLIUM_VERSION_MINOR}")
set (THALLIUM_VERSION "${thallium-vers}.${THALLIUM_VERSION_PATCH}")

option (ENABLE_TESTS "Enable tests" OFF)
option (ENABLE_EXAMPLES "Enable examples" OFF)

Expand All @@ -45,3 +51,5 @@ endif (ENABLE_TESTS)
if (ENABLE_EXAMPLES)
add_subdirectory (examples)
endif (ENABLE_EXAMPLES)

configure_file (include/thallium/config.hpp.in ${CMAKE_BINARY_DIR}/include/thallium/config.hpp @ONLY)
1 change: 1 addition & 0 deletions include/thallium.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define __THALLIUM_HPP

#include <margo.h>
#include <thallium/config.hpp>
#include <thallium/abt.hpp>
#include <thallium/anonymous.hpp>
#include <thallium/bulk_mode.hpp>
Expand Down
6 changes: 5 additions & 1 deletion include/thallium/config.hpp.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@

#cmakedefine THALLIUM_USE_CEREAL
#define THALLIUM_VERSION_MAJOR @THALLIUM_VERSION_MAJOR@
#define THALLIUM_VERSION_MINOR @THALLIUM_VERSION_MINOR@
#define THALLIUM_VERSION_PATCH @THALLIUM_VERSION_PATCH@
#define THALLIUM_VERSION "@THALLIUM_VERSION@"
#define THALLIUM_VERSION_NUM (THALLIUM_VERSION_MAJOR*100000 + THALLIUM_VERSION_MINOR*100 + THALLIUM_VERSION_PATCH)
11 changes: 2 additions & 9 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,6 @@ include (CMakePackageConfigHelpers)
# where to install files for "find_package"
set (thallium-pkg "share/cmake/thallium")

#
# library version set here (e.g. for shared libs).
#
set (THALLIUM_VERSION_MAJOR 0)
set (THALLIUM_VERSION_MINOR 14)
set (THALLIUM_VERSION_PATCH 0)
set (thallium-vers "${THALLIUM_VERSION_MAJOR}.${THALLIUM_VERSION_MINOR}")
set (THALLIUM_VERSION "${thallium-vers}.${THALLIUM_VERSION_PATCH}")

add_library (thallium INTERFACE)
target_link_libraries (thallium INTERFACE PkgConfig::margo cereal::cereal)
target_include_directories (thallium INTERFACE $<INSTALL_INTERFACE:include>)
Expand Down Expand Up @@ -68,3 +59,5 @@ install (DIRECTORY ../include/thallium
FILES_MATCHING PATTERN "*.hpp")
install (FILES ../include/thallium.hpp
DESTINATION include)
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/../include/thallium/config.hpp
DESTINATION include/thallium)

0 comments on commit c792c92

Please sign in to comment.