CMakeLists.txt 2.11 KB
Newer Older
Ralf Habacker's avatar
Ralf Habacker committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
cmake_minimum_required(VERSION 2.8.12)

project(php)

set(KDEVPHP_VERSION_MAJOR 5)
set(KDEVPHP_VERSION_MINOR 1)
set(KDEVPHP_VERSION_PATCH 2)
# KDevplatform dependency version
set( KDEVPLATFORM_VERSION "${KDEVPHP_VERSION_MAJOR}.${KDEVPHP_VERSION_MINOR}.${KDEVPHP_VERSION_PATCH}" )

configure_file( "${php_SOURCE_DIR}/kdevphpversion.h.cmake" "${php_BINARY_DIR}/kdevphpversion.h" @ONLY )

find_package (ECM 0.0.9 REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})

include(KDECompilerSettings NO_POLICY_SCOPE)
include(ECMAddTests)
include(KDEInstallDirs)
include(KDECMakeSettings)
include(GenerateExportHeader)
include(FeatureSummary)

find_package(Qt5 REQUIRED Core Widgets Test WebKitWidgets)
find_package(KF5 REQUIRED COMPONENTS Archive ThreadWeaver TextEditor I18n ItemModels KCMUtils)
find_package(KDevPlatform ${KDEVPLATFORM_VERSION} REQUIRED)
find_package(KDevelop-PG-Qt REQUIRED)

if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wdocumentation")
endif()

add_definitions( -DKDE_DEFAULT_DEBUG_AREA=9043 )
add_definitions( -DTRANSLATION_DOMAIN=\"kdevphp\" )

include_directories(
    ${KDEVPGQT_INCLUDE_DIR}
)

39
if(NOT BUILD_PARSER_ONLY)
Ralf Habacker's avatar
Ralf Habacker committed
40
add_subdirectory(app_templates)
41
endif()
Ralf Habacker's avatar
Ralf Habacker committed
42
add_subdirectory(parser)
43
if(NOT BUILD_PARSER_ONLY)
Ralf Habacker's avatar
Ralf Habacker committed
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
add_subdirectory(duchain)
add_subdirectory(completion)
add_subdirectory(testprovider)
add_subdirectory(docs)

set(kdevphplanguagesupport_PART_SRCS
    phplanguagesupport.cpp
    phpparsejob.cpp
    phphighlighting.cpp
    phpdebug.cpp

    codegen/refactoring.cpp
)

kdevplatform_add_plugin(kdevphplanguagesupport JSON kdevphpsupport.json
    SOURCES ${kdevphplanguagesupport_PART_SRCS})
target_link_libraries(kdevphplanguagesupport
    KDev::Interfaces
    KDev::Language
    kdevphpduchain
    kdevphpparser
    kdevphpcompletion

    KF5::I18n
    KF5::TextEditor
)
70
endif()
Ralf Habacker's avatar
Ralf Habacker committed
71 72

# not writeable so that the refactoring actions get hidden
73 74 75
if(NOT NO_INSTALL)
    install(FILES phpfunctions.php DESTINATION ${DATA_INSTALL_DIR}/kdevphpsupport PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
endif()
Ralf Habacker's avatar
Ralf Habacker committed
76 77

feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)