0002-cmake-make-test-build-sensitive-to-BUILD_TESTING.patch 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. From 834c221936d9c460b44e3a65b6fedfb3193f491b Mon Sep 17 00:00:00 2001
  2. From: Samuel Martin <s.martin49@gmail.com>
  3. Date: Sat, 11 Jan 2014 21:33:12 +0100
  4. Subject: [PATCH 2/6] cmake: make test build sensitive to BUILD_TESTING
  5. This patch prevent from wasting time building the tests if it's our
  6. wish.
  7. The test build takes a significant amount of time, and the binaries
  8. are not installed.
  9. Signed-off-by: Samuel Martin <s.martin49@gmail.com>
  10. ---
  11. BLAS/TESTING/CMakeLists.txt | 3 +++
  12. CMakeLists.txt | 9 ++++++---
  13. TESTING/CMakeLists.txt | 4 ++++
  14. 3 files changed, 13 insertions(+), 3 deletions(-)
  15. diff --git a/BLAS/TESTING/CMakeLists.txt b/BLAS/TESTING/CMakeLists.txt
  16. index ec2c587..e7dc0b7 100644
  17. --- a/BLAS/TESTING/CMakeLists.txt
  18. +++ b/BLAS/TESTING/CMakeLists.txt
  19. @@ -25,6 +25,9 @@
  20. # make single FRC=FRC
  21. #
  22. #######################################################################
  23. +if(NOT BUILD_TESTING)
  24. + return()
  25. +endif()
  26. macro(add_blas_test name src)
  27. get_filename_component(baseNAME ${src} NAME_WE)
  28. diff --git a/CMakeLists.txt b/CMakeLists.txt
  29. index 320ccc6..0a362c0 100644
  30. --- a/CMakeLists.txt
  31. +++ b/CMakeLists.txt
  32. @@ -1,6 +1,5 @@
  33. cmake_minimum_required(VERSION 2.6)
  34. project(CLAPACK C)
  35. -enable_testing()
  36. include(CTest)
  37. if(WIN32 AND NOT CYGWIN)
  38. @@ -11,7 +10,9 @@ else()
  39. set(SECOND_SRC ${CLAPACK_SOURCE_DIR}/INSTALL/second.c)
  40. set(DSECOND_SRC ${CLAPACK_SOURCE_DIR}/INSTALL/dsecnd.c)
  41. endif()
  42. -enable_testing()
  43. +if(NOT BUILD_TESTING)
  44. + enable_testing()
  45. +endif()
  46. option(USE_BLAS_WRAP "pre-pend f2c_ to each function in blas" OFF)
  47. if(NOT USE_BLAS_WRAP)
  48. # _zrotg_ seems to be missing in the wrap header
  49. @@ -21,7 +22,9 @@ include_directories(${CLAPACK_SOURCE_DIR}/INCLUDE)
  50. add_subdirectory(F2CLIBS)
  51. add_subdirectory(BLAS)
  52. add_subdirectory(SRC)
  53. -add_subdirectory(TESTING)
  54. +if(NOT BUILD_TESTING)
  55. + add_subdirectory(TESTING)
  56. +endif()
  57. set(CLAPACK_VERSION 3.2.1)
  58. set(CPACK_PACKAGE_VERSION_MAJOR 3)
  59. set(CPACK_PACKAGE_VERSION_MINOR 2)
  60. diff --git a/TESTING/CMakeLists.txt b/TESTING/CMakeLists.txt
  61. index d59359d..f6b083a 100644
  62. --- a/TESTING/CMakeLists.txt
  63. +++ b/TESTING/CMakeLists.txt
  64. @@ -1,3 +1,7 @@
  65. +if(NOT BUILD_TESTING)
  66. + return()
  67. +endif()
  68. +
  69. if(MSVC_VERSION)
  70. # string(REPLACE "/STACK:10000000" "/STACK:900000000000000000"
  71. # CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
  72. --
  73. 1.8.5.3