Skip to content

Commit

Permalink
🚸 improved version handling
Browse files Browse the repository at this point in the history
Signed-off-by: burgholzer <burgholzer@me.com>
  • Loading branch information
burgholzer committed Jan 26, 2024
1 parent 647f7c3 commit 5de6797
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ option(BUILD_MQT_CORE_TESTS "Also build tests for the MQT Core project" ${MQT_CO

# try to determine the project version
include(cmake/GetVersion.cmake)
get_version()
get_mqt_core_version()

project(
mqt-core
Expand Down
8 changes: 7 additions & 1 deletion cmake/GetVersion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
# * MQT_CORE_VERSION_FOUND (TRUE if version was found, FALSE otherwise)

function(version_from_skbuild)
if(NOT MQT_CORE_MASTER_PROJECT)
message(VERBOSE
"Not the master project. Cannot determine project version from scikit-build-core.")
return()
endif()

if(NOT DEFINED SKBUILD_PROJECT_VERSION)
message(
VERBOSE
Expand Down Expand Up @@ -185,7 +191,7 @@ function(version_from_package)
CACHE INTERNAL "MQT_CORE_VERSION_FOUND")
endfunction()

function(get_version)
function(get_mqt_core_version)
# Initialize as not found
set(MQT_CORE_VERSION_FOUND
FALSE
Expand Down

0 comments on commit 5de6797

Please sign in to comment.