[CMake] Building a Version Header

Clark Gaebel cg.wowus.cg at gmail.com
Wed Jul 7 22:59:40 EDT 2010


Is there any way I can use the output from a command-line program (in
this case, "git describe --dirty") instead of using FindGit?

On 07/07/10 22:58, John Drescher wrote:
>> 1) I'm using git
>>     
> I know. You have some work to do..
> On top of the minor differences in what you want the FindGIt.cmake
> does not have that option to return the version so you need to adapt
> it to get the git version similar to the way the FindSubversion.cmake
> module does for subversion repositories.
>
>   
>> 2) If it outputs to the build directory, how do I refer to it?
>>     
> You can include files from your build folder in your project.
>
> Just add
> include_directories(${PROJECT_BINARY_DIR})
>
> in your CMakeLists.txt
>
> then use the header as you would any other header in your project.
> John
>   

-- 
Regards,
-Clark



More information about the CMake mailing list