2
0

Allow cmake to look up the mpw version from git.

This commit is contained in:
Maarten Billemont 2017-11-06 12:50:15 -05:00
parent 966327571d
commit e30b618241

View File

@ -19,9 +19,16 @@ set( CMAKE_BUILD_TYPE Release )
set( CMAKE_C_FLAGS "-O3" )
# Version.
if(EXISTS "VERSION")
execute_process( COMMAND git describe --match *-clo* --long --dirty --broken RESULT_VARIABLE status OUTPUT_VARIABLE mpw_version OUTPUT_STRIP_TRAILING_WHITESPACE )
if( NOT status EQUAL 0 AND EXISTS "VERSION" )
file( READ "VERSION" mpw_version )
string( STRIP ${mpw_version} mpw_version )
endif()
if( mpw_version MATCHES "." )
add_definitions( -DMP_VERSION=${mpw_version} )
message( STATUS "Current mpw source version ${mpw_version}..." )
else()
message( STATUS "Current mpw source version unknown..." )
endif()