kig python scripting with cmake #6

Closed
opened 4 years ago by Ray-V · 4 comments
Ray-V commented 4 years ago
Collaborator

I don't get kig python scripting support with a cmake build of tdeedu.

kig builds and runs, but there's no 'Python Script' icon and Objects|Other just shows Locus, Text Label, and Measure Transport.

The autotools build shows the icon with an additional Objects|Other menu item 'Python Script' - and it works.

For the autotools build, there is a test in configure for libboost_python and it is included as a dependency for scripting and libkigpart, and there's this possible warning indicating that libboost_python is required:

WARNING: Kig needs the Python and Boost.Python libraries and their headers
installed for its Python scripting support. One of both was not
found, or the versions were incompatible, and Python scripting will be disabled.

There's no libboost_python dependency in libkigpart for the cmake build.

I don't get kig python scripting support with a cmake build of tdeedu. kig builds and runs, but there's no 'Python Script' icon and Objects|Other just shows Locus, Text Label, and Measure Transport. The autotools build shows the icon with an additional Objects|Other menu item 'Python Script' - and it works. For the autotools build, there is a test in configure for libboost_python and it is included as a dependency for scripting and libkigpart, and there's this possible warning indicating that libboost_python is required: WARNING: Kig needs the Python and Boost.Python libraries and their headers \ installed for its Python scripting support. One of both was not \ found, or the versions were incompatible, and Python scripting will be disabled. There's no libboost_python dependency in libkigpart for the cmake build.
Ray-V commented 4 years ago
Poster
Collaborator

In kig/CMakeLists.txt, scripting is not an option as it is in the autotools build, and KIG_ENABLE_PYTHON_SCRIPTING needs to be set.

These are the files where it appears:

kig/configure.in.in: AC_DEFINE( KIG_ENABLE_PYTHON_SCRIPTING, 1, [Defined if Kig Python scripting is enabled] )
kig/misc/builtin_stuff.cc:#ifdef KIG_ENABLE_PYTHON_SCRIPTING
kig/misc/guiaction.cc:#ifdef KIG_ENABLE_PYTHON_SCRIPTING
kig/misc/guiaction.h:#ifdef KIG_ENABLE_PYTHON_SCRIPTING
kig/modes/popup.cc:#ifdef KIG_ENABLE_PYTHON_SCRIPTING
kig/objects/object_type_factory.cc:#ifdef KIG_ENABLE_PYTHON_SCRIPTING

I added add_definitions( -DKIG_ENABLE_PYTHON_SCRIPTING )
to kig/{misc,modes,objects}/CMakeLists.txt

--- kig/misc/CMakeLists.txt
+++ kig/misc/CMakeLists.txt
@@ -15,0 +16 @@
+add_definitions( -DKIG_ENABLE_PYTHON_SCRIPTING )

--- kig/modes/CMakeLists.txt
+++ kig/modes/CMakeLists.txt
@@ -15,0 +16 @@
+add_definitions( -DKIG_ENABLE_PYTHON_SCRIPTING )

--- kig/objects/CMakeLists.txt
+++ kig/objects/CMakeLists.txt
@@ -15,0 +16 @@
+add_definitions( -DKIG_ENABLE_PYTHON_SCRIPTING )

Also had to get libboost_python into the build ..

--- kig/scripting/CMakeLists.txt
+++ kig/scripting/CMakeLists.txt
@@ -32 +32 @@
-      ${Boost_LIBRARIES}
+      boost_python${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}

and libtdetexteditor ..

--- kig/CMakeLists.txt
+++ kig/CMakeLists.txt
@@ -41,0 +42 @@
+     tdetexteditor-shared

and kig python scripting now works from a cmake build.

In kig/CMakeLists.txt, scripting is not an option as it is in the autotools build, and KIG_ENABLE_PYTHON_SCRIPTING needs to be set. These are the files where it appears: > kig/configure.in.in: AC_DEFINE( KIG_ENABLE_PYTHON_SCRIPTING, 1, [Defined if Kig Python scripting is enabled] ) kig/misc/builtin_stuff.cc:#ifdef KIG_ENABLE_PYTHON_SCRIPTING kig/misc/guiaction.cc:#ifdef KIG_ENABLE_PYTHON_SCRIPTING kig/misc/guiaction.h:#ifdef KIG_ENABLE_PYTHON_SCRIPTING kig/modes/popup.cc:#ifdef KIG_ENABLE_PYTHON_SCRIPTING kig/objects/object_type_factory.cc:#ifdef KIG_ENABLE_PYTHON_SCRIPTING I added `add_definitions( -DKIG_ENABLE_PYTHON_SCRIPTING )` to kig/{misc,modes,objects}/CMakeLists.txt ```diff --- kig/misc/CMakeLists.txt +++ kig/misc/CMakeLists.txt @@ -15,0 +16 @@ +add_definitions( -DKIG_ENABLE_PYTHON_SCRIPTING ) --- kig/modes/CMakeLists.txt +++ kig/modes/CMakeLists.txt @@ -15,0 +16 @@ +add_definitions( -DKIG_ENABLE_PYTHON_SCRIPTING ) --- kig/objects/CMakeLists.txt +++ kig/objects/CMakeLists.txt @@ -15,0 +16 @@ +add_definitions( -DKIG_ENABLE_PYTHON_SCRIPTING ) ``` **Also** had to get libboost_python into the build .. ```diff --- kig/scripting/CMakeLists.txt +++ kig/scripting/CMakeLists.txt @@ -32 +32 @@ - ${Boost_LIBRARIES} + boost_python${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR} ``` and libtdetexteditor .. ```diff --- kig/CMakeLists.txt +++ kig/CMakeLists.txt @@ -41,0 +42 @@ + tdetexteditor-shared ``` and kig python scripting now works from a cmake build.
Ghost commented 4 years ago

@Ray-V Would you mind sending PR with your changes? This will be easier for everyone here to test.

@Ray-V Would you mind sending PR with your changes? This will be easier for everyone here to test.
Owner

for tracking reference, PR #7 is addressing this.

for tracking reference, PR #7 is addressing this.
Owner

Fixed by commits listed above.

Fixed by commits listed above.
SlavekB closed this issue 4 years ago
SlavekB added this to the R14.0.8 release milestone 4 years ago
Sign in to join this conversation.
No Milestone
No Assignees
4 Participants
Notifications
Due Date

No due date set.

Reference: TDE/tdeedu#6
Loading…
There is no content yet.