-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Description This PR updates the mqt-core submodule and brings in some further advancements from #418. Specifically, it switches to using `FetchContent` for obtaining `mqt-core` (and `LogicBlocks`). Per default, it is pointed to the vendored submodule via an overridable CMake variable. ## Checklist: <!--- This checklist serves as a reminder of a couple of things that ensure your pull request will be merged swiftly. --> - [x] The pull request only contains commits that are related to it. - [x] I have added appropriate tests and documentation. - [x] I have made sure that all CI jobs on GitHub pass. - [x] The pull request introduces no new warnings and follows the project's style guidelines.
- Loading branch information
Showing
27 changed files
with
300 additions
and
227 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
# Declare all external dependencies and make sure that they are available. | ||
|
||
include(FetchContent) | ||
set(FETCH_PACKAGES "") | ||
|
||
# search for Z3 | ||
find_package(Z3 4.8.15) | ||
if(NOT Z3_FOUND) | ||
message(WARNING "Did not find Z3. Exact library and other depending target will not be available") | ||
endif() | ||
|
||
if(BUILD_MQT_QMAP_BINDINGS) | ||
if(NOT SKBUILD) | ||
# Manually detect the installed pybind11 package. | ||
execute_process( | ||
COMMAND "${Python_EXECUTABLE}" -m pybind11 --cmakedir | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
OUTPUT_VARIABLE pybind11_DIR) | ||
|
||
# Add the detected directory to the CMake prefix path. | ||
list(APPEND CMAKE_PREFIX_PATH "${pybind11_DIR}") | ||
endif() | ||
|
||
# add pybind11 library | ||
find_package(pybind11 CONFIG REQUIRED) | ||
endif() | ||
|
||
set(FETCHCONTENT_SOURCE_DIR_MQT-CORE | ||
${PROJECT_SOURCE_DIR}/extern/mqt-core | ||
CACHE | ||
PATH | ||
"Path to the source directory of the mqt-core library. This variable is used by FetchContent to download the library if it is not already available." | ||
) | ||
set(MQT_CORE_VERSION | ||
2.2.2 | ||
CACHE STRING "MQT Core version") | ||
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.24) | ||
FetchContent_Declare( | ||
mqt-core | ||
GIT_REPOSITORY https://github.com/cda-tum/mqt-core.git | ||
GIT_TAG v${MQT_CORE_VERSION} | ||
FIND_PACKAGE_ARGS ${MQT_CORE_VERSION}) | ||
list(APPEND FETCH_PACKAGES mqt-core) | ||
else() | ||
find_package(mqt-core ${MQT_CORE_VERSION} QUIET) | ||
if(NOT mqt-core_FOUND) | ||
FetchContent_Declare( | ||
mqt-core | ||
GIT_REPOSITORY https://github.com/cda-tum/mqt-core.git | ||
GIT_TAG v${MQT_CORE_VERSION}) | ||
list(APPEND FETCH_PACKAGES mqt-core) | ||
endif() | ||
endif() | ||
|
||
set(BUILD_LB_TESTS | ||
OFF | ||
CACHE BOOL "Build LogicBlocks tests") | ||
set(FETCHCONTENT_SOURCE_DIR_LOGICBLOCKS | ||
${PROJECT_SOURCE_DIR}/extern/LogicBlocks | ||
CACHE | ||
PATH | ||
"Path to the source directory of the LogicBlocks library. This variable is used by FetchContent to download the library if it is not already available." | ||
) | ||
FetchContent_Declare( | ||
LogicBlocks | ||
GIT_REPOSITORY https://github.com/cda-tum/LogicBlocks.git | ||
GIT_TAG main) | ||
list(APPEND FETCH_PACKAGES LogicBlocks) | ||
|
||
if(BUILD_MQT_QMAP_TESTS) | ||
set(gtest_force_shared_crt | ||
ON | ||
CACHE BOOL "" FORCE) | ||
set(GTEST_VERSION | ||
1.14.0 | ||
CACHE STRING "Google Test version") | ||
set(GTEST_URL https://github.com/google/googletest/archive/refs/tags/v${GTEST_VERSION}.tar.gz) | ||
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.24) | ||
FetchContent_Declare(googletest URL ${GTEST_URL} FIND_PACKAGE_ARGS ${GTEST_VERSION} NAMES GTest) | ||
list(APPEND FETCH_PACKAGES googletest) | ||
else() | ||
find_package(googletest ${GTEST_VERSION} QUIET NAMES GTest) | ||
if(NOT googletest_FOUND) | ||
FetchContent_Declare(googletest URL ${GTEST_URL}) | ||
list(APPEND FETCH_PACKAGES googletest) | ||
endif() | ||
endif() | ||
endif() | ||
|
||
if(BUILD_MQT_QMAP_BINDINGS) | ||
# add pybind11_json library | ||
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.24) | ||
FetchContent_Declare( | ||
pybind11_json | ||
GIT_REPOSITORY https://github.com/pybind/pybind11_json | ||
FIND_PACKAGE_ARGS) | ||
list(APPEND FETCH_PACKAGES pybind11_json) | ||
else() | ||
find_package(pybind11_json QUIET) | ||
if(NOT pybind11_json_FOUND) | ||
FetchContent_Declare(pybind11_json GIT_REPOSITORY https://github.com/pybind/pybind11_json) | ||
list(APPEND FETCH_PACKAGES pybind11_json) | ||
endif() | ||
endif() | ||
endif() | ||
|
||
# Make all declared dependencies available. | ||
FetchContent_MakeAvailable(${FETCH_PACKAGES}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Source: https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#can-i-do-make-uninstall-with-cmake | ||
|
||
if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt") | ||
message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt") | ||
endif() | ||
|
||
file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files) | ||
string(REGEX REPLACE "\n" ";" files "${files}") | ||
foreach(file ${files}) | ||
message(STATUS "Uninstalling $ENV{DESTDIR}${file}") | ||
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") | ||
exec_program( | ||
"@CMAKE_COMMAND@" ARGS | ||
"-E remove \"$ENV{DESTDIR}${file}\"" | ||
OUTPUT_VARIABLE rm_out | ||
RETURN_VALUE rm_retval) | ||
if(NOT "${rm_retval}" STREQUAL 0) | ||
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") | ||
endif() | ||
else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") | ||
message(STATUS "File $ENV{DESTDIR}${file} does not exist.") | ||
endif() | ||
endforeach() |
Submodule LogicBlocks
updated
8 files
+0 −4 | .github/codeql-config.yml | |
+0 −15 | .github/dependabot.yml | |
+3 −3 | .github/workflows/ci.yml | |
+1 −1 | .gitmodules | |
+7 −6 | .pre-commit-config.yaml | |
+3 −0 | README.md | |
+1 −1 | extern/googletest | |
+1 −1 | extern/plog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.