aboutsummaryrefslogtreecommitdiffhomepage
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt51
1 files changed, 26 insertions, 25 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7237b54df..fe4227cbb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -28,7 +28,7 @@ endif()
#############################################################################
-# retrieve version infomation #
+# retrieve version information #
#############################################################################
# automatically parse the version number
@@ -416,16 +416,15 @@ add_subdirectory(Eigen)
add_subdirectory(doc EXCLUDE_FROM_ALL)
-include(EigenConfigureTesting)
+option(BUILD_TESTING "Enable creation of Eigen tests." ON)
+if(BUILD_TESTING)
+ 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
-else()
- add_subdirectory(test EXCLUDE_FROM_ALL)
+ if(EIGEN_LEAVE_TEST_IN_ALL_TARGET)
+ add_subdirectory(test) # can't do EXCLUDE_FROM_ALL here, breaks CTest
+ else()
+ add_subdirectory(test EXCLUDE_FROM_ALL)
+ endif()
endif()
if(EIGEN_LEAVE_TEST_IN_ALL_TARGET)
@@ -461,7 +460,9 @@ endif(NOT WIN32)
configure_file(scripts/cdashtesting.cmake.in cdashtesting.cmake @ONLY)
-ei_testing_print_summary()
+if(BUILD_TESTING)
+ ei_testing_print_summary()
+endif()
message(STATUS "")
message(STATUS "Configured Eigen ${EIGEN_VERSION_NUMBER}")
@@ -541,7 +542,8 @@ if (NOT CMAKE_VERSION VERSION_LESS 3.0)
set (_Eigen3_CMAKE_SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P})
unset (CMAKE_SIZEOF_VOID_P)
write_basic_package_version_file (Eigen3ConfigVersion.cmake
- VERSION ${EIGEN_VERSION_NUMBER} COMPATIBILITY SameMajorVersion)
+ VERSION ${EIGEN_VERSION_NUMBER}
+ COMPATIBILITY SameMajorVersion)
set (CMAKE_SIZEOF_VOID_P ${_Eigen3_CMAKE_SIZEOF_VOID_P})
# The Eigen target will be located in the Eigen3 namespace. Other CMake
@@ -551,13 +553,8 @@ if (NOT CMAKE_VERSION VERSION_LESS 3.0)
# CMake even if it has not been installed to a standard directory.
export (PACKAGE Eigen3)
- install (EXPORT Eigen3Targets NAMESPACE Eigen3:: DESTINATION
- ${CMAKEPACKAGE_INSTALL_DIR})
- install (FILES
- ${CMAKE_CURRENT_BINARY_DIR}/Eigen3Config.cmake
- ${CMAKE_CURRENT_BINARY_DIR}/Eigen3ConfigVersion.cmake
- ${CMAKE_CURRENT_SOURCE_DIR}/cmake/UseEigen3.cmake
- DESTINATION ${CMAKEPACKAGE_INSTALL_DIR})
+ install (EXPORT Eigen3Targets NAMESPACE Eigen3:: DESTINATION ${CMAKEPACKAGE_INSTALL_DIR})
+
else (NOT CMAKE_VERSION VERSION_LESS 3.0)
# Fallback to legacy Eigen3Config.cmake without the imported target
@@ -581,16 +578,20 @@ else (NOT CMAKE_VERSION VERSION_LESS 3.0)
set(PACKAGE_EIGEN_ROOT_DIR ${EIGEN_ROOT_DIR})
configure_file ( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Eigen3ConfigLegacy.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/Eigen3Config.cmake
- @ONLY ESCAPE_QUOTES
- )
+ @ONLY ESCAPE_QUOTES )
endif()
- install ( FILES ${CMAKE_CURRENT_SOURCE_DIR}/cmake/UseEigen3.cmake
- ${CMAKE_CURRENT_BINARY_DIR}/Eigen3Config.cmake
- DESTINATION ${CMAKEPACKAGE_INSTALL_DIR}
- )
+ write_basic_package_version_file( Eigen3ConfigVersion.cmake
+ VERSION ${EIGEN_VERSION_NUMBER}
+ COMPATIBILITY SameMajorVersion )
+
endif (NOT CMAKE_VERSION VERSION_LESS 3.0)
+install ( FILES ${CMAKE_CURRENT_SOURCE_DIR}/cmake/UseEigen3.cmake
+ ${CMAKE_CURRENT_BINARY_DIR}/Eigen3Config.cmake
+ ${CMAKE_CURRENT_BINARY_DIR}/Eigen3ConfigVersion.cmake
+ DESTINATION ${CMAKEPACKAGE_INSTALL_DIR} )
+
# Add uninstall target
add_custom_target ( uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/EigenUninstall.cmake)