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:
Wayne Stambaugh 2015-12-10 11:35:43 -05:00
parent 843c9b99d5
commit 204f025ff4
2 changed files with 26 additions and 30 deletions

View File

@ -411,12 +411,11 @@ include( ExternalProject )
#================================================ #================================================
include( CheckFindPackageResult ) include( CheckFindPackageResult )
####################### #################################
# Find OpenMP support # # Find OpenMP support, optional #
####################### #################################
find_package( OpenMP QUIET ) find_package( OpenMP )
check_find_package_result( OPENMP_FOUND "OpenMP" )
if( OPENMP_FOUND ) if( OPENMP_FOUND )
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}" ) set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}" )

View File

@ -1,22 +1,18 @@
if( ${CMAKE_MAJOR_VERSION} STREQUAL "2" AND ${CMAKE_MINOR_VERSION} STREQUAL "8" find_path( GLM_INCLUDE_DIR glm/glm.hpp
AND ( ${CMAKE_PATCH_VERSION} STREQUAL "2" OR ${CMAKE_PATCH_VERSION} STREQUAL "7" PATHS ${GLM_ROOT_DIR} $ENV{GLM_ROOT_DIR}
OR ${CMAKE_PATCH_VERSION} STREQUAL "10" ) ) DOC "GLM library header path."
)
message( FATAL_ERROR "\nThis version of CMake is known to not work\n" if( NOT ${GLM_INCLUDE_DIR} STREQUAL "GLM_INCLUDE_DIR-NOTFOUND" )
"Known bad versions: 2.8.2, 2.8.7, 2.8.10\n" )
endif()
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 # 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 # extract the "#define GLM_VERSION*" lines
file( STRINGS ${GLM_SETUP} _version REGEX "^#define.*GLM_VERSION.*" ) file( STRINGS ${GLM_SETUP} _version REGEX "^#define.*GLM_VERSION.*" )
@ -50,14 +46,15 @@ if( NOT ${GLM_INCLUDE_DIR} STREQUAL "" )
set( GLM_VERSION ${_GLM_VERSION_MAJOR}.${_GLM_VERSION_MINOR}.${_GLM_VERSION_PATCH}.${_GLM_VERSION_REVISION} ) set( GLM_VERSION ${_GLM_VERSION_MAJOR}.${_GLM_VERSION_MINOR}.${_GLM_VERSION_PATCH}.${_GLM_VERSION_REVISION} )
unset( GLM_SETUP CACHE ) unset( GLM_SETUP CACHE )
endif( GLM_SETUP ) endif()
endif()
endif( NOT ${GLM_INCLUDE_DIR} STREQUAL "" )
include( FindPackageHandleStandardArgs ) include( FindPackageHandleStandardArgs )
FIND_PACKAGE_HANDLE_STANDARD_ARGS( GLM FIND_PACKAGE_HANDLE_STANDARD_ARGS( GLM
REQUIRED_VARS GLM_INCLUDE_DIR REQUIRED_VARS
GLM_INCLUDE_DIR
GLM_VERSION
VERSION_VAR GLM_VERSION ) VERSION_VAR GLM_VERSION )