Skip to content

Commit

Permalink
try 24
Browse files Browse the repository at this point in the history
  • Loading branch information
loriab committed Jan 16, 2024
1 parent 6a8deb5 commit 7804e9f
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ include(DynamicVersion)
dynamic_version(
PROJECT_PREFIX Libint2Compiler_
GIT_ARCHIVAL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/.git_archival.txt
VERSION_FULL_MODE POST
OUTPUT_COMMIT LibintRepository_COMMIT
OUTPUT_VERSION LibintRepository_VERSION
OUTPUT_DESCRIBE LibintRepository_DESCRIBE
Expand Down
18 changes: 11 additions & 7 deletions cmake/modules/int_versions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,23 @@

# <<< Sortable Version >>>

message(DEBUG "LibintRepository_VERSION ${LibintRepository_VERSION}")
message(DEBUG "LibintRepository_COMMIT ${LibintRepository_COMMIT}")
message(DEBUG "LibintRepository_DISTANCE ${LibintRepository_DISTANCE}")
message(DEBUG "LibintRepository_DESCRIBE ${LibintRepository_DESCRIBE}")
message(DEBUG "LibintRepository_VERSION ${LibintRepository_VERSION}")
message(DEBUG "LibintRepository_VERSION_FULL ${LibintRepository_VERSION_FULL}")
message(DEBUG "LibintRepository_COMMIT ${LibintRepository_COMMIT}")
message(DEBUG "LibintRepository_SHORT_HASH ${LibintRepository_SHORT_HASH}")
message(DEBUG "LibintRepository_DISTANCE ${LibintRepository_DISTANCE}")
message(DEBUG "LibintRepository_DESCRIBE ${LibintRepository_DESCRIBE}")

if (LibintRepository_DISTANCE STREQUAL "0")
set(LIBINT_SORTABLE_VERSION "${LibintRepository_VERSION}")
else()
set(LIBINT_SORTABLE_VERSION "${LibintRepository_VERSION}.post${LibintRepository_DISTANCE}")
endif()

string(SUBSTRING ${LibintRepository_COMMIT} 0 7 LIBINT_GIT_COMMIT)
message(DEBUG "LIBINT_GIT_COMMIT ${LIBINT_GIT_COMMIT}")
# short hash from DynVer is variable length from `git describe`.
# * use below for fixed length
# string(SUBSTRING ${LibintRepository_COMMIT} 0 7 LIBINT_GIT_COMMIT)
message(DEBUG "LIBINT_GIT_COMMIT ${LibintRepository_SHORT_HASH}")

# Below goes into BibTeX citation. Currently year of export. For year of tag, parse:
# `git show -s --no-notes --date=short --pretty='%cd' v2.7.2` responds: 2022-06-20
Expand All @@ -52,7 +56,7 @@ else()
set(LIBINT_EXT_VERSION ${LIBINT_VERSION})
endif()

message(STATUS "Version: Full ${LIBINT_EXT_VERSION} Numeric ${LIBINT_VERSION} Sortable ${LIBINT_SORTABLE_VERSION}")
message(STATUS "Version: Full ${LIBINT_EXT_VERSION} Numeric ${LIBINT_VERSION} Sortable ${LIBINT_SORTABLE_VERSION} SCM ${LibintRepository_VERSION_FULL}")

if (NOT(LibintRepository_VERSION STREQUAL LIBINT_VERSION))
message(AUTHOR_WARNING
Expand Down
11 changes: 9 additions & 2 deletions src/lib/libint/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ configure_file(
add_custom_command(
OUTPUT
${EXPORT_STAGE_DIR}/CMakeLists.txt
${EXPORT_STAGE_DIR}/include/libint2/libint2_params.h
${EXPORT_STAGE_DIR}/include/libint2_params.h
${EXPORT_STAGE_DIR}/include/HRRPart0bra0ket0pp.h
${EXPORT_STAGE_DIR}/src/HRRPart0bra0ket0pp.cc
COMMAND ${CMAKE_COMMAND}
Expand Down Expand Up @@ -181,10 +181,17 @@ else()
-DCMAKE_C_COMPILER_ARG1:STRING=${CMAKE_C_COMPILER_ARG1}
-DCMAKE_PREFIX_PATH:STRING=${CMAKE_PREFIX_PATH}
TEST_COMMAND ""
STEP_TARGETS build install
USES_TERMINAL_CONFIGURE TRUE
USES_TERMINAL_BUILD TRUE
USES_TERMINAL_INSTALL TRUE
STEP_TARGETS
build
install
)
ExternalProject_Get_property(library BINARY_DIR)

# instead of running tests by default, replicate check-libint2 target here
# and use it to invoke library's check-libint2 target
if (BUILD_TESTING)
include(AddCustomTargetSubproject)
add_custom_target_subproject(
Expand Down
2 changes: 1 addition & 1 deletion src/lib/libint/CMakeLists.txt.export
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ if (LIBINT2_REQUIRE_CXX_API_COMPILED)
target_link_libraries (
int-cxx-obj
PRIVATE
Eigen3::Eigen #libint-Eigen3
Eigen3::Eigen
$<$<TARGET_EXISTS:Boost::headers>:Boost::headers>
)

Expand Down

0 comments on commit 7804e9f

Please sign in to comment.