project() (Re: [karchive] /: Show how qmake integration can be done.)

David Faure faure at kde.org
Sun Jan 5 19:59:54 UTC 2014


On Sunday 05 January 2014 20:39:37 Alexander Neundorf wrote:
> how about extending the project( <name> [lang1 ... langN]) command ?
> It already sets PROJECT_(SOURCE|BINARY)_DIR and <name>_(SOURCE|BINARY)_DIR 
> variables.
> 
> It could be 
> project(foo VERSION 1.2.3 C CXX)
> and it could set the PROJECT_VERSION_... variables, and also
> foo_VERSION_...  variables.

So this:

project(KArchive)
set(KF5_VERSION "5.0.0")
ecm_setup_version(${KF5_VERSION} VARIABLE_PREFIX KARCHIVE
                        VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/karchive_version.h"
                        PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5ArchiveConfigVersion.cmake")

would become this?

set(KF5_VERSION "5.0.0")
project(KArchive $KF5_VERSION)
ecm_setup_version(
                        VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/karchive_version.h"
                        PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5ArchiveConfigVersion.cmake")

We still need ecm_setup_version, to generate these version files,
but it could take the version from PROJECT_VERSION_*.
This is SIC, but I understand that's not a problem yet.

(we could also keep the parsing of the first argument if set, for SC).

Works for me.
But project() is not in ECM, it's in CMake, isn't it?

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Working on KDE, in particular KDE Frameworks 5



More information about the Kde-buildsystem mailing list