[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kross-interpreters/frameworks] /: Prepare CMakeLists.txt for porting Python2 support to KF5
From: Alexander Potashev <aspotashev () gmail ! com>
Date: 2015-05-12 0:19:42
Message-ID: E1YrxvC-0005rl-1s () scm ! kde ! org
[Download RAW message or body]
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/b9a8dabbf098bbc4ea6a4cf01cb4714fedd1a35c
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/modules )
+# 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/modules)
-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 MODULE 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 language \
that lets you work more quickly and integrate your systems more effectively." \
"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 comfortable 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 programming \
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=koffice-devel&m=116333261328694&w=2
# and http://websvn.kde.org/branches/work/kwin_composite/CMakeLists.txt?rev=603677&r1=603384&r2=603677
-target_link_libraries(krosspython ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} \
${KDE4_KPTY_LIBS} ${KDE4_KROSSCORE_LIBS} ${PYTHON_LIBRARIES} \
${CMAKE_DL_LIBS})
-
-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})
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic