I am creating three new entities for the TDE help files. The entities will be stored in the sources tree in tdelibs/kdoctools/customization/entities/general.entities.
These new entities will contain the document version, release date, and copyright years.
The past practice with all KDE3 help files was to use hard-coded, static text strings. I want to change the fixed text to entities so they can be dynamic and always match the TDE release information.
Conceptually, I tested these new entities by hard-coding them into general.entities and compiling a couple of modified docbook sources to use those entities. Works as planned. :)
The next step is to modify the cmake build process to update the general.entities file when the tdelibs package is built.
The macro or script, whichever is correct terminology for cmake, needs to work like this:
* Extract the release version variable TDE_VERSION_STRING from tdelibs/tdecore/tdeversion.h.
* Read the file date stamp of tdeversion.h (for GIT sources this will change regularly, for tarballs this will remain fixed)
* Create a copyright year string in the form of "2010-$CURRENT_YEAR"
* Update the text strings between the quotation marks in general.entities:
<!ENTITY tde-release-version "R14.0.0 [DEVELOPMENT]"> <!ENTITY tde-release-date "March 8, 2012"> <!ENTITY tde-copyright-date "2010-2012">
* Continue with the build process.
I think I can do something like that in a shell script but I am unfamiliar with how to do the same in cmake.
I don't mind doing the grunt work and testing, but I appreciate guidance to do this.
Thanks!
Darrell
On 03/08/2012 03:45 PM, Darrell Anderson wrote:
I think I can do something like that in a shell script but I am unfamiliar with how to do the same in cmake.
I don't mind doing the grunt work and testing, but I appreciate guidance to do this.
Thanks!
Darrell
Darrell,
Believe it or not, it shouldn't be that hard. I just had to learn this a couple hours ago trying to fix the libkscan library issue. Basically cmake has a script mode that lets you play with sections of the cmake scripts and look at what it is doing.
What you need to do is create a file <somefilename.cmake> and put the syntax you want in there. Then run 'cmake -P somefilename.cmake' to make it go. See:
http://www.cmake.org/cmake/help/syntax.html
Use SET( varible_name " whatever in this string (supports \n, etc..)" )
Then you reference your varible_name by normal ${variable_name} syntax
Then just use the following to dump output to see how it's going:
MESSAGE(STATUS "stuff you want and ${variable_name}" )
You'll pick it up pretty quick :)