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()
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) 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(KeePassHTTP WITH_XC_HTTP "KeePassHTTP support for ChromeIPass and PassIFox")
add_feature_info(Autotype WITH_XC_AUTOTYPE "Auto-type passwords in Input fields") add_feature_info(Autotype WITH_XC_AUTOTYPE "Auto-type passwords in Input fields")
add_subdirectory(http)
if(WITH_XC_HTTP) if(WITH_XC_HTTP)
add_subdirectory(http)
set(keepasshttp_LIB keepasshttp) set(keepasshttp_LIB keepasshttp)
endif() endif()
@ -186,20 +186,13 @@ target_link_libraries(autotype Qt5::Core Qt5::Widgets)
set(autotype_LIB autotype) set(autotype_LIB autotype)
add_library(keepassx_core STATIC ${keepassx_SOURCES}) 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}) set_target_properties(keepassx_core PROPERTIES COMPILE_DEFINITIONS KEEPASSX_BUILDING_CORE)
target_link_libraries(${PROGNAME} target_link_libraries(keepassx_core
keepassx_core ${keepasshttp_LIB}
${autotype_LIB}
zxcvbn zxcvbn
qhttp
Qt5::Core Qt5::Core
Qt5::Concurrent Qt5::Concurrent
Qt5::Widgets Qt5::Widgets
@ -207,7 +200,12 @@ target_link_libraries(${PROGNAME}
${GCRYPT_LIBRARIES} ${GCRYPT_LIBRARIES}
${GPGERROR_LIBRARIES} ${GPGERROR_LIBRARIES}
${ZLIB_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) 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_subdirectory(qhttp)
add_library(keepasshttp STATIC ${keepasshttp_SOURCES}) if(WITH_XC_HTTP)
target_link_libraries(keepasshttp qhttp Qt5::Core Qt5::Concurrent Qt5::Widgets Qt5::Network) 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()