Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
e23b8b44
Unverified
Commit
e23b8b44
authored
Mar 06, 2020
by
Edward Thomson
Committed by
GitHub
Mar 06, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5422 from pks-t/pks/cmake-booleans
CMake booleans
parents
8eb1fc36
d8e71cb2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
1 deletions
+30
-1
cmake/Modules/SanitizeBool.cmake
+20
-0
cmake/Modules/SelectGSSAPI.cmake
+3
-0
cmake/Modules/SelectHTTPSBackend.cmake
+3
-0
cmake/Modules/SelectHashes.cmake
+3
-0
src/CMakeLists.txt
+1
-1
No files found.
cmake/Modules/SanitizeBool.cmake
0 → 100644
View file @
e23b8b44
FUNCTION
(
SanitizeBool VAR
)
STRING
(
TOLOWER
"
${${
VAR
}}
"
VALUE
)
IF
(
VALUE STREQUAL
"on"
)
SET
(
${
VAR
}
"ON"
PARENT_SCOPE
)
ELSEIF
(
VALUE STREQUAL
"yes"
)
SET
(
${
VAR
}
"ON"
PARENT_SCOPE
)
ELSEIF
(
VALUE STREQUAL
"true"
)
SET
(
${
VAR
}
"ON"
PARENT_SCOPE
)
ELSEIF
(
VALUE STREQUAL
"1"
)
SET
(
${
VAR
}
"ON"
PARENT_SCOPE
)
ELSEIF
(
VALUE STREQUAL
"off"
)
SET
(
${
VAR
}
"OFF"
PARENT_SCOPE
)
ELSEIF
(
VALUE STREQUAL
"no"
)
SET
(
${
VAR
}
"OFF"
PARENT_SCOPE
)
ELSEIF
(
VALUE STREQUAL
"false"
)
SET
(
${
VAR
}
"OFF"
PARENT_SCOPE
)
ELSEIF
(
VALUE STREQUAL
"0"
)
SET
(
${
VAR
}
"OFF"
PARENT_SCOPE
)
ENDIF
()
ENDFUNCTION
()
cmake/Modules/SelectGSSAPI.cmake
View file @
e23b8b44
...
...
@@ -2,12 +2,15 @@
# We try to find any packages our backends might use
INCLUDE
(
SanitizeBool
)
FIND_PACKAGE
(
GSSAPI
)
IF
(
CMAKE_SYSTEM_NAME MATCHES
"Darwin"
)
INCLUDE
(
FindGSSFramework
)
ENDIF
()
# Auto-select GSS backend
SanitizeBool
(
USE_GSSAPI
)
IF
(
USE_GSSAPI STREQUAL ON
)
IF
(
GSSFRAMEWORK_FOUND
)
SET
(
GSS_BACKEND
"GSS.framework"
)
...
...
cmake/Modules/SelectHTTPSBackend.cmake
View file @
e23b8b44
# Select the backend to use
INCLUDE
(
SanitizeBool
)
# We try to find any packages our backends might use
FIND_PACKAGE
(
OpenSSL
)
FIND_PACKAGE
(
mbedTLS
)
...
...
@@ -9,6 +11,7 @@ IF (CMAKE_SYSTEM_NAME MATCHES "Darwin")
ENDIF
()
# Auto-select TLS backend
SanitizeBool
(
USE_HTTPS
)
IF
(
USE_HTTPS STREQUAL ON
)
IF
(
SECURITY_FOUND
)
IF
(
SECURITY_HAS_SSLCREATECONTEXT
)
...
...
cmake/Modules/SelectHashes.cmake
View file @
e23b8b44
# Select a hash backend
INCLUDE
(
SanitizeBool
)
# USE_SHA1=CollisionDetection(ON)/HTTPS/Generic/OFF
SanitizeBool
(
USE_SHA1
)
IF
(
USE_SHA1 STREQUAL ON OR USE_SHA1 STREQUAL
"CollisionDetection"
)
SET
(
SHA1_BACKEND
"CollisionDetection"
)
ELSEIF
(
USE_SHA1 STREQUAL
"HTTPS"
)
...
...
src/CMakeLists.txt
View file @
e23b8b44
...
...
@@ -28,7 +28,7 @@ SET(LIB_INSTALL_DIR lib CACHE PATH "Where to install libraries to.")
SET
(
INCLUDE_INSTALL_DIR include CACHE PATH
"Where to install headers to."
)
# Enable tracing
IF
(
ENABLE_TRACE STREQUAL
"ON"
)
IF
(
ENABLE_TRACE
)
SET
(
GIT_TRACE 1
)
ENDIF
()
ADD_FEATURE_INFO
(
tracing GIT_TRACE
"tracing support"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment