-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️ Use
FetchContent
and revamp CMake structure (#81)
This PR brings some updates to the overall CMake project organization.
- Loading branch information
Showing
10 changed files
with
120 additions
and
93 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,51 @@ | ||
# 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. Some targets will not be available") | ||
endif() | ||
|
||
set(PLOG_VERSION | ||
1.1.10 | ||
CACHE STRING "Plog version") | ||
set(PLOG_URL https://github.com/SergiusTheBest/plog/archive/refs/tags/${PLOG_VERSION}.tar.gz) | ||
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.24) | ||
FetchContent_Declare(plog URL ${PLOG_URL} FIND_PACKAGE_ARGS ${PLOG_VERSION}) | ||
list(APPEND FETCH_PACKAGES plog) | ||
else() | ||
find_package(plog ${PLOG_VERSION} QUIET) | ||
if(NOT plog_FOUND) | ||
FetchContent_Declare(plog URL ${PLOG_URL}) | ||
list(APPEND FETCH_PACKAGES plog) | ||
endif() | ||
endif() | ||
|
||
if(BUILD_LB_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() | ||
|
||
# Make all declared dependencies available. | ||
FetchContent_MakeAvailable(${FETCH_PACKAGES}) | ||
|
||
set_target_properties(plog PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES | ||
$<TARGET_PROPERTY:plog,INTERFACE_INCLUDE_DIRECTORIES>) |
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,7 @@ | ||
#include <iostream> | ||
#include <z3.h> | ||
|
||
int main() { | ||
std::cout << Z3_get_full_version(); | ||
return 0; | ||
} |
Submodule googletest
deleted from
f8d7d7
Submodule plog
deleted from
199734
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