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@45: set(M13UI_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 andre@33: set(M13UI_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@62: generate_cppcheck(SOURCES ${CINST_SOURCES} ${M13UI_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 andre@33: # M13UI_SOURCES in the test subdirectory. andre@33: set(M13UI_SOURCES_WITH_RESOURCES ${M13UI_SOURCES}) andre@33: qt5_add_resources(M13UI_SOURCES_WITH_RESOURCES ${M13UI_RESOURCES}) andre@33: add_executable(m13ui ${M13UI_SOURCES_WITH_RESOURCES}) andre@33: aheinecke@39: target_link_libraries(m13ui Qt5::Widgets aheinecke@109: m13_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 rrenkert@327: m13_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@124: install(TARGETS m13ui DESTINATION bin) rrenkert@333: install(TARGETS administrator DESTINATION bin)