mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-04-03 20:47:37 +03:00
Reformat CMakeLists.txt files
This commit is contained in:
parent
0ca7fd369a
commit
77adbef401
13 changed files with 659 additions and 676 deletions
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue