@@ -24,6 +24,8 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
2424 set_property (CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo" "Coverage" )
2525endif ()
2626
27+ # Coverage
28+ set (_is_coverage_build 0)
2729set (_msg "Checking if build type is 'Coverage'" )
2830message (STATUS "${_msg} " )
2931if (NOT CMAKE_CONFIGURATION_TYPES )
@@ -108,16 +110,8 @@ if(CMAKE_Fortran_COMPILER_ID STREQUAL "Compaq")
108110 endif ()
109111endif ()
110112
111- # Get Python
112- message (STATUS "Looking for Python greater than 2.6 - ${PYTHONINTERP_FOUND} " )
113- find_package (PythonInterp 2.7) # lapack_testing.py uses features from python 2.7 and greater
114- if (PYTHONINTERP_FOUND)
115- message (STATUS "Using Python version ${PYTHON_VERSION_STRING} " )
116- else ()
117- message (STATUS "No suitable Python version found, so skipping summary tests." )
118- endif ()
119- # --------------------------------------------------
120113
114+ # --------------------------------------------------
121115set (LAPACK_INSTALL_EXPORT_NAME lapack-targets)
122116
123117macro (lapack_install_library lib)
@@ -133,12 +127,22 @@ set(PKG_CONFIG_DIR ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
133127
134128# --------------------------------------------------
135129# Testing
136- option (BUILD_TESTING "Build tests" OFF )
137- enable_testing ()
130+ option (BUILD_TESTING "Build tests" ${_is_coverage_build} )
138131include (CTest)
139- enable_testing ()
140132message (STATUS "Build tests: ${BUILD_TESTING} " )
141133
134+ # lapack_testing.py uses features from python 2.7 and greater
135+ if (BUILD_TESTING)
136+ set (_msg "Looking for Python >= 2.7 needed for summary tests" )
137+ message (STATUS "${_msg} " )
138+ find_package (PythonInterp 2.7 QUIET )
139+ if (PYTHONINTERP_FOUND)
140+ message (STATUS "${_msg} - found (${PYTHON_VERSION_STRING} )" )
141+ else ()
142+ message (STATUS "${_msg} - not found (skipping summary tests)" )
143+ endif ()
144+ endif ()
145+
142146# --------------------------------------------------
143147# Organize output files. On Windows this also keeps .dll files next
144148# to the .exe files that need them, making tests easy to run.
0 commit comments