aheinecke@405: # Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik aheinecke@405: # Software engineering by Intevation GmbH aheinecke@405: # aheinecke@405: # This file is Free Software under the GNU GPL (v>=2) aheinecke@405: # and comes with ABSOLUTELY NO WARRANTY! aheinecke@405: # See LICENSE.txt for details. aheinecke@405: andre@33: include_directories(${Qt5Widgets_INCLUDE_DIRS}) aheinecke@57: include_directories(${POLARSSL_INCLUDE_DIR}) aheinecke@254: include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../common) andre@33: add_definitions(${Qt5Widgets_DEFINITIONS}) andre@33: andre@33: set(CERTIFICATELIST_SOURCES andre@33: ${CMAKE_CURRENT_SOURCE_DIR}/certificatelist.cpp andre@33: ${CMAKE_CURRENT_SOURCE_DIR}/certificate.cpp andre@33: ) andre@33: aheinecke@45: set(DOWNLOADER_SOURCES andre@33: ${CMAKE_CURRENT_SOURCE_DIR}/downloader.cpp aheinecke@45: ${CMAKE_CURRENT_SOURCE_DIR}/sslconnection.cpp aheinecke@45: ) aheinecke@45: aheinecke@407: set(TRUSTBRIDGE_SOURCES aheinecke@45: ${CMAKE_CURRENT_SOURCE_DIR}/mainwindow.cpp andre@33: ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp rrenkert@190: ${CMAKE_CURRENT_SOURCE_DIR}/helpdialog.cpp rrenkert@199: ${CMAKE_CURRENT_SOURCE_DIR}/aboutdialog.cpp rrenkert@211: ${CMAKE_CURRENT_SOURCE_DIR}/statusdialog.cpp rrenkert@266: ${CMAKE_CURRENT_SOURCE_DIR}/certificateitemdelegate.cpp rrenkert@273: ${CMAKE_CURRENT_SOURCE_DIR}/separatoritemdelegate.cpp aheinecke@257: ${CMAKE_CURRENT_SOURCE_DIR}/installwrapper.cpp andre@33: ${CERTIFICATELIST_SOURCES} aheinecke@45: ${DOWNLOADER_SOURCES} andre@33: ) andre@33: rrenkert@333: set(ADMINSTRATOR_SOURCES rrenkert@333: ${CMAKE_CURRENT_SOURCE_DIR}/administrator.cpp rrenkert@333: ${CMAKE_CURRENT_SOURCE_DIR}/administratorwindow.cpp rrenkert@335: ${CMAKE_CURRENT_SOURCE_DIR}/certificatetablemodel.cpp rrenkert@348: ${CMAKE_CURRENT_SOURCE_DIR}/certificatetabledelegate.cpp rrenkert@362: ${CMAKE_CURRENT_SOURCE_DIR}/createinstallerdialog.cpp rrenkert@368: ${CMAKE_CURRENT_SOURCE_DIR}/createcertlistdialog.cpp rrenkert@327: ${CERTIFICATELIST_SOURCES} rrenkert@327: ) rrenkert@327: andre@33: # Seperated to make it easier to include the sources in tests aheinecke@407: set(TRUSTBRIDGE_RESOURCES andre@33: ${CMAKE_CURRENT_SOURCE_DIR}/icons.qrc andre@33: ${CMAKE_CURRENT_SOURCE_DIR}/certs.qrc andre@33: ) andre@33: rrenkert@333: set(ADMINSTRATOR_RESOURCES rrenkert@327: ${CMAKE_CURRENT_SOURCE_DIR}/icons.qrc rrenkert@327: ) rrenkert@327: andre@33: if(UNIX) andre@33: # See: https://bugreports.qt-project.org/browse/QTBUG-35918 andre@33: # XCB_EXTRA_LIBS should be gotten automatically. andre@33: # The following list is taken from the .pri file andre@33: get_target_property(_loc Qt5::Widgets LOCATION) andre@33: get_filename_component(_qtpath ${_loc} PATH) aheinecke@107: aheinecke@107: if(NOT XKBCOMMON_LIB) aheinecke@107: # Hack on a hack to overwrite the xkbcommon libname. aheinecke@107: set(XKBCOMMON_LIB -lxkbcommon) aheinecke@108: endif() aheinecke@107: andre@33: set(XCB_EXTRA_LIBS andre@33: -L${_qtpath} andre@33: -lX11 -lX11-xcb -lXi -lxcb-render-util -lXrender -lSM -lICE -lxcb-render -ldbus-1 andre@33: -lxcb -lxcb-image -lxcb-icccm -lxcb-sync -lxcb-xfixes -lxcb-shm -lxcb-randr aheinecke@107: ${XKBCOMMON_LIB} -lxcb-shape -lxcb-keysyms -lQt5PlatformSupport andre@33: -lfreetype -lQt5DBus -lQt5Gui -ljpeg -lpng -lQt5Core andre@33: -lz -lm -ldl -lrt -lpthread) andre@33: andre@33: set(EXTRA_STATIC_LIBS -lz -lpthread -ldl -lpng -ljpeg andre@33: Qt5::QXcbIntegrationPlugin ${XCB_EXTRA_LIBS}) andre@33: andre@33: elseif(WIN32) andre@33: get_target_property(_loc Qt5::Widgets LOCATION) andre@33: get_filename_component(_qtpath ${_loc} PATH) andre@33: set(WINDOWS_EXTRA_LIBS andre@33: -L${_qtpath} andre@33: -lwinspool -lshlwapi -lfreetype -lbz2 -lpng16 andre@33: -lQt5PlatformSupport -lQt5Gui -lcomdlg32 -loleaut32 -limm32 -lwinmm andre@33: -lglu32 -lopengl32 -lgdi32 -ljpeg -lpng -lQt5Core -lole32 -luuid -lws2_32 andre@33: -ladvapi32 -lshell32 -luser32 -lkernel32 -lz -lsicuin -lsicuuc -lsicudt -lpcre16) andre@33: andre@33: set(EXTRA_STATIC_LIBS Qt5::QWindowsIntegrationPlugin ${WINDOWS_EXTRA_LIBS} -lwinhttp -lcrypt32) andre@33: endif() andre@33: andre@33: set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}") andre@33: aheinecke@407: generate_cppcheck(SOURCES ${CINST_SOURCES} ${TRUSTBRIDGE_SOURCES} TARGET_NAME m13_cppcheck) aheinecke@62: add_dependencies(static_check m13_cppcheck) andre@33: andre@33: # Adding resources here in an extra variable to enable reuse of aheinecke@407: # TRUSTBRIDGE_SOURCES in the test subdirectory. aheinecke@407: set(TRUSTBRIDGE_SOURCES_WITH_RESOURCES ${TRUSTBRIDGE_SOURCES}) aheinecke@407: qt5_add_resources(TRUSTBRIDGE_SOURCES_WITH_RESOURCES ${TRUSTBRIDGE_RESOURCES}) aheinecke@407: add_executable(trustbridge ${TRUSTBRIDGE_SOURCES_WITH_RESOURCES}) andre@33: aheinecke@407: target_link_libraries(trustbridge Qt5::Widgets aheinecke@408: trustbridge_common aheinecke@68: ${POLARSSL_LIBRARIES} andre@33: ${EXTRA_STATIC_LIBS} aheinecke@68: ${PROFILING_LIBS}) andre@33: rrenkert@333: set(ADMINSTRATOR_SOURCES_WITH_RESOURCES ${ADMINSTRATOR_SOURCES}) rrenkert@333: qt5_add_resources(ADMINSTRATOR_SOURCES_WITH_RESOURCES ${ADMINSTRATOR_RESOURCES}) rrenkert@333: add_executable(administrator ${ADMINSTRATOR_SOURCES_WITH_RESOURCES}) rrenkert@327: rrenkert@333: target_link_libraries(administrator Qt5::Widgets aheinecke@408: trustbridge_common rrenkert@327: ${POLARSSL_LIBRARIES} rrenkert@327: ${EXTRA_STATIC_LIBS} rrenkert@327: ${PROFILING_LIBS}) rrenkert@327: andre@33: # Tests andre@33: add_subdirectory(tests) aheinecke@124: aheinecke@407: install(TARGETS trustbridge DESTINATION bin) rrenkert@333: install(TARGETS administrator DESTINATION bin)