Patch.cmake 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. if(NOT DEFINED source_dir)
  2. message(FATAL_ERROR "variable 'source_dir' not defined")
  3. endif()
  4. if(NOT EXISTS "${source_dir}/CMakeLists.txt")
  5. message(FATAL_ERROR "error: No CMakeLists.txt file to patch!")
  6. endif()
  7. set(text "
  8. #
  9. # Reference variables typically given as experimental_build_test configure
  10. # options to avoid CMake warnings about unused variables
  11. #
  12. message(\"Trilinos_ALLOW_NO_PACKAGES='\${Trilinos_ALLOW_NO_PACKAGES}'\")
  13. message(\"Trilinos_WARNINGS_AS_ERRORS_FLAGS='\${Trilinos_WARNINGS_AS_ERRORS_FLAGS}'\")
  14. ")
  15. file(APPEND "${source_dir}/CMakeLists.txt" "${text}")
  16. if(NOT EXISTS "${source_dir}/CTestConfig.cmake")
  17. message(FATAL_ERROR "error: No CTestConfig.cmake file to patch!")
  18. endif()
  19. set(text "
  20. #
  21. # Use newer than 10.6.1 CTestConfig settings from the Trilinos project.
  22. # Send the Trilinos dashboards to the new Trilinos CDash server instance.
  23. #
  24. set(CTEST_NIGHTLY_START_TIME \"04:00:00 UTC\") # 10 PM MDT or 9 PM MST
  25. set(CTEST_DROP_SITE \"testing.sandia.gov\")
  26. ")
  27. file(APPEND "${source_dir}/CTestConfig.cmake" "${text}")