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 39 40 41 42 43 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 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
|
project(cpp)
kde4_no_enable_final(cpp)
include(CppBuildConfig.cmake)
include_directories(
${KDevelop_SOURCE_DIR}/languages/cpp/parser
${KDevelop_SOURCE_DIR}/languages/cpp/cppduchain
)
add_definitions( -DKDE_DEFAULT_DEBUG_AREA=9007 )
if(CMAKE_COMPILER_IS_GNUCXX)
# TODO: Remove when LTS for g++ < 4.3 has ended.
# See also: languages/cpp/parser/parser.h
macro_ensure_version("4.3.0" "${_gcc_version}" GCC_IS_NEWER_THAN_4_3)
if (GCC_IS_NEWER_THAN_4_3)
message(STATUS "Enabling c++0x support for unordered map")
add_definitions( -std=c++0x ) # For unordered_map
else(GCC_IS_NEWER_THAN_4_3)
add_definitions( -DGXX_LT_4_3 )
endif (GCC_IS_NEWER_THAN_4_3)
endif(CMAKE_COMPILER_IS_GNUCXX)
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
# TODO: version check?
add_definitions( -std=c++0x )
endif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_subdirectory(parser)
add_subdirectory(cppduchain)
########### next target ###############
set(kdevcpplanguagesupport_PART_SRCS
cpplanguagesupport.cpp
includepathcomputer.cpp
cppparsejob.cpp
preprocessjob.cpp
cpphighlighting.cpp
cpputils.cpp
includepathresolver.cpp
setuphelpers.cpp
setuphelpers_gcc.cpp
quickopen.cpp
codecompletion/model.cpp
codecompletion/worker.cpp
codecompletion/context.cpp
codecompletion/item.cpp
codecompletion/helpers.cpp
codecompletion/missingincludeitem.cpp
codecompletion/implementationhelperitem.cpp
codecompletion/missingincludemodel.cpp
codegen/cppnewclass.cpp
codegen/simplerefactoring.cpp
codegen/progressdialogs.cpp
codegen/codeassistant.cpp
codegen/signatureassistant.cpp
codegen/renameassistant.cpp
codegen/unresolvedincludeassistant.cpp
# codegen/makeimplementationprivate.cpp
)
if(MSVC)
set(kdevcpplanguagesupport_PART_SRCS ${kdevcpplanguagesupport_PART_SRCS} setuphelpers_msvc.cpp)
endif(MSVC)
set(kdevcpplanguagesupport_LIB_UI
codegen/ui/custom_include_paths.ui
# codegen/ui/privateimplementation.ui
)
kde4_add_ui_files(kdevcpplanguagesupport_PART_SRCS ${kdevcpplanguagesupport_LIB_UI})
option(BUILD_kdev_includepathresolver "Build the includepath resolver debugging tool" OFF)
if(BUILD_kdev_includepathresolver)
add_executable(kdev_includepathresolver includepathresolver.cpp)
set_target_properties( kdev_includepathresolver PROPERTIES COMPILE_FLAGS -DTEST )
target_link_libraries( kdev_includepathresolver
${KDEVPLATFORM_INTERFACES_LIBRARIES} ${KDEVPLATFORM_PROJECT_LIBRARIES}
${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${KDE4_KDECORE_LIBS} ${KDEVPLATFORM_LANGUAGE_LIBRARIES} )
install(TARGETS kdev_includepathresolver ${INSTALL_TARGETS_DEFAULT_ARGS} )
endif(BUILD_kdev_includepathresolver)
option(BUILD_uiblocktester "Build a debug thread into the plugin that checks for UI-thread lockups" OFF)
if(BUILD_uiblocktester)
add_definitions(-DDEBUG_UI_LOCKUP)
endif(BUILD_uiblocktester)
kde4_add_plugin(kdevcpplanguagesupport ${kdevcpplanguagesupport_PART_SRCS})
target_link_libraries(kdevcpplanguagesupport
kdev4cpprpp
kdev4cppduchain
kdev4cppparser
${KDEVPLATFORM_INTERFACES_LIBRARIES}
${KDEVPLATFORM_PROJECT_LIBRARIES}
${KDE4_THREADWEAVER_LIBRARIES}
${KDEVPLATFORM_LANGUAGE_LIBRARIES}
${KDE4_KDECORE_LIBS}
${KDE4_KTEXTEDITOR_LIBS}
)
install(TARGETS kdevcpplanguagesupport DESTINATION ${PLUGIN_INSTALL_DIR})
add_subdirectory(tests)
########### install files ###############
install(FILES kdevcppsupport.desktop DESTINATION ${SERVICES_INSTALL_DIR})
install(FILES kdevcppsupport.rc DESTINATION ${DATA_INSTALL_DIR}/kdevcppsupport)
########### only Windows and only for the MSVC ################
if(MSVC)
set(kdevmsvcdefinehelper_SRCS msvcdefinehelper.cpp)
add_executable(kdevmsvcdefinehelper ${kdevmsvcdefinehelper_SRCS})
install(TARGETS kdevmsvcdefinehelper RUNTIME DESTINATION bin
LIBRARY DESTINATION lib)
endif(MSVC)
|