From 92480ffd265475a25070b8ea9dfbc8536d038378 Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Sun, 27 Sep 2009 17:48:53 -0400 Subject: * Introduce make targets btest (build tests), blas (build blas lib), demos (build demos). * remove EIGEN_BUILD_TESTS and siblings * add summary at the end of cmake run, hopefully not too verbose * fix build of quaternion demo * kill remnants of old binary library option --- demos/CMakeLists.txt | 10 ++++++++-- demos/mandelbrot/CMakeLists.txt | 1 + demos/mix_eigen_and_c/README | 4 +++- demos/opengl/CMakeLists.txt | 2 +- demos/opengl/camera.cpp | 2 +- 5 files changed, 14 insertions(+), 5 deletions(-) (limited to 'demos') diff --git a/demos/CMakeLists.txt b/demos/CMakeLists.txt index 4e8f5164f..1ec49d13e 100644 --- a/demos/CMakeLists.txt +++ b/demos/CMakeLists.txt @@ -1,3 +1,9 @@ +add_custom_target(demos) -add_subdirectory(mandelbrot) -add_subdirectory(opengl) +find_package(Qt4) +if(QT4_FOUND) + add_subdirectory(mandelbrot) + add_subdirectory(opengl) +else(QT4_FOUND) + message(STATUS "Qt4 not found, so disabling the mandelbrot and opengl demos") +endif(QT4_FOUND) diff --git a/demos/mandelbrot/CMakeLists.txt b/demos/mandelbrot/CMakeLists.txt index d34b60a54..5c500e064 100644 --- a/demos/mandelbrot/CMakeLists.txt +++ b/demos/mandelbrot/CMakeLists.txt @@ -16,5 +16,6 @@ set(mandelbrot_SRCS qt4_automoc(${mandelbrot_SRCS}) add_executable(mandelbrot ${mandelbrot_SRCS}) +add_dependencies(demos mandelbrot) target_link_libraries(mandelbrot ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY}) diff --git a/demos/mix_eigen_and_c/README b/demos/mix_eigen_and_c/README index d543f8d99..21dba8679 100644 --- a/demos/mix_eigen_and_c/README +++ b/demos/mix_eigen_and_c/README @@ -1,7 +1,9 @@ +This is an example of how one can wrap some of Eigen into a C library. + To try this with GCC, do: g++ -c binary_library.cpp -O2 -msse2 -I ../.. gcc example.c binary_library.o -o example -lstdc++ ./example -This is an example of how one can wrap some of Eigen into a C library. +TODO: add CMakeLists, add more explanations here \ No newline at end of file diff --git a/demos/opengl/CMakeLists.txt b/demos/opengl/CMakeLists.txt index 968ed6cb4..b98a30c01 100644 --- a/demos/opengl/CMakeLists.txt +++ b/demos/opengl/CMakeLists.txt @@ -1,4 +1,3 @@ - find_package(Qt4 REQUIRED) find_package(OpenGL REQUIRED) @@ -14,6 +13,7 @@ set(quaternion_demo_SRCS gpuhelper.cpp icosphere.cpp camera.cpp trackball.cpp q qt4_automoc(${quaternion_demo_SRCS}) add_executable(quaternion_demo ${quaternion_demo_SRCS}) +add_dependencies(demos quaternion_demo) target_link_libraries(quaternion_demo ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} diff --git a/demos/opengl/camera.cpp b/demos/opengl/camera.cpp index a785caf78..26598522e 100644 --- a/demos/opengl/camera.cpp +++ b/demos/opengl/camera.cpp @@ -260,7 +260,7 @@ void Camera::activateGL(void) Vector3f Camera::unProject(const Vector2f& uv, float depth) const { - Matrix4f inv = mViewMatrix.inverse(); + Matrix4f inv = mViewMatrix.inverse().matrix(); return unProject(uv, depth, inv); } -- cgit v1.2.3