Add macro to set project version at TDE-wide scope. #84

Merged
MicheleC merged 1 commits from feat/tde-version into master 2 years ago
Owner

This macro simplifies setting the project version of the modules and updating it when a new TDE version is available.
The macro can be used in two modes:

  1. tde_set_project_version( )
  2. tde_set_project_version( VERSION "your version number" )

Mode 1. will default to the version number DEFAULT_VERSION set in TDEVersion.cmake in the common cmake module. This is the expected usage mode and will make updating all cmake project versions as simple as a single commit in cmake where the DEFAULT_VERSION number is edited.

Mode 2. can be used to specify a specific version number if necessary in case of special testing purposes.
EDIT: no longer provided

I have prepared the required changes to the module CMakeLists.txt repos and tested a few. I will push them after this PR has been accepted.

For R14.0.x the commit needs some editing during cherry picking.

This macro simplifies setting the project version of the modules and updating it when a new TDE version is available. The macro can be used in two modes: 1. ```tde_set_project_version( )``` 2. ```tde_set_project_version( VERSION "your version number" )``` Mode 1. will default to the version number DEFAULT_VERSION set in TDEVersion.cmake in the common cmake module. This is the expected usage mode and will make updating all cmake project versions as simple as a single commit in cmake where the DEFAULT_VERSION number is edited. Mode 2. can be used to specify a specific version number if necessary in case of special testing purposes. EDIT: no longer provided I have prepared the required changes to the module CMakeLists.txt repos and tested a few. I will push them after this PR has been accepted. For R14.0.x the commit needs some editing during cherry picking.
MicheleC added 1 commit 2 years ago
83045ce30b
Add macro to set project version at TDE-wide scope.
MicheleC added this to the R14.0.13 release milestone 2 years ago
MicheleC requested review from SlavekB 2 years ago
Poster
Owner

Note: the macro could have been added to TDEMacros.cmake, but I have chosen a standalone file to simplify finding the place where to update the default version when needed.

Note: the macro could have been added to TDEMacros.cmake, but I have chosen a standalone file to simplify finding the place where to update the default version when needed.
Owner

I still think about how to use another source to identify the version number so that it is not hardcoded outside the source tree of a particular package.

For the time being, I have three options, but all have their disadvantages:

  1. Search the version in kdemacros.h. The disadvantage is that kdemacros.h is part of tdelibs, so is not available during build of dependencies.

  2. Use the version from ${CMAKE_SOURCE_DIR}/.tdepkginfo, in similar way as macro tde_read_src_metadata. The disadvantage is that this file is generated in deb packaging, but may be missing in other buildings.

  3. I think of adjusting the script create_tarball to add the version number to ${CMAKE_SOURCE_DIR}/.tdescminfo during creating a source tarball. The disadvantage is that it does not solve the version number for distributions, which builds directly on the git clone of the source code.

For now, I have no more ideas.

I still think about how to use another source to identify the version number so that it is not hardcoded outside the source tree of a particular package. For the time being, I have three options, but all have their disadvantages: 1. Search the version in `kdemacros.h`. The disadvantage is that `kdemacros.h` is part of tdelibs, so is not available during build of `dependencies`. 2. Use the version from `${CMAKE_SOURCE_DIR}/.tdepkginfo`, in similar way as macro `tde_read_src_metadata`. The disadvantage is that this file is generated in deb packaging, but may be missing in other buildings. 3. I think of adjusting the script `create_tarball` to add the version number to `${CMAKE_SOURCE_DIR}/.tdescminfo` during creating a source tarball. The disadvantage is that it does not solve the version number for distributions, which builds directly on the git clone of the source code. For now, I have no more ideas.
Poster
Owner

Hi @SlavekB, thanks for the feedback.
Indeed, all the other three suggested options have downsides which are significant and make those options not practical IMO.

Hi @SlavekB, thanks for the feedback. Indeed, all the other three suggested options have downsides which are significant and make those options not practical IMO.
Owner

Script create_tarball has been updated, so next to the hard-coded version we can add the way of detecting the version number from ${CMAKE_SOURCE_DIR}/.tdescminfo as designed in point 3) above.

Script `create_tarball` has been updated, so next to the hard-coded version we can add the way of detecting the version number from `${CMAKE_SOURCE_DIR}/.tdescminfo` as designed in point 3) above.
MicheleC force-pushed feat/tde-version from 83045ce30b to 21e0fc60aa 2 years ago
Poster
Owner

Updated as discussed. The option for custom version is no longer available.

Updated as discussed. The option for custom version is no longer available.
MicheleC force-pushed feat/tde-version from 21e0fc60aa to d1cf3205e5 2 years ago
MicheleC force-pushed feat/tde-version from d1cf3205e5 to 20f556c718 2 years ago
MicheleC force-pushed feat/tde-version from 20f556c718 to 4b9ade570d 2 years ago
MicheleC force-pushed feat/tde-version from 4b9ade570d to 11a6934bbb 2 years ago
SlavekB approved these changes 2 years ago
SlavekB left a comment
Owner

Great, the result looks good.

Great, the result looks good.
MicheleC merged commit 11a6934bbb into master 2 years ago
MicheleC deleted branch feat/tde-version 2 years ago

Reviewers

SlavekB approved these changes 2 years ago
The pull request has been merged as 11a6934bbb.
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Reference: TDE/tde-cmake#84
Loading…
There is no content yet.