Re: [CMake] How to assign version numbers from a source header to CMake variables?

2011-01-17 Thread SF Markus Elfring
The bug tracker is meant to help us track what bugs are going to be fixed in the upcoming releases of CMake. I have got no problems with this view. I have just dared to submit a feature request directly. It is not good as a general discussion mechanism because only a handful of CMake develo

Re: [CMake] How to assign version numbers from a source header to CMake variables?

2011-01-17 Thread David Cole
Markus, Please discuss things on the CMake mailing list and wait (sometimes a few days are necessary for a discussion to evolve and resolve itself into a conclusion) until there is a consensus about a course of action among the people discussing it on the mailing list before you bring things up in

Re: [CMake] How to assign version numbers from a source header to CMake variables?

2011-01-17 Thread SF Markus Elfring
Here is the code: I have found and implemented a solution that can extract data from a header file with the "help" from evaluation of regular expressions. file(STRINGS "${CPPCHECK_SOURCE_DIR}/lib/library_version.h" CPPCHECK_BUILD_SPECIFICATION REGEX "^[ \t]*#define[ \t]+CPPCHECK_LIBRARY

Re: [CMake] How to assign version numbers from a source header to CMake variables?

2011-01-12 Thread SF Markus Elfring
Here is the code: I have got another idea. Did anybody try to use the C/C++ preprocessor ("cpp" and eventually including the compiler) to output a file in a format which is suitable for processing of this data as a project specification for CMake? Regards, Markus ___

Re: [CMake] How to assign version numbers from a source header to CMake variables?

2011-01-12 Thread Alexey Livshits
> Which software licence does belong to your approach? I don't know :) -- BG, Alexey ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check

Re: [CMake] How to assign version numbers from a source header to CMake variables?

2011-01-12 Thread SF Markus Elfring
Here is the code: Thanks. - Very nice. :-) Which software licence does belong to your approach? Would anybody like to transform your example into an official CMake module? Regards, Markus ___ Powered by www.kitware.com Visit other Kitware open-s

Re: [CMake] How to assign version numbers from a source header to CMake variables?

2011-01-12 Thread Alexey Livshits
Here is the code: find_file(myproject_BUILD_NUMBER_FILE_FOUND myproject_build_number.txt PATHS ${myproject_SOURCE_DIR}) if(${myproject_BUILD_NUMBER_FILE_FOUND} MATCHES "NOTFOUND") set(myproject_CURRENT_BUILD_NUM 1) else() file(READ ${myproject_SOURCE_DIR}/myproject_build_number.tx

Re: [CMake] How to assign version numbers from a source header to CMake variables?

2011-01-12 Thread SF Markus Elfring
I use a simple text file with the build number, which is tracked under VCS. During the build I parse it, generate my version header, increase the number, save it to the file and check it in. Which (CMake) commands do you use for this approach? Regards, Markus ___

Re: [CMake] How to assign version numbers from a source header to CMake variables?

2011-01-12 Thread Alexey Livshits
2011/1/12 SF Markus Elfring : > Hello, > > I would like the add the CMake approach for software generation to a > project. My project example supports also other build tools. > This has got consequences on the way how informations like version numbers > are shared between these approaches. > > The

Re: [CMake] How to assign version numbers from a source header to CMake variables?

2011-01-12 Thread SF Markus Elfring
Are you using source control? Yes. - But there are challenges to query content management systems in a portable way. I use a combination of version in the main CMakeLists.txt and the svn rev. Variables from these get into a generated project header file that is also generated in the main CM

Re: [CMake] How to assign version numbers from a source header to CMake variables?

2011-01-12 Thread John Drescher
> I would like the add the CMake approach for software generation to a > project. My project example supports also other build tools. > This has got consequences on the way how informations like version numbers > are shared between these approaches. > > The CMake tutorial describes components for t

[CMake] How to assign version numbers from a source header to CMake variables?

2011-01-12 Thread SF Markus Elfring
Hello, I would like the add the CMake approach for software generation to a project. My project example supports also other build tools. This has got consequences on the way how informations like version numbers are shared between these approaches. The CMake tutorial describes components for