CMakeLists.txt 4.47 KB
Newer Older
Kevin Funk's avatar
Kevin Funk committed
1
find_package(KF5Plasma CONFIG)
2
set_package_properties(KF5Plasma PROPERTIES
3
    PURPOSE "Plasma libraries for enabling the plasma addons"
4 5 6 7 8
    URL "http://www.kde.org"
    TYPE OPTIONAL)
if(KF5Plasma_FOUND)
    add_subdirectory(plasma)
endif()
9

10 11
option(KDEVELOP_SINGLE_APP "Use QtSingleApplication as KDevelop's base" OFF)

Kevin Funk's avatar
Kevin Funk committed
12
set(kdevelop_SRCS  main.cpp kdevideextension.cpp)
13

14 15 16 17 18
ecm_qt_declare_logging_category(kdevelop_SRCS
    HEADER debug.h
    IDENTIFIER APP
    CATEGORY_NAME "kdevelop.app"
)
19 20
qt5_add_resources(kdevelop_SRCS kdevelop.qrc)

21
#TODO: remove CMAKE_CURRENT_SOURCE_DIR prefix when ECM is fixed
22
set(kdevelop_PNG_ICONS
23 24 25 26 27 28
    ${CMAKE_CURRENT_SOURCE_DIR}/icons/16-apps-kdevelop.png
    ${CMAKE_CURRENT_SOURCE_DIR}/icons/32-apps-kdevelop.png
    ${CMAKE_CURRENT_SOURCE_DIR}/icons/48-apps-kdevelop.png
    ${CMAKE_CURRENT_SOURCE_DIR}/icons/64-apps-kdevelop.png
    ${CMAKE_CURRENT_SOURCE_DIR}/icons/128-apps-kdevelop.png
    ${CMAKE_CURRENT_SOURCE_DIR}/icons/256-apps-kdevelop.png
29 30 31 32 33 34 35 36 37 38 39 40 41 42
    ${CMAKE_CURRENT_SOURCE_DIR}/icons/512-apps-kdevelop.png
    ${CMAKE_CURRENT_SOURCE_DIR}/icons/1024-apps-kdevelop.png
)
set(kdevelop_SVG_ICONS
    ${CMAKE_CURRENT_SOURCE_DIR}/icons/sc-apps-kdevelop.svg
)
ecm_install_icons(
    ICONS
        ${kdevelop_PNG_ICONS}
        ${kdevelop_SVG_ICONS}
    DESTINATION ${KDE_INSTALL_ICONDIR}
)
ecm_add_app_icon(kdevelop_SRCS
    ICONS ${kdevelop_PNG_ICONS}
43 44
)

45
qt5_add_resources(kdevelop_SRCS kdevelop.qrc)
46
add_executable(kdevelop ${kdevelop_SRCS} )
47
target_link_libraries(kdevelop
48 49
    KDev::Interfaces
    KDev::Shell
50
    KDev::Util
51

52
    KF5::Declarative
53
    KF5::IconThemes
54
    KF5::Crash
55 56

    Qt5::Quick
57
)
Kevin Funk's avatar
Kevin Funk committed
58 59 60
IF(APPLE)
    target_link_libraries(kdevelop "-framework CoreFoundation")
ENDIF()
61 62 63 64
if(KDEVELOP_SINGLE_APP)
    add_subdirectory(3rdparty/qtsingleapplication)
    target_link_libraries(kdevelop qtsingleapplication)
endif()
65

66
install(TARGETS kdevelop ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} )
67

68
install(FILES kdevelop! DESTINATION bin PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ)
69 70 71 72 73 74
configure_file(start-kdevelop.py.in ${CMAKE_CURRENT_BINARY_DIR}/start-kdevelop.py @ONLY)

option(INSTALL_KDEVELOP_LAUNCH_WRAPPER "Install a wrapper script that sets required environment variables. Only useful when installing into a separate prefix" OFF)
if(INSTALL_KDEVELOP_LAUNCH_WRAPPER)
    install(FILES ${CMAKE_CURRENT_BINARY_DIR}/start-kdevelop.py DESTINATION bin PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ)
endif()
75

76 77 78 79
if (WIN32)
install(FILES windows/kdevelop-msvc.bat DESTINATION bin PERMISSIONS OWNER_EXECUTE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ)
endif (WIN32)

80
if (APPLE)
81 82
    # the MacOSX bundle display name property (CFBundleDisplayName) is not currently supported by cmake,
    # so has to be set for all targets in this cmake file
René J.V. Bertin's avatar
OS X:  
René J.V. Bertin committed
83
    set(MACOSX_BUNDLE_DISPLAY_NAME KDevelop)
84
    # We provide our own Info.plist to disable AppNap for KDevelop:
85 86
    set_target_properties(kdevelop PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in)
    set_target_properties(kdevelop PROPERTIES MACOSX_BUNDLE_GUI_IDENTIFIER "org.kde.KDevelop")
87
    set_target_properties(kdevelop PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "KDevelop")
René J.V. Bertin's avatar
OS X:  
René J.V. Bertin committed
88
    set_target_properties(kdevelop PROPERTIES MACOSX_BUNDLE_DISPLAY_NAME "KDevelop")
89
    set_target_properties(kdevelop PROPERTIES MACOSX_BUNDLE_INFO_STRING "The KDevelop Integrated Development Environment")
Sven Brauch's avatar
Sven Brauch committed
90 91 92
    set_target_properties(kdevelop PROPERTIES MACOSX_BUNDLE_LONG_VERSION_STRING "KDevelop ${KDevelop_VERSION_MAJOR}.${KDevelop_VERSION_MINOR}")
    set_target_properties(kdevelop PROPERTIES MACOSX_BUNDLE_SHORT_VERSION_STRING "${KDevelop_VERSION_MAJOR}.${KDevelop_VERSION_MINOR}")
    set_target_properties(kdevelop PROPERTIES MACOSX_BUNDLE_BUNDLE_VERSION "${KDevelop_VERSION_MAJOR}.${KDevelop_VERSION_MINOR}")
René J.V. Bertin's avatar
OS X:  
René J.V. Bertin committed
93
    set_target_properties(kdevelop PROPERTIES MACOSX_BUNDLE_ICON_FILE "kdevelop_SRCS.icns")
94
    set_target_properties(kdevelop PROPERTIES MACOSX_BUNDLE_COPYRIGHT "KDevelop Team")
95
endif (APPLE)
96

97 98 99

########### install files ###############

100 101
install( PROGRAMS org.kde.kdevelop.desktop  DESTINATION  ${KDE_INSTALL_APPDIR} )
install( PROGRAMS org.kde.kdevelop_ps.desktop  DESTINATION  ${KDE_INSTALL_APPDIR} )
102
install( PROGRAMS org.kde.kdevelop_kdev4.desktop  DESTINATION  ${KDE_INSTALL_APPDIR} )
103
install( FILES kdevelop.notifyrc DESTINATION ${KDE_INSTALL_KNOTIFY5RCDIR} )
104
install( FILES kdevelop.xml DESTINATION ${KDE_INSTALL_MIMEDIR} )
105
update_xdg_mimetypes( ${KDE_INSTALL_MIMEDIR} )