12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- PROJECT(openvibe-module-socket)
-
- 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})
-
- FILE(GLOB_RECURSE SRC_FILES src/*.cpp src/*.h src/*.hpp src/*.inl include/*.h include/*.hpp)
- INCLUDE_DIRECTORIES(include/socket)
- 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 "-DSocket_Shared -DSocket_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 "-DSocket_Static -DSocket_Exports")
-
- IF(UNIX)
- SET_PROPERTY(TARGET ${PROJECT_NAME}-static APPEND_STRING PROPERTY COMPILE_FLAGS " -fPIC")
- ELSEIF(WIN32)
- # SET_PROPERTY(TARGET ${PROJECT_NAME}-static APPEND_STRING PROPERTY COMPILE_FLAGS " /SAFESEH:NO")
- # SET_PROPERTY(TARGET ${PROJECT_NAME} APPEND_STRING PROPERTY COMPILE_FLAGS " /SAFESEH:NO")
- ENDIF()
-
- INCLUDE("FindOpenViBECommon")
-
- #INCLUDE("FindThirdPartyTVicPort")
-
- # ---------------------------------
- # Finds standard library winsock
- # Adds library to target
- # Adds include path
- # ---------------------------------
- IF(WIN32)
- INCLUDE("OvSetWindowsSDKPath")
- FIND_LIBRARY(LIB_STANDARD_MODULE_WINSOCK ws2_32 ${OV_MS_SDK_PATH}/lib)
- IF(LIB_STANDARD_MODULE_WINSOCK)
- MESSAGE(STATUS " Found ws2_32...")
- TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LIB_STANDARD_MODULE_WINSOCK})
- TARGET_LINK_LIBRARIES(${PROJECT_NAME}-static ${LIB_STANDARD_MODULE_WINSOCK})
- ELSE(LIB_STANDARD_MODULE_WINSOCK)
- MESSAGE(STATUS " FAILED to find ws2_32...")
- ENDIF(LIB_STANDARD_MODULE_WINSOCK)
- ENDIF(WIN32)
-
- # ---------------------------------
- # 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")
|