Conversion to cmake building system #13

Merged
MicheleC merged 1 commits from feat/cmake-conversion into master 12 months ago
Owner
  1. kcm_module_stub.cpp.cmake is taken from pytdeextensions/src/tdedistutils.py, it's the stub code used to generate TDE control modules.
  2. tde-guidance package location is detected based on the location of the python setuptools, to avoid hardcoding it.
  3. python scripts enforced to python3.
  4. desktop files prepared for further translation after autotools support is dropped.
  5. added man pages from debian packaging repository.
1. kcm_module_stub.cpp.cmake is taken from pytdeextensions/src/tdedistutils.py, it's the stub code used to generate TDE control modules. 2. tde-guidance package location is detected based on the location of the python setuptools, to avoid hardcoding it. 3. python scripts enforced to python3. 4. desktop files prepared for further translation after autotools support is dropped. 5. added man pages from debian packaging repository.
MicheleC added this to the R14.1.2 release milestone 1 year ago
MicheleC added 1 commit 1 year ago
5448f4d01e
Conversion to cmake building system
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
MicheleC requested review from Core 1 year ago
MicheleC requested review from Owners 1 year ago
MicheleC force-pushed feat/cmake-conversion from 5448f4d01e to f5e2964bc2 1 year ago
SlavekB reviewed 1 year ago
SlavekB left a comment
Owner

It looks good. There are some notes to consider.

Originally I hesitated that if we want to change shebang to python3, but it is true that it does not matter – probably other supported distributions also provide such a binary name.

It looks good. There are some notes to consider. Originally I hesitated that if we want to change shebang to python3, but it is true that it does not matter – probably other supported distributions also provide such a binary name.
@ -0,0 +53,4 @@
OUTPUT_VARIABLE PYTHON_SETUP_TOOLS_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE
)
string( REGEX REPLACE "\\['(.*)'\\]" "\\1" PYTHON_SETUP_TOOLS_DIR2 ${PYTHON_SETUP_TOOLS_DIR} )
SlavekB commented 1 year ago
Owner

Can it be easier to have the processing already done on the python side?

import os; import setuptools; print(os.path.dirname(setuptools.__path__[0]))
Can it be easier to have the processing already done on the python side? ``` import os; import setuptools; print(os.path.dirname(setuptools.__path__[0])) ```
Poster
Owner

Yes, I also wanted to do the same update after the work we did for python 3.12.

Yes, I also wanted to do the same update after the work we did for python 3.12.
MicheleC marked this conversation as resolved
@ -0,0 +31,4 @@
unset( _MODULEDIR_ )
unset( _EXTRAMODULE_ )
unset( _MODULENAME_ )
unset( _FACTORYFUNCTION_ )
SlavekB commented 1 year ago
Owner

This seems unnecessary. The variables have the validity scope just the current level and below, so they will disappear automatically.

This seems unnecessary. The variables have the validity scope just the current level and below, so they will disappear automatically.
MicheleC marked this conversation as resolved
@ -0,0 +60,4 @@
##### other files
tde_create_translated_desktop(
SOURCE mountconfig.desktop
SlavekB commented 1 year ago
Owner

Another place to use ${MODULE_NAME}?

Another place to use `${MODULE_NAME}`?
MicheleC marked this conversation as resolved
@ -0,0 +82,4 @@
link_${MODULE_NAME} ALL COMMAND ${CMAKE_COMMAND} -E create_symlink
${TDE_GUIDANCE_DIST_PKG_PATH}/${MODULE_NAME}.py ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_NAME}
)
install(
SlavekB commented 1 year ago
Owner

This could be replaced by using the macro tde_install_symlink(...)?

This could be replaced by using the macro `tde_install_symlink(...)`?
MicheleC marked this conversation as resolved
@ -0,0 +30,4 @@
unset( _MODULEDIR_ )
unset( _EXTRAMODULE_ )
unset( _MODULENAME_ )
unset( _FACTORYFUNCTION_ )
SlavekB commented 1 year ago
Owner

This seems unnecessary. The variables have the validity scope just the current level and below, so they will disappear automatically.

This seems unnecessary. The variables have the validity scope just the current level and below, so they will disappear automatically.
MicheleC marked this conversation as resolved
@ -0,0 +45,4 @@
##### other files
tde_create_translated_desktop(
SOURCE serviceconfig.desktop
SlavekB commented 1 year ago
Owner

Another place to use ${MODULE_NAME}?

Another place to use `${MODULE_NAME}`?
MicheleC marked this conversation as resolved
@ -0,0 +50,4 @@
)
install(
PROGRAMS serviceconfig.py
SlavekB commented 1 year ago
Owner

Another place to use ${MODULE_NAME}?

Another place to use `${MODULE_NAME}`?
MicheleC marked this conversation as resolved
@ -0,0 +58,4 @@
link_${MODULE_NAME} ALL COMMAND ${CMAKE_COMMAND} -E create_symlink
${TDE_GUIDANCE_DIST_PKG_PATH}/${MODULE_NAME}.py ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_NAME}
)
install(
SlavekB commented 1 year ago
Owner

This could be replaced by using the macro tde_install_symlink(...)?

This could be replaced by using the macro `tde_install_symlink(...)`?
MicheleC marked this conversation as resolved
@ -0,0 +30,4 @@
unset( _MODULEDIR_ )
unset( _EXTRAMODULE_ )
unset( _MODULENAME_ )
unset( _FACTORYFUNCTION_ )
SlavekB commented 1 year ago
Owner

This seems unnecessary. The variables have the validity scope just the current level and below, so they will disappear automatically.

This seems unnecessary. The variables have the validity scope just the current level and below, so they will disappear automatically.
MicheleC marked this conversation as resolved
@ -0,0 +45,4 @@
##### other files
tde_create_translated_desktop(
SOURCE userconfig.desktop
SlavekB commented 1 year ago
Owner

Another place to use ${MODULE_NAME}?

Another place to use `${MODULE_NAME}`?
MicheleC marked this conversation as resolved
@ -0,0 +58,4 @@
link_${MODULE_NAME} ALL COMMAND ${CMAKE_COMMAND} -E create_symlink
${TDE_GUIDANCE_DIST_PKG_PATH}/${MODULE_NAME}.py ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_NAME}
)
install(
SlavekB commented 1 year ago
Owner

This could be replaced by using the macro tde_install_symlink(...)?

This could be replaced by using the macro `tde_install_symlink(...)`?
MicheleC marked this conversation as resolved
MicheleC force-pushed feat/cmake-conversion from f5e2964bc2 to a8bb561e77 1 year ago
Poster
Owner

PR updated as per feedback and rebased.

PR updated as per feedback and rebased.
SlavekB added 1 commit 1 year ago
1cbc95e47f
cmake: Fix FTBFS if it is necessary to link the DL library.
Change pythonize library detection to detect as a library instead of as a file.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
SlavekB commented 1 year ago
Owner

I did a test on Debian 10 (Buster) and because I got FTBFS, I added a second commit to solve the problem. At the same time, I modified the detection of pythonize library to be detected as a library, instead of detection as a file. If you are satisfied with it, you can do squash because there is no need to be merged as two separate commits.

I did a test on Debian 10 (Buster) and because I got FTBFS, I added a second commit to solve the problem. At the same time, I modified the detection of pythonize library to be detected as a library, instead of detection as a file. If you are satisfied with it, you can do squash because there is no need to be merged as two separate commits.
SlavekB force-pushed feat/cmake-conversion from 1cbc95e47f to cc7bc3c507 1 year ago
SlavekB commented 1 year ago
Owner

One more additional adjustment: Auxiliary python modules that are used as import <module> and are not called as separate commands do not need executable permission. That's why I moved the installation from PROGRAMS to FILES.

One more additional adjustment: Auxiliary python modules that are used as `import <module>` and are not called as separate commands do not need executable permission. That's why I moved the installation from `PROGRAMS` to `FILES`.
MicheleC force-pushed feat/cmake-conversion from cc7bc3c507 to 1d721906e5 12 months ago
MicheleC force-pushed feat/cmake-conversion from 1d721906e5 to 95f2a2d8b5 12 months ago
SlavekB approved these changes 12 months ago
SlavekB left a comment
Owner

All looks good.

All looks good.
MicheleC merged commit 95f2a2d8b5 into master 12 months ago
MicheleC deleted branch feat/cmake-conversion 12 months ago

Reviewers

SlavekB approved these changes 12 months ago
TDE/Core was requested for review 1 year ago
The pull request has been merged as 95f2a2d8b5.
Sign in to join this conversation.
No reviewers
TDE/Core
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Reference: TDE/tde-guidance#13
Loading…
There is no content yet.