mirror of
https://github.com/Z3Prover/z3
synced 2025-06-20 21:03:39 +00:00
clean up CMake code (#5182)
* CMake: simplify FindGMP.cmake Remove printing of all the different variables, and let FPHSA output the library name. Add an imported target, which bundles the library and the include directories for easier usage. * fix build: vector::c_ptr() now is vector::data() * CMake: use Threads::Threads imported module Otherwise the setting of THREADS_PREFER_PTHREAD_FLAG has no effect. * CMake: remove needless policy setting The minimum required version is CMake 3.4, where these policies are already set to new because they were introduced earlier. * CMake: remove needless variable expansion
This commit is contained in:
parent
ce96182746
commit
7f8e2a9f75
13 changed files with 69 additions and 94 deletions
|
@ -26,7 +26,7 @@ function(add_git_dir_dependency GIT_DOT_FILE SUCCESS_VAR)
|
|||
# git directory
|
||||
file(READ "${GIT_DOT_FILE}" GIT_DOT_FILE_DATA LIMIT 512)
|
||||
string(STRIP "${GIT_DOT_FILE_DATA}" GIT_DOT_FILE_DATA_STRIPPED)
|
||||
if ("${GIT_DOT_FILE_DATA_STRIPPED}" MATCHES "^gitdir:[ ]*(.+)$")
|
||||
if (GIT_DOT_FILE_DATA_STRIPPED MATCHES "^gitdir:[ ]*(.+)$")
|
||||
# Git worktree
|
||||
message(STATUS "Found git worktree")
|
||||
set(GIT_WORKTREE_DIR "${CMAKE_MATCH_1}")
|
||||
|
@ -75,7 +75,7 @@ function(add_git_dir_dependency GIT_DOT_FILE SUCCESS_VAR)
|
|||
file(READ "${GIT_HEAD_FILE}" GIT_HEAD_DATA LIMIT 128)
|
||||
string(STRIP "${GIT_HEAD_DATA}" GIT_HEAD_DATA_STRIPPED)
|
||||
|
||||
if ("${GIT_HEAD_DATA_STRIPPED}" MATCHES "^ref:[ ]*(.+)$")
|
||||
if (GIT_HEAD_DATA_STRIPPED MATCHES "^ref:[ ]*(.+)$")
|
||||
# HEAD points at a reference.
|
||||
set(GIT_REF "${CMAKE_MATCH_1}")
|
||||
if (EXISTS "${GIT_DIR}/${GIT_REF}")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue