aboutsummaryrefslogtreecommitdiffhomepage
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt39
1 files changed, 29 insertions, 10 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b79ec4715..fad8f0979 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -103,6 +103,8 @@ endif()
add_definitions("-DEIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS")
+set(EIGEN_TEST_MAX_SIZE "320" CACHE STRING "Maximal matrix/vector size, default is 320")
+
if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -fexceptions -fno-check-new -fno-common -fstrict-aliasing")
set(CMAKE_CXX_FLAGS_DEBUG "-g3")
@@ -207,6 +209,7 @@ endif(MSVC)
option(EIGEN_TEST_NO_EXPLICIT_VECTORIZATION "Disable explicit vectorization in tests/examples" OFF)
option(EIGEN_TEST_X87 "Force using X87 instructions. Implies no vectorization." OFF)
+option(EIGEN_TEST_32BIT "Force generating 32bit code." OFF)
if(EIGEN_TEST_X87)
set(EIGEN_TEST_NO_EXPLICIT_VECTORIZATION ON)
@@ -218,6 +221,15 @@ if(EIGEN_TEST_X87)
endif()
endif()
+if(EIGEN_TEST_32BIT)
+ if(CMAKE_COMPILER_IS_GNUCXX)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32")
+ message(STATUS "Forcing generation of 32-bit code in tests/examples")
+ else()
+ message(STATUS "EIGEN_TEST_32BIT ignored on your compiler")
+ endif()
+endif()
+
if(EIGEN_TEST_NO_EXPLICIT_VECTORIZATION)
add_definitions(-DEIGEN_DONT_VECTORIZE=1)
message(STATUS "Disabling vectorization in tests/examples")
@@ -269,9 +281,15 @@ install(FILES
)
if(EIGEN_BUILD_PKGCONFIG)
+ SET(path_separator ":")
+ STRING(REPLACE ${path_separator} ";" pkg_config_libdir_search "$ENV{PKG_CONFIG_LIBDIR}")
+ message(STATUS "searching for 'pkgconfig' directory in PKG_CONFIG_LIBDIR ( $ENV{PKG_CONFIG_LIBDIR} ), ${CMAKE_INSTALL_PREFIX}/share, and ${CMAKE_INSTALL_PREFIX}/lib")
+ FIND_PATH(pkg_config_libdir pkgconfig ${pkg_config_libdir_search} ${CMAKE_INSTALL_PREFIX}/share ${CMAKE_INSTALL_PREFIX}/lib ${pkg_config_libdir_search})
+ message(STATUS "found ${pkg_config_libdir}/pkgconfig" )
+
configure_file(eigen3.pc.in eigen3.pc)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/eigen3.pc
- DESTINATION share/pkgconfig
+ DESTINATION ${pkg_config_libdir}/pkgconfig
)
endif(EIGEN_BUILD_PKGCONFIG)
@@ -280,6 +298,9 @@ add_subdirectory(Eigen)
add_subdirectory(doc EXCLUDE_FROM_ALL)
include(EigenConfigureTesting)
+# fixme, not sure this line is still needed:
+enable_testing() # must be called from the root CMakeLists, see man page
+
if(EIGEN_LEAVE_TEST_IN_ALL_TARGET)
add_subdirectory(test) # can't do EXCLUDE_FROM_ALL here, breaks CTest
@@ -287,15 +308,13 @@ else()
add_subdirectory(test EXCLUDE_FROM_ALL)
endif()
-if(NOT MSVC)
- if(EIGEN_LEAVE_TEST_IN_ALL_TARGET)
- add_subdirectory(blas)
- add_subdirectory(lapack)
- else()
- add_subdirectory(blas EXCLUDE_FROM_ALL)
- add_subdirectory(lapack EXCLUDE_FROM_ALL)
- endif()
-endif(NOT MSVC)
+if(EIGEN_LEAVE_TEST_IN_ALL_TARGET)
+ add_subdirectory(blas)
+ add_subdirectory(lapack)
+else()
+ add_subdirectory(blas EXCLUDE_FROM_ALL)
+ add_subdirectory(lapack EXCLUDE_FROM_ALL)
+endif()
add_subdirectory(unsupported)