Fix and clean up CMake files

This commit is contained in:
Janek Bevendorff 2017-02-16 00:44:20 +01:00
parent e9e92d0892
commit 7df6d27900
3 changed files with 36 additions and 36 deletions

View File

@ -216,7 +216,7 @@ if(UNIX)
endif()
endif()
include_directories(SYSTEM ${GCRYPT_INCLUDE_DIR} ${MHD_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR})
include_directories(SYSTEM ${GCRYPT_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR})
include(FeatureSummary)

View File

@ -149,8 +149,8 @@ set(keepassx_FORMS
add_feature_info(KeePassHTTP WITH_XC_HTTP "KeePassHTTP support for ChromeIPass and PassIFox")
add_feature_info(Autotype WITH_XC_AUTOTYPE "Auto-type passwords in Input fields")
add_subdirectory(http)
if(WITH_XC_HTTP)
add_subdirectory(http)
set(keepasshttp_LIB keepasshttp)
endif()
@ -186,20 +186,13 @@ target_link_libraries(autotype Qt5::Core Qt5::Widgets)
set(autotype_LIB autotype)
add_library(keepassx_core STATIC ${keepassx_SOURCES})
set_target_properties(keepassx_core PROPERTIES COMPILE_DEFINITIONS KEEPASSX_BUILDING_CORE)
target_link_libraries(keepassx_core zxcvbn ${keepasshttp_LIB} ${autotype_LIB}
Qt5::Core
Qt5::Concurrent
Qt5::Widgets
Qt5::Network)
if (UNIX AND NOT APPLE)
target_link_libraries(keepassx_core Qt5::DBus)
endif()
add_executable(${PROGNAME} WIN32 MACOSX_BUNDLE ${keepassx_SOURCES_MAINEXE})
target_link_libraries(${PROGNAME}
keepassx_core
set_target_properties(keepassx_core PROPERTIES COMPILE_DEFINITIONS KEEPASSX_BUILDING_CORE)
target_link_libraries(keepassx_core
${keepasshttp_LIB}
${autotype_LIB}
zxcvbn
qhttp
Qt5::Core
Qt5::Concurrent
Qt5::Widgets
@ -207,7 +200,12 @@ target_link_libraries(${PROGNAME}
${GCRYPT_LIBRARIES}
${GPGERROR_LIBRARIES}
${ZLIB_LIBRARIES})
if (UNIX AND NOT APPLE)
target_link_libraries(keepassx_core Qt5::DBus)
endif()
add_executable(${PROGNAME} WIN32 MACOSX_BUNDLE ${keepassx_SOURCES_MAINEXE})
target_link_libraries(${PROGNAME} keepassx_core)
set_target_properties(${PROGNAME} PROPERTIES ENABLE_EXPORTS ON)

View File

@ -1,24 +1,26 @@
project(keepasshttp)
set(keepasshttp_SOURCES
AccessControlDialog.cpp
EntryConfig.cpp
HttpPasswordGeneratorWidget.cpp
HttpSettings.cpp
OptionDialog.cpp
Protocol.cpp
Server.cpp
Service.cpp
)
set(keepasshttp_FORMS
AccessControlDialog.ui
HttpPasswordGeneratorWidget.ui
OptionDialog.ui
)
qt5_wrap_ui(keepasshttp_SOURCES ${keepasshttp_FORMS})
add_subdirectory(qhttp)
add_library(keepasshttp STATIC ${keepasshttp_SOURCES})
target_link_libraries(keepasshttp qhttp Qt5::Core Qt5::Concurrent Qt5::Widgets Qt5::Network)
if(WITH_XC_HTTP)
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
set(keepasshttp_SOURCES
AccessControlDialog.cpp
EntryConfig.cpp
HttpPasswordGeneratorWidget.cpp
HttpSettings.cpp
OptionDialog.cpp
Protocol.cpp
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)
endif()