123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- PROJECT(openvibe-module-system)
-
- SET(PROJECT_VERSION_MAJOR ${OV_GLOBAL_VERSION_MAJOR})
- SET(PROJECT_VERSION_MINOR ${OV_GLOBAL_VERSION_MINOR})
- SET(PROJECT_VERSION_PATCH ${OV_GLOBAL_VERSION_PATCH})
- SET(PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})
-
- SET(SRC_FILES
- include/system/defines.h
- include/system/ovCChrono.h
- include/system/ovCMath.h
- include/system/ovCMemory.h
- include/system/ovCTime.h
- include/system/ovCDynamicModule.h
- src/ovCChrono.cpp
- src/ovCMath.cpp
- src/ovCMemory.cpp
- src/ovCTime.cpp
- src/ovCDynamicModule.cpp
- )
-
- IF(WIN32)
- LIST(APPEND SRC_FILES
- "include/system/WindowsUtilities.h"
- "src/WindowsUtilities.cpp"
- )
- ENDIF()
-
- INCLUDE_DIRECTORIES(include)
- INCLUDE("FindSourceRCProperties")
-
- ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRC_FILES})
- SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES
- VERSION ${PROJECT_VERSION}
- SOVERSION ${PROJECT_VERSION_MAJOR}
- FOLDER ${MODULES_FOLDER}
- COMPILE_FLAGS "-DSystem_Shared -DSystem_Exports")
-
- ADD_LIBRARY(${PROJECT_NAME}-static STATIC ${SRC_FILES})
- SET_TARGET_PROPERTIES(${PROJECT_NAME}-static PROPERTIES
- VERSION ${PROJECT_VERSION}
- SOVERSION ${PROJECT_VERSION_MAJOR}
- FOLDER ${MODULES_FOLDER}
- COMPILE_FLAGS "-DSystem_Static -DSystem_Exports")
-
- IF(UNIX)
- SET_TARGET_PROPERTIES(${PROJECT_NAME}-static PROPERTIES COMPILE_FLAGS "-fPIC")
- ENDIF()
-
- INCLUDE("FindOpenViBECommon")
-
- IF(WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "19.0")
- INCLUDE("FindThirdPartyBoost")
- OV_LINK_BOOST_LIB("system" ${OV_WIN32_BOOST_VERSION})
- OV_LINK_BOOST_LIB("thread" ${OV_WIN32_BOOST_VERSION})
- INCLUDE("FindThirdPartyBoost_Chrono")
- ENDIF()
-
-
-
- # ---------------------------------
- # Finds standard library winmm
- # Adds library to target
- # Adds include path
- # ---------------------------------
- IF(WIN32)
- INCLUDE("OvSetWindowsSDKPath")
-
- FIND_LIBRARY(LIB_STANDARD_MODULE_WINMM winmm ${OV_MS_SDK_PATH}/lib)
-
- IF(LIB_STANDARD_MODULE_WINMM)
- MESSAGE(STATUS " Found winmm...")
- TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LIB_STANDARD_MODULE_WINMM})
- TARGET_LINK_LIBRARIES(${PROJECT_NAME}-static ${LIB_STANDARD_MODULE_WINMM})
- ELSE(LIB_STANDARD_MODULE_WINMM)
- MESSAGE(STATUS " FAILED to find winmm...")
- ENDIF(LIB_STANDARD_MODULE_WINMM)
-
- FIND_LIBRARY(LIB_STANDARD_MODULE_DBGHELP dbghelp ${OV_MS_SDK_PATH}/lib)
-
- IF(LIB_STANDARD_MODULE_DBGHELP)
- MESSAGE(STATUS " Found dbghelp...")
- TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LIB_STANDARD_MODULE_DBGHELP})
- TARGET_LINK_LIBRARIES(${PROJECT_NAME}-static ${LIB_STANDARD_MODULE_DBGHELP})
- ELSE(LIB_STANDARD_MODULE_DBGHELP)
- MESSAGE(STATUS " FAILED to find dbghelp...")
- ENDIF(LIB_STANDARD_MODULE_DBGHELP)
- ELSE()
- TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${CMAKE_DL_LIBS})
- ENDIF()
-
- # ---------------------------------
- # Target macros
- # Defines target operating system, architecture and compiler
- # ---------------------------------
- SET_BUILD_PLATFORM()
-
- # -----------------------------
- # Install files
- # -----------------------------
- INSTALL(TARGETS ${PROJECT_NAME}
- RUNTIME DESTINATION ${DIST_BINDIR}
- LIBRARY DESTINATION ${DIST_LIBDIR}
- ARCHIVE DESTINATION ${DIST_LIBDIR})
- INSTALL(TARGETS ${PROJECT_NAME}-static
- RUNTIME DESTINATION ${DIST_BINDIR}
- LIBRARY DESTINATION ${DIST_LIBDIR}
- ARCHIVE DESTINATION ${DIST_LIBDIR})
- INSTALL(DIRECTORY include/ DESTINATION ${DIST_INCLUDEDIR} FILES_MATCHING PATTERN "*.h")
|