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.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. PROJECT(openvibe-toolkit)
  2. OV_ADD_THIS_TO_PROJECT_LIST()
  3. SET(PROJECT_VERSION_MAJOR ${OV_GLOBAL_VERSION_MAJOR})
  4. SET(PROJECT_VERSION_MINOR ${OV_GLOBAL_VERSION_MINOR})
  5. SET(PROJECT_VERSION_PATCH ${OV_GLOBAL_VERSION_PATCH})
  6. SET(PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})
  7. # Command to generate cpp compliant stimulation files from text file
  8. # Creating output directories is mandatory as it is not handled by ADD_CUSTOM_COMMAND
  9. FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/toolkit)
  10. FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/src)
  11. ADD_CUSTOM_COMMAND(
  12. OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/include/toolkit/ovtk_stimulations.h ${CMAKE_CURRENT_BINARY_DIR}/src/ovtk_stimulations.cpp
  13. DEPENDS openvibe-stimulation-generator ${CMAKE_CURRENT_SOURCE_DIR}/share/stimulation_list.txt
  14. COMMAND openvibe-stimulation-generator
  15. --cpp
  16. ${CMAKE_CURRENT_SOURCE_DIR}/share/stimulation_list.txt
  17. ${CMAKE_CURRENT_BINARY_DIR}/include/toolkit/ovtk_stimulations.h
  18. ${CMAKE_CURRENT_BINARY_DIR}/src/ovtk_stimulations.cpp
  19. COMMENT "Generating stimulation sources..." )
  20. # ADD_CUSTOM_TARGET will automatically trigger the command defined above
  21. # as it depends on its outputs
  22. ADD_CUSTOM_TARGET(openvibe-generate-stimulation-file
  23. DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/include/toolkit/ovtk_stimulations.h ${CMAKE_CURRENT_BINARY_DIR}/src/ovtk_stimulations.cpp)
  24. FILE(GLOB_RECURSE SRC_FILES src/*.cpp src/*.h src/*.inl src/*.hpp include/*.h)
  25. INCLUDE("FindSourceRCProperties")
  26. INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include/)
  27. INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include/toolkit/algorithms/scenario-io)
  28. INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include/toolkit/algorithms/classification)
  29. INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include/toolkit/deprecated/writer)
  30. INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include/toolkit/deprecated/reader)
  31. INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include/toolkit/training)
  32. INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include/toolkit/tools)
  33. # add binary directory to includes as it contains generated stimulation header
  34. INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/include/)
  35. ADD_LIBRARY(${PROJECT_NAME} SHARED
  36. ${SRC_FILES}
  37. ${CMAKE_CURRENT_BINARY_DIR}/include/toolkit/ovtk_stimulations.h
  38. ${CMAKE_CURRENT_BINARY_DIR}/src/ovtk_stimulations.cpp
  39. )
  40. ADD_DEPENDENCIES(${PROJECT_NAME} openvibe-generate-stimulation-file)
  41. SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES
  42. VERSION ${PROJECT_VERSION}
  43. SOVERSION ${PROJECT_VERSION_MAJOR}
  44. FOLDER ${KERNEL_FOLDER}
  45. COMPILE_FLAGS "-DOVTK_Exports -DOVTK_Shared")
  46. # ---------------------------------
  47. INCLUDE("FindOpenViBE")
  48. INCLUDE("FindOpenViBECommon")
  49. INCLUDE("FindOpenViBEModuleEBML")
  50. INCLUDE("FindOpenViBEModuleXML")
  51. INCLUDE("FindOpenViBEModuleFS")
  52. INCLUDE("FindThirdPartyBoost_FileSystem")
  53. # ---------------------------------
  54. # Target macros
  55. # Defines target operating system, architecture and compiler
  56. # ---------------------------------
  57. SET_BUILD_PLATFORM()
  58. # -----------------------------
  59. # Install files
  60. # -----------------------------
  61. INSTALL(TARGETS ${PROJECT_NAME}
  62. RUNTIME DESTINATION ${DIST_BINDIR}
  63. LIBRARY DESTINATION ${DIST_LIBDIR}
  64. ARCHIVE DESTINATION ${DIST_LIBDIR})
  65. INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ ${CMAKE_CURRENT_BINARY_DIR}/include/ DESTINATION ${DIST_INCLUDEDIR} FILES_MATCHING PATTERN "*.h")
  66. INSTALL(DIRECTORY share/ DESTINATION ${DIST_DATADIR}/openvibe/toolkit PATTERN "*-base" EXCLUDE)