CMakeLists.txt 3.42 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 )
11
add_subdirectory( pics/app )
12

13 14 15 16 17
if (WIN32 AND USE_BREAKPAD)
    add_subdirectory( crashreporter )
    include_directories(${CMAKE_SOURCE_DIR}/3rdparty/google-breakpad/src)
endif ()

18
set(krita_SRCS main.cc)
19

20 21 22 23 24 25 26 27
if(WIN32 AND USE_BREAKPAD)
    set(krita_SRCS ${krita_SRCS} kis_crash_handler.cpp)
    find_library(BREAKPAD_LIBS breakpad)
    if(NOT BREAKPAD_LIBS)
        message(FATAL_ERROR "Couldn't find Google Breakpad library!")
    endif()
endif()

28 29 30 31
if (NOT APPLE)
    file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/pics/app/*-apps-calligrakrita.png")
    ecm_add_app_icon(krita_SRCS ICONS ${ICONS_SRCS})
endif()
32

33 34 35 36 37 38 39
# 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
40
    ${CMAKE_SOURCE_DIR}/krita/pics/layers/layers-icons.qrc
41 42 43 44 45 46 47 48 49 50 51 52
    ${CMAKE_SOURCE_DIR}/krita/pics/misc-light/misc-light-icons.qrc
    ${CMAKE_SOURCE_DIR}/krita/pics/misc-dark/misc-dark-icons.qrc
    ${CMAKE_SOURCE_DIR}/krita/pics/tools/16/tools-16-icons.qrc
    ${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
53
    CACHE INTERNAL "krita_QRCS"
54
)
55

56 57
qt5_add_resources(krita_SRCS ${krita_QRCS})

58
add_executable(krita ${krita_SRCS})
59
target_link_libraries(krita 
60
    PRIVATE
61 62 63 64 65 66 67 68
                      kritaui 
                      Qt5::Core
                      Qt5::Gui
                      Qt5::Widgets
                      Qt5::Xml
                      Qt5::Network
                      Qt5::PrintSupport
                      Qt5::Svg
69
                      ${BREAKPAD_LIBS}
Boudewijn Rempt's avatar
Boudewijn Rempt committed
70 71 72
                      Qt5::Concurrent)
if(HAVE_KCRASH)
    target_link_libraries(krita
73
        PRIVATE
Boudewijn Rempt's avatar
Boudewijn Rempt committed
74 75 76
                          KF5::Crash
    )
endif()
Boudewijn Rempt's avatar
Boudewijn Rempt committed
77

78
if (APPLE)
Boudewijn Rempt's avatar
Boudewijn Rempt committed
79
    set_target_properties(krita PROPERTIES INSTALL_RPATH "@loader_path/../../../../lib;@loader_path/../lib;@loader_path/../Frameworks;@executable_path/../lib;@executable_path/../Frameworks")
80
    set_target_properties(krita PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.template)
81 82
    set_target_properties(krita PROPERTIES MACOSX_BUNDLE_GUI_IDENTIFIER "org.krita")
    set_target_properties(krita PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Krita")
83
endif ()
84 85

install(TARGETS krita ${INSTALL_TARGETS_DEFAULT_ARGS})
86
install(PROGRAMS krita.desktop  DESTINATION ${XDG_APPS_INSTALL_DIR})
Boudewijn Rempt's avatar
Boudewijn Rempt committed
87
install(FILES  krita.action kritamenu.action DESTINATION ${DATA_INSTALL_DIR}/krita/actions)
88
install(FILES  krita.appdata.xml DESTINATION ${SHARE_INSTALL_PREFIX}/appdata/ )
89

90 91 92
install(DIRECTORY DESTINATION ${DATA_INSTALL_DIR}/krita/shortcuts)


93
if (Qt5Quick_FOUND AND NOT MSYS)
94
   add_subdirectory(sketch)
95
#    add_subdirectory(gemini)
96
endif ()