From kde-commits Tue May 12 00:19:42 2015 From: Alexander Potashev Date: Tue, 12 May 2015 00:19:42 +0000 To: kde-commits Subject: [kross-interpreters/frameworks] /: Prepare CMakeLists.txt for porting Python2 support to KF5 Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=143138999206916 Git commit b9a8dabbf098bbc4ea6a4cf01cb4714fedd1a35c by Alexander Potashev. Committed on 12/05/2015 at 00:58. Pushed by aspotashev into branch 'frameworks'. Prepare CMakeLists.txt for porting Python2 support to KF5 M +32 -19 CMakeLists.txt M +11 -16 python/CMakeLists.txt http://commits.kde.org/kross-interpreters/b9a8dabbf098bbc4ea6a4cf01cb4714fe= dd1a35c diff --git a/CMakeLists.txt b/CMakeLists.txt index b308fde..2a12662 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,16 +1,20 @@ -cmake_minimum_required(VERSION 2.6) +cmake_minimum_required(VERSION 2.8.12) project(KrossPlugins) = -# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is = checked -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake/modul= es ) +# Include KF5 cmake modules +find_package(ECM 0.0.10 REQUIRED CONFIG) +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH}) +include(KDEInstallDirs) +include(KDECompilerSettings) +include(KDECMakeSettings) +include(FeatureSummary) +include(ECMOptionalAddSubdirectory) = -# search packages used by KDE -find_package(KDE4 REQUIRED) -include(KDE4Defaults) -include(MacroLibrary) +# Where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is = checked +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake/modul= es) = -add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS}) -include_directories (${KDE4_INCLUDES}) +find_package(Qt5 5.2.0 CONFIG REQUIRED Core Gui Widgets Test) +find_package(KF5 REQUIRED Kross KDELibs4Support) = # TODO: PYTHON3 Port: Use "find_package(PythonLibs 2 REQUIRED)" (CMAKE MOD= ULE not KDELIBS) find_package(PythonLibrary 2 REQUIRED QUIET) @@ -24,20 +28,29 @@ if(PYTHONLIBRARY_FOUND) endif() endif() = - -find_package(FALCON) - if(PYTHONLIBRARY_FOUND) - macro_optional_add_subdirectory(python) + ecm_optional_add_subdirectory(python) endif(PYTHONLIBRARY_FOUND) -macro_log_feature(PYTHONLIBRARY_FOUND "Python" "Python is a programming la= nguage that lets you work more quickly and integrate your systems more effe= ctively." "http://python.org" FALSE "2.0" "Kross Python support.") = +set_package_properties(PythonLibrary PROPERTIES + DESCRIPTION "Python is a programming language that lets you work more = quickly and integrate your systems more effectively." + URL "http://python.org" + TYPE OPTIONAL + PURPOSE "Kross Python support.") + +find_package(FALCON) if(FALCON_FOUND) - macro_optional_add_subdirectory(falcon) + ecm_optional_add_subdirectory(falcon) endif(FALCON_FOUND) -macro_log_feature(FALCON_FOUND "FALCON" "Falcon is an Open Source, simple,= fast and powerful programming language, easy to learn and to feel comforta= ble with." "http://www.falconpl.org/" FALSE "0.9.6.8" "Kross Falcon support= .") = -macro_optional_add_subdirectory(ruby) -macro_optional_add_subdirectory(java) -macro_display_feature_log() +set_package_properties(Falcon PROPERTIES + DESCRIPTION "Falcon is an Open Source, simple, fast and powerful progr= amming language, easy to learn and to feel comfortable with." + URL "http://www.falconpl.org/" + TYPE OPTIONAL + PURPOSE "Kross Falcon support.") + +# ecm_optional_add_subdirectory(ruby) +# ecm_optional_add_subdirectory(java) + +feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) = diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 7ab0703..aaa10eb 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -2,19 +2,9 @@ project(KROSSPYTHON) = include(PythonMacros) = -include_directories( - ${PYTHON_INCLUDE_DIRS} - ${QT_INCLUDE_DIR} - ${QT_QT_INCLUDE_DIR} - ${QT_QTCORE_INCLUDE_DIR} - ${QT_QTGUI_INCLUDE_DIR} - #${QT_QTNETWORK_INCLUDE_DIR} - #${QT_QTXML_INCLUDE_DIR} - ${KDE4_INCLUDE_DIR} - ${KDE4_INCLUDE_DIR}/kross -) +include_directories(${PYTHON_INCLUDE_PATH}) = -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${KDE4_ENABLE_EXCEPTIONS}") +kde_enable_exceptions() = ########### next target ############### = @@ -36,12 +26,17 @@ set(krosspython_PART_SRCS ${libkrosspythoncxx_SRCS} pythonobject.cpp ) = -kde4_add_plugin(krosspython ${krosspython_PART_SRCS}) +add_library(krosspython MODULE ${krosspython_PART_SRCS}) = # -ldl seems to be needed (on Linux at least). # see http://lists.kde.org/?l=3Dkoffice-devel&m=3D116333261328694&w=3D2 # and http://websvn.kde.org/branches/work/kwin_composite/CMakeLists.txt?re= v=3D603677&r1=3D603384&r2=3D603677 -target_link_libraries(krosspython ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY}= ${KDE4_KPTY_LIBS} ${KDE4_KROSSCORE_LIBS} ${PYTHON_LIBRARIES} ${CMAKE_DL_LI= BS}) - -install(TARGETS krosspython DESTINATION ${PLUGIN_INSTALL_DIR}) +target_link_libraries(krosspython + KF5::KrossCore + Qt5::Gui + Qt5::Widgets + ${PYTHON_LIBRARIES} + ${CMAKE_DL_LIBS} +) = +install(TARGETS krosspython DESTINATION ${KDE_INSTALL_PLUGINDIR})