RunCMakeTest.cmake 975 B

1234567891011121314151617181920212223242526
  1. include(RunCMake)
  2. set(RunCMake_TEST_NO_CLEAN TRUE)
  3. set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/AutoExport-build")
  4. # start by cleaning up because we don't clean up along the way
  5. file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
  6. # configure the AutoExport test
  7. run_cmake(AutoExport)
  8. unset(RunCMake_TEST_OPTIONS)
  9. # don't run this test on Watcom or Borland make as it is not supported
  10. if("${RunCMake_GENERATOR}" MATCHES "Watcom WMake|Borland Makefiles")
  11. return()
  12. endif()
  13. # we build debug so the say.exe will be found in Debug/say.exe for
  14. # Visual Studio generators
  15. if(RunCMake_GENERATOR_IS_MULTI_CONFIG)
  16. set(INTDIR "Debug/")
  17. endif()
  18. # build AutoExport
  19. run_cmake_command(AutoExportBuild ${CMAKE_COMMAND} --build
  20. ${RunCMake_TEST_BINARY_DIR} --config Debug --clean-first)
  21. # run the executable that uses symbols from the dll
  22. if(WIN32)
  23. set(EXE_EXT ".exe")
  24. endif()
  25. run_cmake_command(AutoExportRun
  26. ${RunCMake_BINARY_DIR}/AutoExport-build/bin/${INTDIR}say${EXE_EXT})