You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CMakeLists.txt 3.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. PROJECT(OpenViBESDKTest)
  2. # ------------------
  3. # Project variables
  4. # ------------------
  5. SET(OVT_GLOBAL_VERSION_MAJOR 0)
  6. SET(OVT_GLOBAL_VERSION_MINOR 1)
  7. SET(OVT_GLOBAL_VERSION_PATCH 0)
  8. SET(OVT_GLOBAL_VERSION_STRING "${OVT_GLOBAL_VERSION_MAJOR}.${OVT_GLOBAL_VERSION_MINOR}.${OVT_GLOBAL_VERSION_PATCH}")
  9. IF(NOT DEFINED OVT_TEST_DATA_DIR)
  10. MESSAGE(FATAL_ERROR "Path to tests input data files is not set")
  11. ENDIF()
  12. # ---------------------
  13. # Project dependencies
  14. # ---------------------
  15. # Add some search directory to module path
  16. SET(OVT_CMAKE_DIR ${OV_BASE_DIR}/cmake-modules)
  17. SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${OVT_CMAKE_DIR})
  18. # Modify library prefixes and suffixes to comply to Windows or Linux naming
  19. IF(WIN32)
  20. SET(CMAKE_FIND_LIBRARY_PREFIXES "")
  21. SET(CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll")
  22. ELSEIF(APPLE)
  23. SET(CMAKE_FIND_LIBRARY_PREFIXES "lib")
  24. SET(CMAKE_FIND_LIBRARY_SUFFIXES ".dylib" ".a")
  25. ELSE()
  26. SET(CMAKE_FIND_LIBRARY_PREFIXES "lib")
  27. SET(CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".a")
  28. ENDIF()
  29. SET(GTEST_ROOT ${OV_CUSTOM_DEPENDENCIES_PATH}/${CMAKE_FIND_LIBRARY_PREFIXES}gtest)
  30. FIND_PACKAGE(GTest REQUIRED)
  31. INCLUDE_DIRECTORIES(${GTEST_INCLUDE_DIRS})
  32. # --------------------
  33. # Test configuration
  34. # --------------------
  35. # On Windows and Linux, some environment setting scripts are needed to ease the testing process
  36. SET(OVT_SCRIPT_DIR ${OV_BASE_BIN_DIR}/scripts)
  37. IF(WIN32)
  38. # Wrapper script that set the environment and launch ctest
  39. # It is located at build directory root to be as close as possible as standard ctest use
  40. CONFIGURE_FILE(${OV_BASE_DIR}/scripts/windows-ctest-launcher.cmd-base
  41. ${OV_BASE_BIN_DIR}/ctest-launcher.cmd)
  42. ELSEIF(UNIX)
  43. # Wrapper script that set the environment and launch ctest
  44. # It is located at build directory root to be as close as possible as standard ctest use
  45. CONFIGURE_FILE(${OV_BASE_DIR}/scripts/unix-ctest-launcher.sh-base
  46. ${OV_BASE_BIN_DIR}/ctest-launcher.sh)
  47. ENDIF()
  48. # ${PROJECT_BINARY_DIR}/Testing/Temporary is automatically created by CTest for log files
  49. # We create a temporary subdir for our test that will be create before each test is run
  50. # and removed afterwards (see CTestCustom.cmake.in)
  51. SET(OVT_TEST_TEMPORARY_DIR ${OV_BASE_BIN_DIR}/Testing/Temporary/OVT/)
  52. # Create test data directory for big or binary files
  53. FILE(MAKE_DIRECTORY ${OVT_TEST_DATA_DIR})
  54. # Ctest custom options
  55. CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/CTestCustom.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/CTestCustom.cmake @ONLY)
  56. # Memcheck configuration
  57. IF(UNIX)
  58. FIND_PROGRAM(MEMORYCHECK_COMMAND valgrind /usr/bin/valgrind)
  59. FILE(TO_CMAKE_PATH "${CMAKE_SOURCE_DIR}/data/resources/valgrind.supp" MEMORYCHECK_SUPPRESSIONS_FILE)
  60. SET(MEMORYCHECK_COMMAND_OPTIONS "--trace-children=yes --leak-check=full --run-libc-freeres=no --show-possibly-lost=no" )
  61. ELSEIF(WIN32)
  62. FIND_PROGRAM(MEMORYCHECK_COMMAND purify "C:/Program Files (x86)/")
  63. ENDIF()
  64. # Timeout must be set first
  65. SET (DART_TESTING_TIMEOUT 72000 CACHE STRING "Maximum time allowed before CTest will kill the test." FORCE)
  66. INCLUDE(CTest)
  67. ENABLE_TESTING()
  68. # Utility variable for subproject
  69. SET(OVT_OPENVIBE_DATA ${CMAKE_CURRENT_BINARY_DIR}/data/openvibe)
  70. # ----------------------
  71. # CMake tree processing
  72. # ----------------------
  73. # Process tools first.
  74. # Some important variables are defined within tools projects for their use by other
  75. # projects as:
  76. # - OVT_UNIT_TOOLKIT_INCLUDE_DIR
  77. # - OVT_UNIT_TOOLKIT_TARGET_FILE
  78. # - OVT_ACCURACY_TARGET_FILE
  79. ADD_SUBDIRECTORY(unit-toolkit)
  80. INCLUDE_DIRECTORIES(${OVT_UNIT_TOOLKIT_INCLUDE_DIR})
  81. # Process unit tests
  82. # When adding a new test driver, driver directory must be added here
  83. ADD_SUBDIRECTORY(ov-base)
  84. ADD_SUBDIRECTORY(openvibe-module-csv)
  85. ADD_SUBDIRECTORY(openvibe-module-fs)
  86. ADD_SUBDIRECTORY(openvibe-module-ebml)
  87. ADD_SUBDIRECTORY(openvibe-module-xml)
  88. ADD_SUBDIRECTORY(openvibe-module-socket)
  89. ADD_SUBDIRECTORY(openvibe-module-system)
  90. ADD_SUBDIRECTORY(openvibe-toolkit)
  91. ADD_SUBDIRECTORY(openvibe-kernel)
  92. ADD_SUBDIRECTORY(openvibe-plugin-stream-codecs)