Build configuration fixes.
* Fix broken include path in FindGLM.cmake ( credit Cirilo Bernardo ). * Fix if()/endif() warning in FindGLM.cmake. * Remove trailing white space in FindGLM.cmake. * Fix bug introduced in r6363 that inadvertently made OpenMP a required dependency instead of an optional dependency. * Remove quiet flag for FindOpenMP to report findings.
This commit is contained in:
parent
843c9b99d5
commit
204f025ff4
|
@ -411,12 +411,11 @@ include( ExternalProject )
|
|||
#================================================
|
||||
include( CheckFindPackageResult )
|
||||
|
||||
#######################
|
||||
# Find OpenMP support #
|
||||
#######################
|
||||
#################################
|
||||
# Find OpenMP support, optional #
|
||||
#################################
|
||||
|
||||
find_package( OpenMP QUIET )
|
||||
check_find_package_result( OPENMP_FOUND "OpenMP" )
|
||||
find_package( OpenMP )
|
||||
|
||||
if( OPENMP_FOUND )
|
||||
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}" )
|
||||
|
|
|
@ -1,35 +1,31 @@
|
|||
if( ${CMAKE_MAJOR_VERSION} STREQUAL "2" AND ${CMAKE_MINOR_VERSION} STREQUAL "8"
|
||||
AND ( ${CMAKE_PATCH_VERSION} STREQUAL "2" OR ${CMAKE_PATCH_VERSION} STREQUAL "7"
|
||||
OR ${CMAKE_PATCH_VERSION} STREQUAL "10" ) )
|
||||
|
||||
message( FATAL_ERROR "\nThis version of CMake is known to not work\n"
|
||||
"Known bad versions: 2.8.2, 2.8.7, 2.8.10\n" )
|
||||
|
||||
endif()
|
||||
find_path( GLM_INCLUDE_DIR glm/glm.hpp
|
||||
PATHS ${GLM_ROOT_DIR} $ENV{GLM_ROOT_DIR}
|
||||
DOC "GLM library header path."
|
||||
)
|
||||
|
||||
if( NOT ${GLM_INCLUDE_DIR} STREQUAL "GLM_INCLUDE_DIR-NOTFOUND" )
|
||||
|
||||
find_path( GLM_INCLUDE_DIR glm.hpp PATH_SUFFIXES glm )
|
||||
|
||||
|
||||
if( NOT ${GLM_INCLUDE_DIR} STREQUAL "" )
|
||||
|
||||
# attempt to extract the GLM Version information from setup.hpp
|
||||
find_file( GLM_SETUP setup.hpp PATHS ${GLM_INCLUDE_DIR} PATH_SUFFIXES core detail NO_DEFAULT_PATH )
|
||||
find_file( GLM_SETUP setup.hpp
|
||||
PATHS ${GLM_INCLUDE_DIR}
|
||||
PATH_SUFFIXES glm/core glm/detail
|
||||
NO_DEFAULT_PATH )
|
||||
|
||||
if( NOT ${GLM_SETUP} STREQUAL "GLM_SETUP-NOTFOUND" )
|
||||
|
||||
if( GLM_SETUP )
|
||||
# extract the "#define GLM_VERSION*" lines
|
||||
file( STRINGS ${GLM_SETUP} _version REGEX "^#define.*GLM_VERSION.*" )
|
||||
|
||||
|
||||
foreach( SVAR ${_version} )
|
||||
string( REGEX MATCH GLM_VERSION_[M,A,J,O,R,I,N,P,T,C,H,E,V,I,S]* _VARNAME ${SVAR} )
|
||||
string( REGEX MATCH [0-9]+ _VALUE ${SVAR} )
|
||||
|
||||
|
||||
if( NOT ${_VARNAME} STREQUAL "" AND NOT ${_VALUE} STREQUAL "" )
|
||||
set( _${_VARNAME} ${_VALUE} )
|
||||
endif()
|
||||
|
||||
|
||||
endforeach()
|
||||
|
||||
|
||||
#ensure that NOT GLM_VERSION* will evaluate to '0'
|
||||
if( NOT _GLM_VERSION_MAJOR )
|
||||
set( _GLM_VERSION_MAJOR 0 )
|
||||
|
@ -49,18 +45,19 @@ if( NOT ${GLM_INCLUDE_DIR} STREQUAL "" )
|
|||
|
||||
set( GLM_VERSION ${_GLM_VERSION_MAJOR}.${_GLM_VERSION_MINOR}.${_GLM_VERSION_PATCH}.${_GLM_VERSION_REVISION} )
|
||||
unset( GLM_SETUP CACHE )
|
||||
|
||||
endif( GLM_SETUP )
|
||||
|
||||
endif( NOT ${GLM_INCLUDE_DIR} STREQUAL "" )
|
||||
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
include( FindPackageHandleStandardArgs )
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS( GLM
|
||||
REQUIRED_VARS GLM_INCLUDE_DIR
|
||||
REQUIRED_VARS
|
||||
GLM_INCLUDE_DIR
|
||||
GLM_VERSION
|
||||
VERSION_VAR GLM_VERSION )
|
||||
|
||||
|
||||
|
||||
mark_as_advanced( GLM_INCLUDE_DIR )
|
||||
set( GLM_VERSION_MAJOR ${_GLM_VERSION_MAJOR} CACHE INTERNAL "" )
|
||||
set( GLM_VERSION_MINOR ${_GLM_VERSION_MINOR} CACHE INTERNAL "" )
|
||||
|
|
Loading…
Reference in New Issue