Merge branch 'master' of https://github.com/g-truc/glm
This commit is contained in:
@@ -5,7 +5,7 @@ if (NOT CMAKE_VERSION VERSION_LESS "3.1")
|
||||
endif()
|
||||
|
||||
project(glm)
|
||||
set(GLM_VERSION "0.9.8")
|
||||
set(GLM_VERSION "0.9.9")
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||
|
||||
@@ -31,6 +31,8 @@ if(NOT GLM_TEST_ENABLE)
|
||||
message(STATUS "GLM is a header only library, no need to build it. Set the option GLM_TEST_ENABLE with ON to build and run the test bench")
|
||||
endif()
|
||||
|
||||
option(GLM_TEST_ENABLE_FAST_MATH "Enable fast math optimizations" OFF)
|
||||
|
||||
if(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") OR (("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") AND UNIX))
|
||||
option(GLM_TEST_ENABLE_CXX_98 "Enable C++ 98" OFF)
|
||||
option(GLM_TEST_ENABLE_CXX_0X "Enable C++ 0x" OFF)
|
||||
@@ -64,20 +66,26 @@ if(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") OR ("${CMAKE_CXX_COMPILER_ID}"
|
||||
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
|
||||
set(CMAKE_CXX_FLAGS "-std=c++98")
|
||||
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
# GLM is using GCC 64 bits integer extension
|
||||
add_definitions(-Wno-long-long)
|
||||
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
add_definitions(-Wno-c++11-long-long)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
option(GLM_TEST_ENABLE_MS_EXTENSIONS "Enable MS extensions" OFF)
|
||||
option(GLM_TEST_ENABLE_LANG_EXTENSIONS "Enable language extensions" OFF)
|
||||
|
||||
if(GLM_TEST_ENABLE_MS_EXTENSIONS)
|
||||
if(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU"))
|
||||
add_definitions(-Wgnu-anonymous-struct)
|
||||
add_definitions(-Wnested-anon-types)
|
||||
if(GLM_TEST_ENABLE_LANG_EXTENSIONS)
|
||||
if(GLM_TEST_ENABLE_FAST_MATH)
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
add_definitions(-ffast-math)
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
add_definitions(/fp:fast)
|
||||
endif()
|
||||
elseif(NOT GLM_TEST_ENABLE_FAST_MATH)
|
||||
if(MSVC)
|
||||
add_definitions(/fp:precise)
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
if(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") OR (("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") AND WIN32))
|
||||
@@ -137,21 +145,6 @@ elseif(GLM_TEST_ENABLE_SIMD_SSE2)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
option(GLM_TEST_ENABLE_FAST_MATH "Enable fast math optimizations" OFF)
|
||||
if(GLM_TEST_ENABLE_FAST_MATH)
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
add_definitions(-ffast-math)
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
add_definitions(/fp:fast)
|
||||
endif()
|
||||
elseif(NOT GLM_TEST_ENABLE_FAST_MATH)
|
||||
if(MSVC)
|
||||
add_definitions(/fp:precise)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
#add_definitions(-S)
|
||||
#add_definitions(-s)
|
||||
@@ -161,6 +154,10 @@ if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
#ctest_enable_coverage()
|
||||
endif()
|
||||
|
||||
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
||||
add_definitions(/FAs)
|
||||
endif()
|
||||
|
||||
include_directories("${PROJECT_SOURCE_DIR}")
|
||||
include_directories("${PROJECT_SOURCE_DIR}/test/external")
|
||||
|
||||
@@ -218,4 +215,17 @@ if (NOT CMAKE_VERSION VERSION_LESS "3.0")
|
||||
)
|
||||
endif()
|
||||
|
||||
# build pkg-config file
|
||||
configure_file(
|
||||
"./cmake/glm.pc.in"
|
||||
"glm.pc"
|
||||
@ONLY
|
||||
)
|
||||
|
||||
# install pkg-config file
|
||||
install(
|
||||
FILES "${CMAKE_CURRENT_BINARY_DIR}/glm.pc"
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig"
|
||||
)
|
||||
|
||||
export(PACKAGE glm)
|
||||
|
||||
Reference in New Issue
Block a user