123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- # ---------------------------------
- # Finds module Socket
- # Adds library to target
- # Adds include path
- # ---------------------------------
- OPTION(DYNAMIC_LINK_OPENVIBE_MODULE_SOCKET "Dynamically link OpenViBE module Socket" ON)
-
- IF(DYNAMIC_LINK_OPENVIBE_MODULE_SOCKET)
- SET(OPENVIBE_MODULE_SOCKET_LINKING "")
- ADD_DEFINITIONS(-DSocket_Shared)
- ELSE()
- SET(OPENVIBE_MODULE_SOCKET_LINKING "-static")
- ADD_DEFINITIONS(-DSocket_Static)
- ENDIF()
-
- set(PATH_OPENVIBE_MODULES_SOCKET "PATH_OPENVIBE_MODULES_SOCKET-NOTFOUND")
- set(SRC_DIR ${OV_BASE_DIR}/modules/socket/include)
-
- FIND_PATH(PATH_OPENVIBE_MODULES_SOCKET socket/defines.h PATHS ${SRC_DIR} NO_DEFAULT_PATH)
- IF(PATH_OPENVIBE_MODULES_SOCKET)
- debug_message( " Found OpenViBE module Socket... ${PATH_OPENVIBE_MODULE_SOCKET}/openvibe-module-socket${OPENVIBE_MODULE_SOCKET_LINKING}")
- INCLUDE_DIRECTORIES(${PATH_OPENVIBE_MODULES_SOCKET}/)
-
- TARGET_LINK_LIBRARIES(${PROJECT_NAME} openvibe-module-socket${OPENVIBE_MODULE_SOCKET_LINKING})
-
- ADD_DEFINITIONS(-DTARGET_HAS_Socket)
-
- # if we link with the module socket in Static, we must link the project with the dependency on win32
- IF(WIN32 AND NOT DYNAMIC_LINK_OPENVIBE_MODULE_SOCKET)
- INCLUDE("FindThirdPartyWinsock2")
-
- # FIND_LIBRARY(LIB_STANDARD_MODULE_WINSOCK ws2_32)
- # IF(LIB_STANDARD_MODULE_WINSOCK)
- # debug_message( " Found ws2_32...")
- # IF(TARGET ${PROJECT_NAME})
- # TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LIB_STANDARD_MODULE_WINSOCK})
- # ENDIF()
- # IF(TARGET ${PROJECT_NAME}-static)
- # TARGET_LINK_LIBRARIES(${PROJECT_NAME}-static ${LIB_STANDARD_MODULE_WINSOCK})
- # ENDIF()
- # ELSE(LIB_STANDARD_MODULE_WINSOCK)
- # debug_message( " FAILED to find ws2_32...")
- # ENDIF(LIB_STANDARD_MODULE_WINSOCK)
- ENDIF(WIN32 AND NOT DYNAMIC_LINK_OPENVIBE_MODULE_SOCKET)
-
- ELSE(PATH_OPENVIBE_MODULES_SOCKET)
- MESSAGE(WARNING " FAILED to find OpenViBE module Socket...")
- ENDIF(PATH_OPENVIBE_MODULES_SOCKET)
|