Automoc4Nightly.cmake 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. # This is a script for running a Nightly build of automoc4.
  2. # It is ready for testing.
  3. # To adapt it for other projects, basically only the KDE_CTEST_VCS_REPOSITORY variable
  4. # has to be changed.
  5. #
  6. # It uses the file KDECTestNightly.cmake, which is in KDE svn in kdesdk/cmake/modules/.
  7. # You need to have this file on some location on your system and then point the environment variable
  8. # KDECTESTNIGHTLY_DIR to the directory containing this file when running this script.
  9. #
  10. # For more details have a look at kdelibs/KDELibsNightly.cmake in KDE svn
  11. #
  12. # Alex <neundorf AT kde.org>
  13. # The VCS of KDE is "svn", also specify the repository
  14. set(KDE_CTEST_VCS svn)
  15. set(KDE_CTEST_VCS_REPOSITORY https://svn.kde.org/home/kde/trunk/kdesupport/automoc)
  16. # for now hardcode the generator to "Unix Makefiles"
  17. set(CTEST_CMAKE_GENERATOR "Unix Makefiles" )
  18. # set(CTEST_AVOID_SPACES FALSE)
  19. # generic support code, provides the kde_ctest_setup() macro, which sets up everything required:
  20. file(TO_CMAKE_PATH $ENV{KDECTESTNIGHTLY_DIR} KDECTESTNIGHTLY_DIR)
  21. include( "${KDECTESTNIGHTLY_DIR}/KDECTestNightly.cmake" OPTIONAL RESULT_VARIABLE fileIncluded)
  22. if(NOT fileIncluded)
  23. message(FATAL_ERROR "Did not find file ${KDECTESTNIGHTLY_DIR}/KDECTestNightly.cmake .
  24. Set the environment variable KDECTESTNIGHTLY_DIR to the directory where this file is located.
  25. In KDE svn it is in kdesdk/cmake/modules/ ")
  26. endif(NOT fileIncluded)
  27. # set up binary dir, source dir, etc.
  28. kde_ctest_setup("${CMAKE_CURRENT_LIST_FILE}")
  29. ctest_empty_binary_directory("${CTEST_BINARY_DIRECTORY}")
  30. ctest_start(Nightly)
  31. ctest_update(SOURCE "${CTEST_SOURCE_DIRECTORY}" )
  32. # read some settings
  33. include("${CTEST_SOURCE_DIRECTORY}/CTestConfig.cmake")
  34. include("${CTEST_SOURCE_DIRECTORY}/CTestCustom.cmake" OPTIONAL)
  35. # if CMAKE_INSTALL_PREFIX was defined on the command line, put it in the initial cache, so cmake gets it
  36. kde_ctest_write_initial_cache("${CTEST_BINARY_DIRECTORY}" CMAKE_INSTALL_PREFIX )
  37. # configure, build, test, submit
  38. ctest_configure(BUILD "${CTEST_BINARY_DIRECTORY}" )
  39. ctest_build(BUILD "${CTEST_BINARY_DIRECTORY}" )
  40. ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}" )
  41. ctest_submit()
  42. # optionally install afterwards, so additional nightly builds can use this current install
  43. # (e.g. kdepimlibs could use this kdelibs install)
  44. if(DO_INSTALL)
  45. kde_ctest_install( "${CTEST_BINARY_DIRECTORY}" )
  46. endif(DO_INSTALL)