2018-07-06 10:53:13 +02:00
|
|
|
cmake_minimum_required(VERSION 3.8)
|
2018-07-03 16:35:00 +02:00
|
|
|
|
2018-08-07 12:52:24 +02:00
|
|
|
project(kima2 VERSION 0.9.0)
|
2018-07-05 16:29:43 +02:00
|
|
|
|
2018-07-06 13:29:53 +02:00
|
|
|
set(CMAKE_MODULE_PATH "${CMAKE_HOME_DIRECTORY}/cmake" ${CMAKE_MODULE_PATH})
|
|
|
|
|
2018-07-06 10:53:13 +02:00
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
|
2018-08-07 12:52:24 +02:00
|
|
|
#include(InstallRequiredSystemLibraries)
|
|
|
|
|
2018-07-03 16:35:00 +02:00
|
|
|
if(MSVC)
|
|
|
|
add_compile_options(/W4 /WX)
|
|
|
|
else()
|
2018-07-20 11:52:26 +02:00
|
|
|
add_compile_options(-Wall -Wextra -pedantic -Woverloaded-virtual -Wredundant-decls -Wshadow)
|
2018-07-03 16:35:00 +02:00
|
|
|
endif()
|
2018-07-05 16:29:43 +02:00
|
|
|
|
2018-07-30 16:39:33 +02:00
|
|
|
configure_file(config.h.in ${PROJECT_BINARY_DIR}/config.h)
|
|
|
|
|
2018-07-05 16:40:45 +02:00
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
|
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
|
|
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
2018-07-05 16:29:43 +02:00
|
|
|
|
2018-07-09 16:40:22 +02:00
|
|
|
add_subdirectory(src)
|
2018-07-11 16:08:36 +02:00
|
|
|
|
2018-07-11 16:11:25 +02:00
|
|
|
if(NOT CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE MATCHES Debug)
|
2018-07-11 16:08:36 +02:00
|
|
|
include(CTest)
|
|
|
|
enable_testing()
|
|
|
|
add_subdirectory(test)
|
|
|
|
endif()
|
|
|
|
|
2018-08-07 12:52:24 +02:00
|
|
|
|
|
|
|
# CPack
|
|
|
|
|
|
|
|
set(CPACK_PACKAGE_EXECUTABLES "kima2" "KIMA2")
|
|
|
|
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Ein kleines Kassenprogramm für Kindersachenmärkte")
|
2018-08-07 13:45:33 +02:00
|
|
|
set(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/misc\\\\kima2.bmp")
|
2018-08-07 14:47:52 +02:00
|
|
|
set(CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}/misc\\\\kima2.ico")
|
2018-08-07 15:16:35 +02:00
|
|
|
set(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\kima2.exe")
|
2018-08-07 12:52:24 +02:00
|
|
|
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
|
|
|
|
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
|
|
|
|
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
|
|
|
|
set(CPACK_PACKAGE_VENDOR "Martin Brodbeck")
|
|
|
|
set(CPACK_PACKAGE_CONTACT "Martin Brodbeck <info@rustysoft.de>")
|
|
|
|
set(CPACK_SOURCE_IGNORE_FILES "/.git/;/.vscode")
|
|
|
|
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
|
2018-08-07 13:51:10 +02:00
|
|
|
set(CPACK_PACKAGE_INSTALL_DIRECTORY "KIMA2")
|
2018-08-07 12:52:24 +02:00
|
|
|
|
|
|
|
if (WIN32 AND NOT UNIX)
|
|
|
|
set(CPACK_GENERATOR "NSIS;ZIP")
|
2018-08-07 16:06:01 +02:00
|
|
|
#set(CPACK_CREATE_DESKTOP_LINKS "bin/kima2")
|
2018-08-07 16:14:47 +02:00
|
|
|
install(FILES "${CMAKE_SOURCE_DIR}/manual/Benutzerhandbuch.pdf"
|
2018-08-07 16:39:46 +02:00
|
|
|
"${CMAKE_SOURCE_DIR}/misc/kima2.ico"
|
|
|
|
DESTINATION bin)
|
2018-08-07 16:14:47 +02:00
|
|
|
set(CPACK_NSIS_MENU_LINKS "bin\\\\Benutzerhandbuch.pdf" "Handbuch")
|
2018-08-07 12:52:24 +02:00
|
|
|
else(WIN32 AND NOT UNIX)
|
|
|
|
set(CPACK_SOURCE_GENERATOR "TBZ2")
|
|
|
|
set(CPACK_GENERATOR "RPM;DEB")
|
|
|
|
set(CPACK_STRIP_FILES "bin/kima2")
|
|
|
|
set(CPACK_SOURCE_STRIP_FILES "")
|
2018-08-07 17:33:17 +02:00
|
|
|
install(FILES ${CMAKE_SOURCE_DIR}/misc/kima2.desktop DESTINATION share/applications)
|
2018-08-07 16:14:47 +02:00
|
|
|
install(FILES "${CMAKE_SOURCE_DIR}/manual/Benutzerhandbuch.pdf"
|
2018-08-07 17:45:01 +02:00
|
|
|
DESTINATION share/${PROJECT_NAME})
|
2018-08-07 17:33:17 +02:00
|
|
|
install(FILES "${CMAKE_SOURCE_DIR}/misc/kima2.svg"
|
|
|
|
DESTINATION share/icons/hicolor/scalable/apps)
|
2018-08-07 12:52:24 +02:00
|
|
|
endif (WIN32 AND NOT UNIX)
|
|
|
|
|
2018-08-07 13:17:30 +02:00
|
|
|
if( MINGW )
|
|
|
|
message( STATUS " Installing system-libraries: MinGW DLLs." )
|
|
|
|
get_filename_component( MINGW_PATH ${CMAKE_CXX_COMPILER} PATH )
|
2018-08-07 13:29:56 +02:00
|
|
|
set( CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
|
|
|
|
${MINGW_PATH}/libstdc++-6.dll
|
|
|
|
${MINGW_PATH}/libgcc_s_seh-1.dll
|
|
|
|
${MINGW_PATH}/Qt5Core.dll
|
|
|
|
${MINGW_PATH}/Qt5Gui.dll
|
|
|
|
${MINGW_PATH}/Qt5Widgets.dll
|
|
|
|
${MINGW_PATH}/Qt5PrintSupport.dll
|
|
|
|
${MINGW_PATH}/libwinpthread-1.dll
|
|
|
|
${MINGW_PATH}/libsqlite3-0.dll
|
|
|
|
${MINGW_PATH}/libusb-1.0.dll
|
|
|
|
${MINGW_PATH}/libxlnt.dll
|
|
|
|
${MINGW_PATH}/libicuuc61.dll
|
|
|
|
${MINGW_PATH}/libicuin61.dll
|
|
|
|
${MINGW_PATH}/libicudt61.dll
|
|
|
|
${MINGW_PATH}/libjsoncpp-20.dll
|
|
|
|
${MINGW_PATH}/libpcre2-16-0.dll
|
|
|
|
${MINGW_PATH}/zlib1.dll
|
|
|
|
${MINGW_PATH}/libharfbuzz-0.dll
|
|
|
|
${MINGW_PATH}/libpng16-16.dll
|
|
|
|
${MINGW_PATH}/libfreetype-6.dll
|
2018-08-07 13:38:21 +02:00
|
|
|
${MINGW_PATH}/libglib-2.0-0.dll
|
2018-08-07 13:29:56 +02:00
|
|
|
${MINGW_PATH}/libgraphite2.dll
|
|
|
|
${MINGW_PATH}/libbz2-1.dll
|
|
|
|
${MINGW_PATH}/libintl-8.dll
|
|
|
|
${MINGW_PATH}/libpcre-1.dll
|
2018-08-07 14:35:27 +02:00
|
|
|
${MINGW_PATH}/libiconv-2.dll)
|
|
|
|
install(FILES ${MINGW_PATH}/../share/qt5/plugins/platforms/qwindows.dll
|
|
|
|
DESTINATION bin/platforms)
|
|
|
|
install(FILES ${MINGW_PATH}/../share/qt5/translations/qtbase_de.qm
|
2018-08-07 14:39:54 +02:00
|
|
|
${MINGW_PATH}/../share/qt5/translations/qt_de.qm
|
|
|
|
${MINGW_PATH}/../share/qt5/translations/qt_help_de.qm
|
2018-08-07 14:44:36 +02:00
|
|
|
${MINGW_PATH}/../share/qt5/translations/qtmultimedia_de.qm
|
|
|
|
${MINGW_PATH}/../share/qt5/translations/qtquick1_de.qm
|
|
|
|
${MINGW_PATH}/../share/qt5/translations/qtscript_de.qm
|
|
|
|
${MINGW_PATH}/../share/qt5/translations/qtxmlpatterns_de.qm
|
2018-08-07 14:35:27 +02:00
|
|
|
DESTINATION bin/translations)
|
2018-08-07 13:17:30 +02:00
|
|
|
endif( MINGW )
|
2018-08-07 12:52:24 +02:00
|
|
|
|
2018-08-07 13:17:30 +02:00
|
|
|
include(InstallRequiredSystemLibraries)
|
2018-08-07 17:33:17 +02:00
|
|
|
include(CPack)
|