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 2.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. PROJECT(openvibe-kernel)
  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. FILE(GLOB_RECURSE SRC_FILES src/*.cpp src/*.h src/*.hpp src/*.inl)
  8. INCLUDE("FindSourceDependencyLepton")
  9. INCLUDE("FindSourceRCProperties")
  10. ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRC_FILES})
  11. SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES
  12. VERSION ${PROJECT_VERSION}
  13. SOVERSION ${PROJECT_VERSION_MAJOR}
  14. FOLDER ${KERNEL_FOLDER}
  15. COMPILE_FLAGS "-DOVK_Exports -DOVK_Shared")
  16. INCLUDE("FindOpenViBE")
  17. INCLUDE("FindOpenViBECommon")
  18. INCLUDE("FindOpenViBEModuleFS")
  19. INCLUDE("FindOpenViBEModuleSystem")
  20. INCLUDE("FindOpenViBEModuleXML")
  21. INCLUDE("FindThirdPartyBoost")
  22. # ---------------------------------
  23. # Finds standard library dl
  24. # Adds library to target
  25. # Adds include path
  26. # ---------------------------------
  27. IF(UNIX)
  28. FIND_LIBRARY(LIB_STANDARD_MODULE_DL dl)
  29. IF(LIB_STANDARD_MODULE_DL)
  30. MESSAGE(STATUS " Found dl...")
  31. TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LIB_STANDARD_MODULE_DL})
  32. ELSE(LIB_STANDARD_MODULE_PTHREAD)
  33. MESSAGE(STATUS " FAILED to find dl...")
  34. ENDIF(LIB_STANDARD_MODULE_DL)
  35. ENDIF(UNIX)
  36. # ---------------------------------
  37. # Finds standard library pthread
  38. # Adds library to target
  39. # Adds include path
  40. # ---------------------------------
  41. IF(UNIX)
  42. FIND_LIBRARY(LIB_STANDARD_MODULE_PTHREAD pthread)
  43. IF(LIB_STANDARD_MODULE_PTHREAD)
  44. MESSAGE(STATUS " Found pthread...")
  45. TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LIB_STANDARD_MODULE_PTHREAD})
  46. ELSE(LIB_STANDARD_MODULE_PTHREAD)
  47. MESSAGE(STATUS " FAILED to find pthread...")
  48. ENDIF(LIB_STANDARD_MODULE_PTHREAD)
  49. ENDIF(UNIX)
  50. # ---------------------------------
  51. # Target macros
  52. # Defines target operating system, architecture and compiler
  53. # ---------------------------------
  54. SET_BUILD_PLATFORM()
  55. # -----------------------------
  56. # Install files
  57. # -----------------------------
  58. INSTALL(TARGETS ${PROJECT_NAME}
  59. RUNTIME DESTINATION ${DIST_BINDIR}
  60. LIBRARY DESTINATION ${DIST_LIBDIR}
  61. ARCHIVE DESTINATION ${DIST_LIBDIR})
  62. INSTALL(DIRECTORY share/ DESTINATION ${DIST_DATADIR}/openvibe/kernel PATTERN "*-base" EXCLUDE)
  63. # -----------------------------
  64. # Install and configure .conf
  65. # -----------------------------
  66. # This construct is to fetch the documentation specific to this version.
  67. # In addition, it tweaks the patch version to allow the "1.0.0+git" style version to
  68. # fetch the "1.0.0" (base) version documentation as we don't have git version docs on the web.
  69. STRING(REGEX REPLACE "[^0-9]" "" PROJECT_VERSION_PATCH_PRUNED ${PROJECT_VERSION_PATCH})
  70. SET(OV_PROJECT_BASE_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH_PRUNED})