fix the OSD version printout in top CMakeList (now based off the #define in opensubdiv/version.h)

This commit is contained in:
manuelk 2013-02-01 10:09:55 -08:00
parent 368b8e3271
commit 0a0ff9f9e9

View File

@ -59,6 +59,16 @@ project(OpenSubdiv)
cmake_minimum_required(VERSION 2.8)
#-------------------------------------------------------------------------------
# Obtain OpenSubdiv API version from version.h file
if(EXISTS "${CMAKE_SOURCE_DIR}/opensubdiv/version.h")
file(STRINGS "${CMAKE_SOURCE_DIR}/opensubdiv/version.h"
OpenSubdiv_VERSION REGEX "^#define OPENSUBDIV_VERSION .*$")
string(REPLACE "#define OPENSUBDIV_VERSION " "" OpenSubdiv_VERSION ${OpenSubdiv_VERSION})
endif()
#-------------------------------------------------------------------------------
message(STATUS "Compiling ${CMAKE_PROJECT_NAME} version ${OpenSubdiv_VERSION}")
message(STATUS "Using cmake version ${CMAKE_VERSION}")