From cc485cb4c11e3505c286760fdf6d8fc7a8b9aa85 Mon Sep 17 00:00:00 2001 From: Bob Kuehne Date: Tue, 15 Feb 2011 12:25:21 -0500 Subject: [PATCH 1/2] added proper cmake test infrastructure --- CMakeLists.txt | 12 ++++++++---- test/CMakeLists.txt | 6 ++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 07e3e428..8e1262f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 2.6 FATAL_ERROR) cmake_policy(VERSION 2.6) project(glm) +enable_testing() add_definitions(-D_CRT_SECURE_NO_WARNINGS) #add_definitions(-S) @@ -14,12 +15,15 @@ add_definitions(-D_CRT_SECURE_NO_WARNINGS) include_directories(".") + add_subdirectory(glm) add_subdirectory(test) add_subdirectory(bench) add_subdirectory(doc) -option(GLM_DEVELOPMENT_MODE "GLM development" OFF) -if(NOT GLM_DEVELOPMENT_MODE) - message(FATAL_ERROR "GLM is a header only library, no need to build it") -endif() +# option(GLM_DEVELOPMENT_MODE "GLM development" OFF) +# if(NOT GLM_DEVELOPMENT_MODE) +# message(FATAL_ERROR "GLM is a header only library, no need to build it") +# endif() + +install( DIRECTORY glm DESTINATION include ) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index c41aeb62..8b809b54 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,8 +1,10 @@ function(glmCreateTestGTC NAME) set(SAMPLE_NAME test-${NAME}) - add_executable(${SAMPLE_NAME} ${NAME}.cpp ../test.hpp ../test.cpp) -endfunction(glmCreateTestGTC) + add_test( + NAME ${SAMPLE_NAME} + COMMAND $ ) +endfunction() add_subdirectory(bug) add_subdirectory(core) From ba910c7be252909b7acad7f46cb7fa13ad88dc39 Mon Sep 17 00:00:00 2001 From: Bob Kuehne Date: Tue, 15 Feb 2011 12:34:39 -0500 Subject: [PATCH 2/2] fixes for linux --- glm/core/_detail.hpp | 2 +- glm/gtc/matrix_transform.inl | 4 ++-- glm/gtc/quaternion.inl | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/glm/core/_detail.hpp b/glm/core/_detail.hpp index 7cdc2ed0..16124b41 100644 --- a/glm/core/_detail.hpp +++ b/glm/core/_detail.hpp @@ -327,7 +327,7 @@ namespace detail # define GLM_RESTRICT_VAR __restrict #elif((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC31)) # define GLM_DEPRECATED __attribute__((__deprecated__)) -# define GLM_ALIGN(x) __attribute__((aligned(x))) +# define GLM_ALIGN(x) __attribute__((aligned(x))) # if(GLM_COMPILER >= GLM_COMPILER_GCC33) # define GLM_RESTRICT __restrict__ # define GLM_RESTRICT_VAR __restrict__ diff --git a/glm/gtc/matrix_transform.inl b/glm/gtc/matrix_transform.inl index b8e79ca2..b063c363 100644 --- a/glm/gtc/matrix_transform.inl +++ b/glm/gtc/matrix_transform.inl @@ -332,14 +332,14 @@ namespace matrix_transform detail::tvec4 const & viewport ) { - assert(delta.x > 0.0f && delta.y > 0.0f) + assert(delta.x > 0.0f && delta.y > 0.0f); detail::tmat4x4 Result(1.0f); if(!(delta.x > 0.0f && delta.y > 0.0f)) return Result; // Error // Translate and scale the picked region to the entire window - Result = translate(Result, (T(viewport[2]) - T(2) * (x - T(viewport[0]))) / delta.x, (T(viewport[3]) - T(2) * (y - T(viewport[1]))) / delta.y, T(0)); + Result = translate(Result, (T(viewport[2]) - T(2) * (center.x - T(viewport[0]))) / delta.x, (T(viewport[3]) - T(2) * (center.y - T(viewport[1]))) / delta.y, T(0)); return scale(Result, T(viewport[2]) / delta.x, T(viewport[3]) / delta.y, T(1)); } diff --git a/glm/gtc/quaternion.inl b/glm/gtc/quaternion.inl index 32577b77..2dbca071 100644 --- a/glm/gtc/quaternion.inl +++ b/glm/gtc/quaternion.inl @@ -403,7 +403,7 @@ namespace quaternion{ if(flip) alpha = -alpha; - return normalize(beta * x + alpha * y2); + return normalize(beta * x + alpha * y); } template