Merge pull request #549 from keepassxreboot/hotfix/cmake_updates

Cleanup CMake files
This commit is contained in:
Janek Bevendorff 2017-05-07 00:56:41 +02:00 committed by GitHub
commit 278baaac80
5 changed files with 15 additions and 55 deletions

2
.gitignore vendored
View File

@ -4,3 +4,5 @@ release*/
.idea/
*.iml
*.kdev4
\.vscode/

View File

@ -25,6 +25,9 @@ cmake_minimum_required(VERSION 2.8.12)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
# Support Visual Studio Code
include(CMakeToolsHelpers OPTIONAL)
include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)
include(CheckCXXSourceCompiles)
@ -39,8 +42,13 @@ option(WITH_XC_AUTOTYPE "Include Auto-Type." ON)
option(WITH_XC_HTTP "Include KeePassHTTP and Custom Icon Downloads." OFF)
option(WITH_XC_YUBIKEY "Include YubiKey support." OFF)
set(KEEPASSXC_VERSION "2.1.4")
set(KEEPASSXC_VERSION_NUM "2.1.4")
# Process ui files automatically from source files
set(CMAKE_AUTOUIC ON)
set(KEEPASSXC_VERSION_MAJOR "2")
set(KEEPASSXC_VERSION_MINOR "1")
set(KEEPASSXC_VERSION_PATCH "4")
set(KEEPASSXC_VERSION "${KEEPASSXC_VERSION_MAJOR}.${KEEPASSXC_VERSION_MINOR}.${KEEPASSXC_VERSION_PATCH}")
if("${CMAKE_C_COMPILER}" MATCHES "clang$" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
set(CMAKE_COMPILER_IS_CLANG 1)
@ -154,7 +162,6 @@ if(MINGW)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--nxcompat -Wl,--dynamicbase")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--nxcompat -Wl,--dynamicbase")
endif()
link_libraries(ws2_32 wsock32)
endif()
if(APPLE OR MINGW)

View File

@ -1,9 +0,0 @@
find_path(MHD_INCLUDE_DIR microhttpd.h)
find_library(MHD_LIBRARIES microhttpd)
mark_as_advanced(MHD_LIBRARIES MHD_INCLUDE_DIR)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LibMicroHTTPD DEFAULT_MSG MHD_LIBRARIES MHD_INCLUDE_DIR)

View File

@ -141,32 +141,6 @@ set(keepassx_SOURCES_MAINEXE
main.cpp
)
set(keepassx_FORMS
gui/AboutDialog.ui
gui/ChangeMasterKeyWidget.ui
gui/CloneDialog.ui
gui/csvImport/CsvImportWidget.ui
gui/DatabaseOpenWidget.ui
gui/DatabaseSettingsWidget.ui
gui/CategoryListWidget.ui
gui/EditWidget.ui
gui/EditWidgetIcons.ui
gui/EditWidgetProperties.ui
gui/MainWindow.ui
gui/PasswordGeneratorWidget.ui
gui/SearchWidget.ui
gui/SettingsWidgetGeneral.ui
gui/SettingsWidgetSecurity.ui
gui/SetupTotpDialog.ui
gui/TotpDialog.ui
gui/WelcomeWidget.ui
gui/entry/EditEntryWidgetAdvanced.ui
gui/entry/EditEntryWidgetAutoType.ui
gui/entry/EditEntryWidgetHistory.ui
gui/entry/EditEntryWidgetMain.ui
gui/group/EditGroupWidgetMain.ui
)
add_feature_info(AutoType WITH_XC_AUTOTYPE "Automatic password typing")
add_feature_info(KeePassHTTP WITH_XC_HTTP "Browser integration compatible with ChromeIPass and PassIFox")
add_feature_info(YubiKey WITH_XC_YUBIKEY "YubiKey HMAC-SHA1 challenge-response")
@ -199,13 +173,11 @@ if(MINGW)
endif()
if(WITH_XC_YUBIKEY)
set(keepassx_SOURCES ${keepassx_SOURCES} keys/drivers/YubiKey.cpp)
list(APPEND keepassx_SOURCES keys/drivers/YubiKey.cpp)
else()
set(keepassx_SOURCES ${keepassx_SOURCES} keys/drivers/YubiKeyStub.cpp)
list(APPEND keepassx_SOURCES keys/drivers/YubiKeyStub.cpp)
endif()
qt5_wrap_ui(keepassx_SOURCES ${keepassx_FORMS})
add_library(zxcvbn STATIC zxcvbn/zxcvbn.cpp)
target_link_libraries(zxcvbn)
@ -233,11 +205,6 @@ if (UNIX AND NOT APPLE)
endif()
if(MINGW)
string(REPLACE "." ";" VERSION_LIST ${KEEPASSXC_VERSION})
list(GET VERSION_LIST 0 KEEPASSXC_VERSION_MAJOR)
list(GET VERSION_LIST 1 KEEPASSXC_VERSION_MINOR)
list(GET VERSION_LIST 2 KEEPASSXC_VERSION_PATCH)
include(GenerateProductVersion)
generate_product_version(
WIN32_ProductVersionFiles
@ -275,7 +242,7 @@ if(APPLE)
set(CPACK_DMG_VOLUME_NAME "${PROGNAME}")
set(CPACK_SYSTEM_NAME "OSX")
set(CPACK_STRIP_FILES ON)
set(CPACK_PACKAGE_FILE_NAME "${PROGNAME}-${KEEPASSXC_VERSION_NUM}")
set(CPACK_PACKAGE_FILE_NAME "${PROGNAME}-${KEEPASSXC_VERSION}")
include(CPack)
if(NOT DEFINED QT_BINARY_DIR)

View File

@ -13,13 +13,6 @@ if(WITH_XC_HTTP)
Server.cpp
Service.cpp
)
set(keepasshttp_FORMS
AccessControlDialog.ui
HttpPasswordGeneratorWidget.ui
OptionDialog.ui
)
qt5_wrap_ui(keepasshttp_SOURCES ${keepasshttp_FORMS})
add_library(keepasshttp STATIC ${keepasshttp_SOURCES})
target_link_libraries(keepasshttp qhttp Qt5::Core Qt5::Concurrent Qt5::Widgets Qt5::Network)