mirror of
https://github.com/g-truc/glm.git
synced 2024-11-22 08:54:35 +00:00
Reading GLM version in CMake using REGEX on GLM header
This commit is contained in:
parent
280ba02382
commit
a44e293c40
@ -1,8 +1,21 @@
|
||||
cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
|
||||
cmake_policy(VERSION 3.2)
|
||||
|
||||
set(GLM_VERSION "0.9.9")
|
||||
|
||||
file(READ "glm/detail/setup.hpp" GLM_SETUP_FILE)
|
||||
string(REGEX MATCH "#define[ ]+GLM_VERSION_MAJOR[ ]+([0-9]+)" _ ${GLM_SETUP_FILE})
|
||||
set(GLM_VERSION_MAJOR "${CMAKE_MATCH_1}")
|
||||
string(REGEX MATCH "#define[ ]+GLM_VERSION_MINOR[ ]+([0-9]+)" _ ${GLM_SETUP_FILE})
|
||||
set(GLM_VERSION_MINOR "${CMAKE_MATCH_1}")
|
||||
string(REGEX MATCH "#define[ ]+GLM_VERSION_PATCH[ ]+([0-9]+)" _ ${GLM_SETUP_FILE})
|
||||
set(GLM_VERSION_PATCH "${CMAKE_MATCH_1}")
|
||||
string(REGEX MATCH "#define[ ]+GLM_VERSION_REVISION[ ]+([0-9]+)" _ ${GLM_SETUP_FILE})
|
||||
set(GLM_VERSION_REVISION "${CMAKE_MATCH_1}")
|
||||
|
||||
set(GLM_VERSION ${GLM_VERSION_MAJOR}.${GLM_VERSION_MINOR}.${GLM_VERSION_PATCH}.${GLM_VERSION_REVISION})
|
||||
project(glm VERSION ${GLM_VERSION} LANGUAGES CXX)
|
||||
message(STATUS "GLM: Version " ${GLM_VERSION})
|
||||
|
||||
enable_testing()
|
||||
|
||||
add_subdirectory(glm)
|
||||
|
@ -3,14 +3,14 @@
|
||||
#include <cassert>
|
||||
#include <cstddef>
|
||||
|
||||
#define GLM_VERSION_MAJOR 0
|
||||
#define GLM_VERSION_MINOR 9
|
||||
#define GLM_VERSION_PATCH 9
|
||||
#define GLM_VERSION_REVISION 8
|
||||
#define GLM_VERSION 998
|
||||
#define GLM_VERSION_MESSAGE "GLM: version 0.9.9.8"
|
||||
#define GLM_VERSION_MAJOR 0
|
||||
#define GLM_VERSION_MINOR 9
|
||||
#define GLM_VERSION_PATCH 9
|
||||
#define GLM_VERSION_REVISION 8
|
||||
#define GLM_VERSION 998
|
||||
#define GLM_VERSION_MESSAGE "GLM: version 0.9.9.8"
|
||||
|
||||
#define GLM_SETUP_INCLUDED GLM_VERSION
|
||||
#define GLM_SETUP_INCLUDED GLM_VERSION
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Active states
|
||||
|
Loading…
Reference in New Issue
Block a user