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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. PROJECT(openvibe-module-system)
  2. SET(PROJECT_VERSION_MAJOR ${OV_GLOBAL_VERSION_MAJOR})
  3. SET(PROJECT_VERSION_MINOR ${OV_GLOBAL_VERSION_MINOR})
  4. SET(PROJECT_VERSION_PATCH ${OV_GLOBAL_VERSION_PATCH})
  5. SET(PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})
  6. SET(SRC_FILES
  7. include/system/defines.h
  8. include/system/ovCChrono.h
  9. include/system/ovCMath.h
  10. include/system/ovCMemory.h
  11. include/system/ovCTime.h
  12. include/system/ovCDynamicModule.h
  13. src/ovCChrono.cpp
  14. src/ovCMath.cpp
  15. src/ovCMemory.cpp
  16. src/ovCTime.cpp
  17. src/ovCDynamicModule.cpp
  18. )
  19. IF(WIN32)
  20. LIST(APPEND SRC_FILES
  21. "include/system/WindowsUtilities.h"
  22. "src/WindowsUtilities.cpp"
  23. )
  24. ENDIF()
  25. INCLUDE_DIRECTORIES(include)
  26. INCLUDE("FindSourceRCProperties")
  27. ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRC_FILES})
  28. SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES
  29. VERSION ${PROJECT_VERSION}
  30. SOVERSION ${PROJECT_VERSION_MAJOR}
  31. FOLDER ${MODULES_FOLDER}
  32. COMPILE_FLAGS "-DSystem_Shared -DSystem_Exports")
  33. ADD_LIBRARY(${PROJECT_NAME}-static STATIC ${SRC_FILES})
  34. SET_TARGET_PROPERTIES(${PROJECT_NAME}-static PROPERTIES
  35. VERSION ${PROJECT_VERSION}
  36. SOVERSION ${PROJECT_VERSION_MAJOR}
  37. FOLDER ${MODULES_FOLDER}
  38. COMPILE_FLAGS "-DSystem_Static -DSystem_Exports")
  39. IF(UNIX)
  40. SET_TARGET_PROPERTIES(${PROJECT_NAME}-static PROPERTIES COMPILE_FLAGS "-fPIC")
  41. ENDIF()
  42. INCLUDE("FindOpenViBECommon")
  43. IF(WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "19.0")
  44. INCLUDE("FindThirdPartyBoost")
  45. OV_LINK_BOOST_LIB("system" ${OV_WIN32_BOOST_VERSION})
  46. OV_LINK_BOOST_LIB("thread" ${OV_WIN32_BOOST_VERSION})
  47. INCLUDE("FindThirdPartyBoost_Chrono")
  48. ENDIF()
  49. # ---------------------------------
  50. # Finds standard library winmm
  51. # Adds library to target
  52. # Adds include path
  53. # ---------------------------------
  54. IF(WIN32)
  55. INCLUDE("OvSetWindowsSDKPath")
  56. FIND_LIBRARY(LIB_STANDARD_MODULE_WINMM winmm ${OV_MS_SDK_PATH}/lib)
  57. IF(LIB_STANDARD_MODULE_WINMM)
  58. MESSAGE(STATUS " Found winmm...")
  59. TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LIB_STANDARD_MODULE_WINMM})
  60. TARGET_LINK_LIBRARIES(${PROJECT_NAME}-static ${LIB_STANDARD_MODULE_WINMM})
  61. ELSE(LIB_STANDARD_MODULE_WINMM)
  62. MESSAGE(STATUS " FAILED to find winmm...")
  63. ENDIF(LIB_STANDARD_MODULE_WINMM)
  64. FIND_LIBRARY(LIB_STANDARD_MODULE_DBGHELP dbghelp ${OV_MS_SDK_PATH}/lib)
  65. IF(LIB_STANDARD_MODULE_DBGHELP)
  66. MESSAGE(STATUS " Found dbghelp...")
  67. TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LIB_STANDARD_MODULE_DBGHELP})
  68. TARGET_LINK_LIBRARIES(${PROJECT_NAME}-static ${LIB_STANDARD_MODULE_DBGHELP})
  69. ELSE(LIB_STANDARD_MODULE_DBGHELP)
  70. MESSAGE(STATUS " FAILED to find dbghelp...")
  71. ENDIF(LIB_STANDARD_MODULE_DBGHELP)
  72. ELSE()
  73. TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${CMAKE_DL_LIBS})
  74. ENDIF()
  75. # ---------------------------------
  76. # Target macros
  77. # Defines target operating system, architecture and compiler
  78. # ---------------------------------
  79. SET_BUILD_PLATFORM()
  80. # -----------------------------
  81. # Install files
  82. # -----------------------------
  83. INSTALL(TARGETS ${PROJECT_NAME}
  84. RUNTIME DESTINATION ${DIST_BINDIR}
  85. LIBRARY DESTINATION ${DIST_LIBDIR}
  86. ARCHIVE DESTINATION ${DIST_LIBDIR})
  87. INSTALL(TARGETS ${PROJECT_NAME}-static
  88. RUNTIME DESTINATION ${DIST_BINDIR}
  89. LIBRARY DESTINATION ${DIST_LIBDIR}
  90. ARCHIVE DESTINATION ${DIST_LIBDIR})
  91. INSTALL(DIRECTORY include/ DESTINATION ${DIST_INCLUDEDIR} FILES_MATCHING PATTERN "*.h")