Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/keepassxreboot/keepassxc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorJanek Bevendorff <janek@jbev.net>2018-10-19 22:41:56 +0300
committerJanek Bevendorff <janek@jbev.net>2018-10-19 23:16:44 +0300
commit77adbef401caa02bd78e478cb0736063c0211b7c (patch)
treec281e35fe92bfbce5f048d6e45f16c81f1a93f75 /cmake
parent0ca7fd369aaa364ad437de694714b9488e5e5636 (diff)
Reformat CMakeLists.txt files
Diffstat (limited to 'cmake')
-rw-r--r--cmake/CLangFormat.cmake62
-rw-r--r--cmake/FindArgon2.cmake28
-rw-r--r--cmake/FindGcrypt.cmake2
3 files changed, 45 insertions, 47 deletions
diff --git a/cmake/CLangFormat.cmake b/cmake/CLangFormat.cmake
index 8c26db93b..481bba27b 100644
--- a/cmake/CLangFormat.cmake
+++ b/cmake/CLangFormat.cmake
@@ -14,45 +14,43 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(EXCLUDED_DIRS
- # third-party directories
- zxcvbn/
- streams/QtIOCompressor
- # objective-c directories
- autotype/mac
-)
+ # third-party directories
+ zxcvbn/
+ streams/QtIOCompressor
+ # objective-c directories
+ autotype/mac)
set(EXCLUDED_FILES
- # third-party files
- streams/qtiocompressor.cpp
- streams/qtiocompressor.h
- gui/KMessageWidget.h
- gui/KMessageWidget.cpp
- gui/MainWindowAdaptor.h
- gui/MainWindowAdaptor.cpp
- sshagent/bcrypt_pbkdf.cpp
- sshagent/blf.h
- sshagent/blowfish.c
- tests/modeltest.cpp
- tests/modeltest.h
- # objective-c files
- core/ScreenLockListenerMac.h
- core/ScreenLockListenerMac.cpp
-)
+ # third-party files
+ streams/qtiocompressor.cpp
+ streams/qtiocompressor.h
+ gui/KMessageWidget.h
+ gui/KMessageWidget.cpp
+ gui/MainWindowAdaptor.h
+ gui/MainWindowAdaptor.cpp
+ sshagent/bcrypt_pbkdf.cpp
+ sshagent/blf.h
+ sshagent/blowfish.c
+ tests/modeltest.cpp
+ tests/modeltest.h
+ # objective-c files
+ core/ScreenLockListenerMac.h
+ core/ScreenLockListenerMac.cpp)
file(GLOB_RECURSE ALL_SOURCE_FILES *.cpp *.h)
-foreach (SOURCE_FILE ${ALL_SOURCE_FILES})
- foreach (EXCLUDED_DIR ${EXCLUDED_DIRS})
+foreach(SOURCE_FILE ${ALL_SOURCE_FILES})
+ foreach(EXCLUDED_DIR ${EXCLUDED_DIRS})
string(FIND ${SOURCE_FILE} ${EXCLUDED_DIR} SOURCE_FILE_EXCLUDED)
- if (NOT ${SOURCE_FILE_EXCLUDED} EQUAL -1)
+ if(NOT ${SOURCE_FILE_EXCLUDED} EQUAL -1)
list(REMOVE_ITEM ALL_SOURCE_FILES ${SOURCE_FILE})
- endif ()
- endforeach ()
- foreach (EXCLUDED_FILE ${EXCLUDED_FILES})
- if (${SOURCE_FILE} MATCHES ".*${EXCLUDED_FILE}$")
+ endif()
+ endforeach()
+ foreach(EXCLUDED_FILE ${EXCLUDED_FILES})
+ if(${SOURCE_FILE} MATCHES ".*${EXCLUDED_FILE}$")
list(REMOVE_ITEM ALL_SOURCE_FILES ${SOURCE_FILE})
- endif ()
- endforeach ()
-endforeach ()
+ endif()
+ endforeach()
+endforeach()
add_custom_target(
format
diff --git a/cmake/FindArgon2.cmake b/cmake/FindArgon2.cmake
index bb2f5811d..766e659b3 100644
--- a/cmake/FindArgon2.cmake
+++ b/cmake/FindArgon2.cmake
@@ -14,21 +14,21 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
find_path(ARGON2_INCLUDE_DIR argon2.h)
-if (MINGW)
- # find static library on Windows, and redefine used symbols to
- # avoid definition name conflicts with libsodium
- find_library(ARGON2_SYS_LIBRARIES libargon2.a)
- message(STATUS "Patching libargon2...\n")
- execute_process(COMMAND objcopy
- --redefine-sym argon2_hash=libargon2_argon2_hash
- --redefine-sym _argon2_hash=_libargon2_argon2_hash
- --redefine-sym argon2_error_message=libargon2_argon2_error_message
- --redefine-sym _argon2_error_message=_libargon2_argon2_error_message
- ${ARGON2_SYS_LIBRARIES} ${CMAKE_BINARY_DIR}/libargon2_patched.a
- WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
- find_library(ARGON2_LIBRARIES libargon2_patched.a PATHS ${CMAKE_BINARY_DIR} NO_DEFAULT_PATH)
+if(MINGW)
+ # find static library on Windows, and redefine used symbols to
+ # avoid definition name conflicts with libsodium
+ find_library(ARGON2_SYS_LIBRARIES libargon2.a)
+ message(STATUS "Patching libargon2...\n")
+ execute_process(COMMAND objcopy
+ --redefine-sym argon2_hash=libargon2_argon2_hash
+ --redefine-sym _argon2_hash=_libargon2_argon2_hash
+ --redefine-sym argon2_error_message=libargon2_argon2_error_message
+ --redefine-sym _argon2_error_message=_libargon2_argon2_error_message
+ ${ARGON2_SYS_LIBRARIES} ${CMAKE_BINARY_DIR}/libargon2_patched.a
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
+ find_library(ARGON2_LIBRARIES libargon2_patched.a PATHS ${CMAKE_BINARY_DIR} NO_DEFAULT_PATH)
else()
- find_library(ARGON2_LIBRARIES argon2)
+ find_library(ARGON2_LIBRARIES argon2)
endif()
mark_as_advanced(ARGON2_LIBRARIES ARGON2_INCLUDE_DIR)
diff --git a/cmake/FindGcrypt.cmake b/cmake/FindGcrypt.cmake
index 077570462..59c6f473a 100644
--- a/cmake/FindGcrypt.cmake
+++ b/cmake/FindGcrypt.cmake
@@ -22,7 +22,7 @@ mark_as_advanced(GCRYPT_LIBRARIES GCRYPT_INCLUDE_DIR)
if(GCRYPT_INCLUDE_DIR AND EXISTS "${GCRYPT_INCLUDE_DIR}/gcrypt.h")
file(STRINGS "${GCRYPT_INCLUDE_DIR}/gcrypt.h" GCRYPT_H REGEX "^#define GCRYPT_VERSION \"[^\"]*\"$")
string(REGEX REPLACE "^.*GCRYPT_VERSION \"([0-9]+).*$" "\\1" GCRYPT_VERSION_MAJOR "${GCRYPT_H}")
- string(REGEX REPLACE "^.*GCRYPT_VERSION \"[0-9]+\\.([0-9]+).*$" "\\1" GCRYPT_VERSION_MINOR "${GCRYPT_H}")
+ string(REGEX REPLACE "^.*GCRYPT_VERSION \"[0-9]+\\.([0-9]+).*$" "\\1" GCRYPT_VERSION_MINOR "${GCRYPT_H}")
string(REGEX REPLACE "^.*GCRYPT_VERSION \"[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1" GCRYPT_VERSION_PATCH "${GCRYPT_H}")
set(GCRYPT_VERSION_STRING "${GCRYPT_VERSION_MAJOR}.${GCRYPT_VERSION_MINOR}.${GCRYPT_VERSION_PATCH}")
endif()