CMakeLists.txt 4.9 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1
project(krita)
Laurent Montel's avatar
Laurent Montel committed
2

3
include_directories(SYSTEM
Maximiliano Curia's avatar
Maximiliano Curia committed
4
    ${EIGEN3_INCLUDE_DIR}
5
    ${Vc_INCLUDE_DIR}
6 7 8 9
)

add_subdirectory( dtd )
add_subdirectory( data )
10
add_subdirectory( integration )
Boudewijn Rempt's avatar
Boudewijn Rempt committed
11
# Install the application icons following the the freedesktop icon theme spec
12
add_subdirectory( pics/app )
13

14
set(krita_SRCS main.cc)
15

Boudewijn Rempt's avatar
Boudewijn Rempt committed
16
# Set the application icon on the application
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
if (NOT APPLE)
    file(GLOB ICON_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/pics/app/*-apps-calligrakrita.png")
else()
    set(ICON_SRCS
         "${CMAKE_CURRENT_SOURCE_DIR}/pics/app/16-apps-calligrakrita.png"
         "${CMAKE_CURRENT_SOURCE_DIR}/pics/app/32-apps-calligrakrita.png"
         "${CMAKE_CURRENT_SOURCE_DIR}/pics/app/48-apps-calligrakrita.png"
         "${CMAKE_CURRENT_SOURCE_DIR}/pics/app/128-apps-calligrakrita.png"
         "${CMAKE_CURRENT_SOURCE_DIR}/pics/app/256-apps-calligrakrita.png"
         "${CMAKE_CURRENT_SOURCE_DIR}/pics/app/512-apps-calligrakrita.png"
         "${CMAKE_CURRENT_SOURCE_DIR}/pics/app/1024-apps-calligrakrita.png"
    )
endif() 
ecm_add_app_icon(krita_SRCS ICONS ${ICON_SRCS})

Boudewijn Rempt's avatar
Boudewijn Rempt committed
32
# Install the mimetype icons
33
ecm_install_icons(ICONS
34 35 36 37 38 39 40 41 42 43
    "${CMAKE_CURRENT_SOURCE_DIR}/pics/mimetypes/16-mimetypes-application-x-krita.png"
    "${CMAKE_CURRENT_SOURCE_DIR}/pics/mimetypes/22-mimetypes-application-x-krita.png"
    "${CMAKE_CURRENT_SOURCE_DIR}/pics/mimetypes/32-mimetypes-application-x-krita.png"
    "${CMAKE_CURRENT_SOURCE_DIR}/pics/mimetypes/48-mimetypes-application-x-krita.png"
    "${CMAKE_CURRENT_SOURCE_DIR}/pics/mimetypes/64-mimetypes-application-x-krita.png"
    "${CMAKE_CURRENT_SOURCE_DIR}/pics/mimetypes/128-mimetypes-application-x-krita.png"
    "${CMAKE_CURRENT_SOURCE_DIR}/pics/mimetypes/256-mimetypes-application-x-krita.png"
    "${CMAKE_CURRENT_SOURCE_DIR}/pics/mimetypes/512-mimetypes-application-x-krita.png"
    "${CMAKE_CURRENT_SOURCE_DIR}/pics/mimetypes/1024-mimetypes-application-x-krita.png"
    DESTINATION ${KDE_INSTALL_ICONDIR} THEME hicolor)
44

45 46 47 48 49 50 51
# separate listing, both used by Krita and KritaSketch
set(krita_QRCS
    ${CMAKE_SOURCE_DIR}/krita/krita.qrc
    ${CMAKE_SOURCE_DIR}/krita/pics/Breeze-dark/breeze-dark-icons.qrc
    ${CMAKE_SOURCE_DIR}/krita/pics/Breeze-light/breeze-light-icons.qrc
    ${CMAKE_SOURCE_DIR}/krita/pics/layerbox/layerbox-icons.qrc
    ${CMAKE_SOURCE_DIR}/krita/pics/layerbox/svg/layerbox-svg-icons.qrc
Timothée Giet's avatar
Timothée Giet committed
52
    ${CMAKE_SOURCE_DIR}/krita/pics/layers/layers-icons.qrc
53 54
    ${CMAKE_SOURCE_DIR}/krita/pics/misc-light/misc-light-icons.qrc
    ${CMAKE_SOURCE_DIR}/krita/pics/misc-dark/misc-dark-icons.qrc
55
    ${CMAKE_SOURCE_DIR}/krita/pics/paintops/paintops-icons.qrc
56 57 58 59 60 61 62 63 64
    ${CMAKE_SOURCE_DIR}/krita/pics/tools/SVG/16/tools-svg-16-icons.qrc
    ${CMAKE_SOURCE_DIR}/krita/pics/tool_transform/tool-transform-icons.qrc
    ${CMAKE_SOURCE_DIR}/krita/pics/svg/svg-icons.qrc
    ${CMAKE_SOURCE_DIR}/libs/flake/flake.qrc
    ${CMAKE_SOURCE_DIR}/libs/widgets/kritawidgets.qrc
    ${CMAKE_SOURCE_DIR}/pics/icons.qrc
    ${CMAKE_SOURCE_DIR}/krita/data/aboutdata/aboutdata.qrc
    ${CMAKE_SOURCE_DIR}/krita/data/shaders/shaders.qrc
    ${CMAKE_SOURCE_DIR}/krita/data/cursors/cursors.qrc
65
    CACHE INTERNAL "krita_QRCS"
66
)
67

68 69
qt5_add_resources(krita_SRCS ${krita_QRCS})

70
add_executable(krita ${krita_SRCS})
71
target_link_libraries(krita 
72
    PRIVATE
73 74 75 76 77 78 79 80
                      kritaui 
                      Qt5::Core
                      Qt5::Gui
                      Qt5::Widgets
                      Qt5::Xml
                      Qt5::Network
                      Qt5::PrintSupport
                      Qt5::Svg
Boudewijn Rempt's avatar
Boudewijn Rempt committed
81 82
                      Qt5::Concurrent)
if(HAVE_KCRASH)
83
    target_link_libraries(krita PRIVATE KF5::Crash)
Boudewijn Rempt's avatar
Boudewijn Rempt committed
84
endif()
Boudewijn Rempt's avatar
Boudewijn Rempt committed
85

86
if (APPLE)
Boudewijn Rempt's avatar
Boudewijn Rempt committed
87
    set_target_properties(krita PROPERTIES INSTALL_RPATH "@loader_path/../../../../lib;@loader_path/../lib;@loader_path/../Frameworks;@executable_path/../lib;@executable_path/../Frameworks")
88
    set_target_properties(krita PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.template)
89 90
    set_target_properties(krita PROPERTIES MACOSX_BUNDLE_GUI_IDENTIFIER "org.krita")
    set_target_properties(krita PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Krita")
91 92 93 94 95
    set_target_properties(krita PROPERTIES MACOSX_BUNDLE_ICON_FILE "krita_SRCS.icns")
    set_target_properties(krita PROPERTIES MACOSX_BUNDLE_LONG_VERSION_STRING ${KRITA_VERSION_STRING})
    set_target_properties(krita PROPERTIES MACOSX_BUNDLE_SHORT_VERSION_STRING ${KRITA_VERSION_STRING})
    set_target_properties(krita PROPERTIES MACOSX_BUNDLE_VERSION ${KRITA_VERSION_STRING})
    set_target_properties(krita PROPERTIES MACOSX_BUNDLE_COPYRIGHT "GNU Public License, V2 or, at your option, any later version.")
96
endif ()
97 98

install(TARGETS krita ${INSTALL_TARGETS_DEFAULT_ARGS})
99
install(PROGRAMS org.kde.krita.desktop  DESTINATION ${XDG_APPS_INSTALL_DIR})
Boudewijn Rempt's avatar
Boudewijn Rempt committed
100
install(FILES  krita.action kritamenu.action DESTINATION ${DATA_INSTALL_DIR}/krita/actions)
101
install(FILES  org.kde.krita.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR} )
102

103 104
install(DIRECTORY DESTINATION ${DATA_INSTALL_DIR}/krita/shortcuts)