From d2e96e3043ed4bb767d731bc9beb2257816636ed Mon Sep 17 00:00:00 2001 From: leochan2009 Date: Thu, 21 Dec 2017 17:02:34 -0500 Subject: [PATCH] EHN: Enable the video message in the messagefactory --- CMakeLists.txt | 8 +- Examples/CMakeLists.txt | 16 +- Examples/VideoStreaming/VideoServer.cxx | 4 +- OpenIGTLinkConfig.cmake.in | 2 +- Source/CMakeLists.txt | 6 +- Source/VideoStreaming/H264Encoder.cxx | 1 + Source/VideoStreaming/VideoStreaming.cmake | 175 ++++++++++----------- Source/igtlMessageFactory.cxx | 8 + Source/igtlMessageHandlerMacro.h | 4 - SuperBuild/Superbuild.cmake | 4 +- UseOpenIGTLink.cmake.in | 2 +- igtlConfigure.h.in | 2 +- 12 files changed, 118 insertions(+), 114 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c0e2f92d6..613225e8f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,7 +36,7 @@ OPTION(OpenIGTLink_USE_OpenHEVC "Link the OpenHEVC tree." OFF) #----------------------------------------------------------------------------- # Configure WebSocket -OPTION(USE_WEBSOCKET "Build the Websocket." OFF) +OPTION(OpenIGTLink_USE_WEBSOCKET "Build the Websocket." OFF) #----------------------------------------------------------------------------- # OpenIGTLink build configuration options. @@ -165,8 +165,10 @@ IF(CMAKE_USE_PTHREADS) ENDIF() SET(OpenIGTLink_ENABLE_VIDEOSTREAMING "0") -IF (OpenIGTLink_USE_H264 OR OpenIGTLink_USE_VP9 OR OpenIGTLink_USE_X265 OR OpenIGTLink_USE_OpenHEVC) - SET(OpenIGTLink_ENABLE_VIDEOSTREAMING "1") +IF(${OpenIGTLink_PROTOCOL_VERSION} GREATER "2") + IF (OpenIGTLink_USE_H264 OR OpenIGTLink_USE_VP9 OR OpenIGTLink_USE_X265 OR OpenIGTLink_USE_OpenHEVC) + SET(OpenIGTLink_ENABLE_VIDEOSTREAMING "1") + ENDIF() ENDIF() #----------------------------------------------------------------------------- # Run superbuild script instead of library script diff --git a/Examples/CMakeLists.txt b/Examples/CMakeLists.txt index ad0f81a79..3947e9e41 100644 --- a/Examples/CMakeLists.txt +++ b/Examples/CMakeLists.txt @@ -30,15 +30,17 @@ if (${OpenIGTLink_PROTOCOL_VERSION} GREATER 1) ) endif (${OpenIGTLink_PROTOCOL_VERSION} GREATER 1) - -IF(OpenIGTLink_USE_H264 OR OpenIGTLink_USE_VP9 OR (OpenIGTLink_USE_X265 AND OpenIGTLink_USE_OpenHEVC) AND (${OpenIGTLink_PROTOCOL_VERSION} GREATER 2)) - SET(EXAMPLE_DIRS - ${EXAMPLE_DIRS} - VideoStreaming - ) +IF(${OpenIGTLink_PROTOCOL_VERSION} GREATER 2) + IF(OpenIGTLink_USE_H264 OR OpenIGTLink_USE_VP9 OR (OpenIGTLink_USE_X265 AND OpenIGTLink_USE_OpenHEVC)) + SET(EXAMPLE_DIRS + ${EXAMPLE_DIRS} + VideoStreaming + ) + ENDIF() ENDIF() -IF(USE_WEBSOCKET) + +IF(OpenIGTLink_USE_WEBSOCKET) SET(EXAMPLE_DIRS ${EXAMPLE_DIRS} WebSocket diff --git a/Examples/VideoStreaming/VideoServer.cxx b/Examples/VideoStreaming/VideoServer.cxx index 8b995edd7..a41206127 100644 --- a/Examples/VideoStreaming/VideoServer.cxx +++ b/Examples/VideoStreaming/VideoServer.cxx @@ -138,9 +138,7 @@ void* ThreadFunction(void * ptr) H264StreamEncoder->SetPicWidthAndHeight(Width,Height); H264StreamEncoder->InitializeEncoder(); encoder = H264StreamEncoder; -#endif - -#if defined(OpenIGTLink_USE_VP9) +#elif defined(OpenIGTLink_USE_VP9) VP9Encoder* VP9StreamEncoder = new VP9Encoder(); VP9StreamEncoder->SetPicWidthAndHeight(Width,Height); VP9StreamEncoder->InitializeEncoder(); diff --git a/OpenIGTLinkConfig.cmake.in b/OpenIGTLinkConfig.cmake.in index 04136babb..647b83628 100644 --- a/OpenIGTLinkConfig.cmake.in +++ b/OpenIGTLinkConfig.cmake.in @@ -45,7 +45,7 @@ SET(OpenIGTLink_USE_VP9 @OpenIGTLink_USE_VP9@) SET(OpenIGTLink_USE_X265 @OpenIGTLink_USE_X265@) SET(OpenIGTLink_USE_OpenHEVC @OpenIGTLink_USE_OpenHEVC@) SET(OpenIGTLink_ENABLE_VIDEOSTREAMING "@OpenIGTLink_ENABLE_VIDEOSTREAMING@") -SET(USE_WEBSOCKET @USE_WEBSOCKET@) +SET(OpenIGTLink_USE_WEBSOCKET @OpenIGTLink_USE_WEBSOCKET@) # Path to CableSwig configuration used by OpenIGTLink. SET(OpenIGTLink_CableSwig_DIR "@OpenIGTLink_CableSwig_DIR_CONFIG@") diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 819c4d8f9..05233e0bb 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -203,14 +203,14 @@ IF(${OpenIGTLink_PROTOCOL_VERSION} GREATER "2") ENDIF() IF (NOT (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 3.04)) - IF(OpenIGTLink_USE_H264 OR OpenIGTLink_USE_VP9 OR OpenIGTLink_USE_X265 OR OpenIGTLink_USE_OpenHEVC) + IF(OpenIGTLink_ENABLE_VIDEOSTREAMING) INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/VideoStreaming/VideoStreaming.cmake) ENDIF() #----------------------------------------------------------------------------- # Configure WebSocket # Create the link to the WebSocket libraries - IF(USE_WEBSOCKET) + IF(OpenIGTLink_USE_WEBSOCKET) FIND_PACKAGE(WebSocket REQUIRED) LIST(APPEND LINK_LIBS WebSocket) @@ -257,7 +257,7 @@ IF (NOT (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 3.04)) IF(OpenIGTLink_USE_OpenHEVC AND (NOT OpenHEVC_FOUND)) add_dependencies(OpenIGTLink OpenHEVC) ENDIF() - IF(USE_WEBSOCKET) + IF(OpenIGTLink_USE_WEBSOCKET) add_dependencies(OpenIGTLink WebSocket) ENDIF() ELSE() diff --git a/Source/VideoStreaming/H264Encoder.cxx b/Source/VideoStreaming/H264Encoder.cxx index 9601169f9..98b08f73c 100644 --- a/Source/VideoStreaming/H264Encoder.cxx +++ b/Source/VideoStreaming/H264Encoder.cxx @@ -775,6 +775,7 @@ int H264Encoder::EncodeSingleFrameIntoVideoMSG(SourcePicture* pSrcPic, igtl::Vid videoMessage->SetBitStreamSize(sFbi.iFrameSizeInBytes); videoMessage->AllocateScalars(); videoMessage->SetScalarType(videoMessage->TYPE_UINT8); + videoMessage->SetCodecType(IGTL_VIDEO_CODEC_NAME_H264); videoMessage->SetEndian(igtl_is_little_endian()==true?2:1); //little endian is 2 big endian is 1 videoMessage->SetWidth(pSrcPic->picWidth); videoMessage->SetHeight(pSrcPic->picHeight); diff --git a/Source/VideoStreaming/VideoStreaming.cmake b/Source/VideoStreaming/VideoStreaming.cmake index 267367ca5..1ea9af2d5 100644 --- a/Source/VideoStreaming/VideoStreaming.cmake +++ b/Source/VideoStreaming/VideoStreaming.cmake @@ -1,139 +1,136 @@ -# Add support for OpenIGTLink version 3 -IF(${OpenIGTLink_PROTOCOL_VERSION} GREATER "2") - LIST(APPEND OpenIGTLink_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/Source/VideoStreaming) - LIST(APPEND OpenIGTLink_SOURCES - ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/igtl_video.c - ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/igtl_videometa.c - ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/igtlVideoMessage.cxx - ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/VideoStreamIGTLinkServer.cxx - ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/VideoStreamIGTLinkReceiver.cxx - ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/igtlCodecCommonClasses.cxx - ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/igtlVideoMetaMessage.cxx - ) - LIST(APPEND OpenIGTLink_INCLUDE_DIRS - ${PROJECT_SOURCE_DIR}/Source/VideoStreaming - ) - LIST(APPEND OpenIGTLink_INCLUDE_FILES - ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/igtl_video.h - ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/igtl_videometa.h - ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/igtlVideoMessage.h - ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/VideoStreamIGTLinkServer.h - ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/VideoStreamIGTLinkReceiver.h - ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/igtlCodecCommonClasses.h - ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/igtlVideoMetaMessage.h - ) - IF(OpenIGTLink_USE_H264) - INCLUDE(${OpenIGTLink_SOURCE_DIR}/SuperBuild/External_openh264.cmake) - IF(EXISTS ${OpenH264_LIBRARY_DIR}) - LIST(APPEND OpenIGTLink_SOURCES - ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/H264Decoder.cxx - ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/H264Encoder.cxx - ) - LIST(APPEND OpenIGTLink_INCLUDE_FILES - ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/H264Decoder.h - ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/H264Encoder.h - ) - LIST(APPEND OpenIGTLink_INCLUDE_DIRS - ${OpenH264_INCLUDE_DIR} - ) - ELSE() - MESSAGE("H264_LIBRARY no found. You could specify OpenH264_INCLUDE_DIR or OpenH264_LIBRARY_DIR") - ENDIF() - ENDIF() - IF(OpenIGTLink_USE_VP9) - INCLUDE(${OpenIGTLink_SOURCE_DIR}/SuperBuild/External_VP9.cmake) - IF(EXISTS ${VP9_LIBRARY_DIR}) - LIST(APPEND OpenIGTLink_INCLUDE_DIRS - ${VP9_INCLUDE_DIR} - ) - LIST(APPEND OpenIGTLink_SOURCES - ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/VP9Decoder.cxx - ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/VP9Encoder.cxx +LIST(APPEND OpenIGTLink_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/Source/VideoStreaming) +LIST(APPEND OpenIGTLink_SOURCES + ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/igtl_video.c + ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/igtl_videometa.c + ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/igtlVideoMessage.cxx + ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/VideoStreamIGTLinkServer.cxx + ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/VideoStreamIGTLinkReceiver.cxx + ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/igtlCodecCommonClasses.cxx + ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/igtlVideoMetaMessage.cxx + ) +LIST(APPEND OpenIGTLink_INCLUDE_DIRS + ${PROJECT_SOURCE_DIR}/Source/VideoStreaming + ) +LIST(APPEND OpenIGTLink_INCLUDE_FILES + ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/igtl_video.h + ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/igtl_videometa.h + ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/igtlVideoMessage.h + ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/VideoStreamIGTLinkServer.h + ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/VideoStreamIGTLinkReceiver.h + ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/igtlCodecCommonClasses.h + ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/igtlVideoMetaMessage.h + ) +IF(OpenIGTLink_USE_H264) + INCLUDE(${OpenIGTLink_SOURCE_DIR}/SuperBuild/External_openh264.cmake) + IF(EXISTS ${OpenH264_LIBRARY_DIR}) + LIST(APPEND OpenIGTLink_SOURCES + ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/H264Decoder.cxx + ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/H264Encoder.cxx ) - LIST(APPEND OpenIGTLink_INCLUDE_FILES - ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/VP9Decoder.h - ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/VP9Encoder.h + LIST(APPEND OpenIGTLink_INCLUDE_FILES + ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/H264Decoder.h + ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/H264Encoder.h ) - IF(NOT ${VP9_LIBRARY_DIR} EQUAL "") - LIST(APPEND OpenIGTLink_INCLUDE_DIRS - "${VP9_LIBRARY_DIR}" ) - LINK_DIRECTORIES("${VP9_LIBRARY_DIR}/lib") - ENDIF() - ELSE() - MESSAGE("VP9_INCLUDE_DIR or VP9_LIBRARY_DIR no found") - ENDIF() - ENDIF() - - IF(OpenIGTLink_USE_X265) - INCLUDE(${OpenIGTLink_SOURCE_DIR}/SuperBuild/External_X265.cmake) LIST(APPEND OpenIGTLink_INCLUDE_DIRS - ${X265_INCLUDE_DIR} - ${X265_LIBRARY_DIR} - ) - LIST(APPEND OpenIGTLink_SOURCES - ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/H265Encoder.cxx - ) - LIST(APPEND OpenIGTLink_INCLUDE_FILES - ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/H265Encoder.h + ${OpenH264_INCLUDE_DIR} ) + ELSE() + MESSAGE("H264_LIBRARY no found. You could specify OpenH264_INCLUDE_DIR or OpenH264_LIBRARY_DIR") ENDIF() - - IF(OpenIGTLink_USE_OpenHEVC) - INCLUDE(${OpenIGTLink_SOURCE_DIR}/SuperBuild/External_openHEVC.cmake) +ENDIF() +IF(OpenIGTLink_USE_VP9) + INCLUDE(${OpenIGTLink_SOURCE_DIR}/SuperBuild/External_VP9.cmake) + IF(EXISTS ${VP9_LIBRARY_DIR}) LIST(APPEND OpenIGTLink_INCLUDE_DIRS - ${OpenHEVC_INCLUDE_DIR} + ${VP9_INCLUDE_DIR} ) LIST(APPEND OpenIGTLink_SOURCES - ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/H265Decoder.cxx + ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/VP9Decoder.cxx + ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/VP9Encoder.cxx ) - LIST(APPEND OpenIGTLink_INCLUDE_FILES - ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/H265Decoder.h + LIST(APPEND OpenIGTLink_INCLUDE_FILES + ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/VP9Decoder.h + ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/VP9Encoder.h ) + IF(NOT ${VP9_LIBRARY_DIR} EQUAL "") + LIST(APPEND OpenIGTLink_INCLUDE_DIRS + "${VP9_LIBRARY_DIR}" ) + LINK_DIRECTORIES("${VP9_LIBRARY_DIR}/lib") + ENDIF() + ELSE() + MESSAGE("VP9_INCLUDE_DIR or VP9_LIBRARY_DIR no found") ENDIF() ENDIF() +IF(OpenIGTLink_USE_X265) + INCLUDE(${OpenIGTLink_SOURCE_DIR}/SuperBuild/External_X265.cmake) + LIST(APPEND OpenIGTLink_INCLUDE_DIRS + ${X265_INCLUDE_DIR} + ${X265_LIBRARY_DIR} + ) + LIST(APPEND OpenIGTLink_SOURCES + ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/H265Encoder.cxx + ) + LIST(APPEND OpenIGTLink_INCLUDE_FILES + ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/H265Encoder.h + ) +ENDIF() + +IF(OpenIGTLink_USE_OpenHEVC) + INCLUDE(${OpenIGTLink_SOURCE_DIR}/SuperBuild/External_openHEVC.cmake) + LIST(APPEND OpenIGTLink_INCLUDE_DIRS + ${OpenHEVC_INCLUDE_DIR} + ) + LIST(APPEND OpenIGTLink_SOURCES + ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/H265Decoder.cxx + ) + LIST(APPEND OpenIGTLink_INCLUDE_FILES + ${PROJECT_SOURCE_DIR}/Source/VideoStreaming/H265Decoder.h + ) +ENDIF() + IF(WIN32) # for Windows - IF((${OpenIGTLink_PROTOCOL_VERSION} GREATER "2" ) AND OpenIGTLink_USE_H264) + IF(OpenIGTLink_USE_H264) LIST(APPEND LINK_LIBS ${OpenH264_LIBRARY_DIR}/openh264.lib ) ENDIF() - IF((${OpenIGTLink_PROTOCOL_VERSION} GREATER "2" ) AND OpenIGTLink_USE_VP9) + IF(OpenIGTLink_USE_VP9) #To do, library name depends on the compiler setting, could be vpxmt.lib and vpxmtd also. Make sure the setting matches. LIST(APPEND LINK_LIBS VP9_lib ) ENDIF() - IF((${OpenIGTLink_PROTOCOL_VERSION} GREATER "2" ) AND OpenIGTLink_USE_X265) + IF(OpenIGTLink_USE_X265) #To do, library name depends on the compiler setting, could be vpxmt.lib and vpxmtd also. Make sure the setting matches. SET(LINK_X265_LIBRARY optimized ${X265_LIBRARY_DIR}\\Release\\x265-static.lib debug ${X265_LIBRARY_DIR}\\Debug\\x265-static.lib) LIST(APPEND LINK_LIBS ${LINK_X265_LIBRARY} ) ENDIF() - IF((${OpenIGTLink_PROTOCOL_VERSION} GREATER "2" ) AND OpenIGTLink_USE_OpenHEVC) + IF(OpenIGTLink_USE_OpenHEVC) #To do, library name depends on the compiler setting, could be vpxmt.lib and vpxmtd also. Make sure the setting matches. LIST(APPEND LINK_LIBS ${OpenHEVC_LIBRARY} ) ENDIF() ELSE() # for POSIX-compatible OSs - IF((${OpenIGTLink_PROTOCOL_VERSION} GREATER "2" ) AND OpenIGTLink_USE_H264) + IF(OpenIGTLink_USE_H264) LIST(APPEND LINK_LIBS ${OpenH264_LIBRARY_DIR}/libopenh264.a ) ENDIF() - IF((${OpenIGTLink_PROTOCOL_VERSION} GREATER "2" ) AND OpenIGTLink_USE_VP9) + IF(OpenIGTLink_USE_VP9) LIST(APPEND LINK_LIBS ${VP9_LIBRARY_DIR}/libvpx.a ) ENDIF() - IF((${OpenIGTLink_PROTOCOL_VERSION} GREATER "2" ) AND OpenIGTLink_USE_X265) + IF(OpenIGTLink_USE_X265) LIST(APPEND LINK_LIBS ${X265_LIBRARY_DIR}/libx265.a ) ENDIF() - IF((${OpenIGTLink_PROTOCOL_VERSION} GREATER "2" ) AND OpenIGTLink_USE_OpenHEVC) + IF(OpenIGTLink_USE_OpenHEVC) LIST(APPEND LINK_LIBS ${OpenHEVC_LIBRARY} ) diff --git a/Source/igtlMessageFactory.cxx b/Source/igtlMessageFactory.cxx index 1483f7385..c504bf150 100644 --- a/Source/igtlMessageFactory.cxx +++ b/Source/igtlMessageFactory.cxx @@ -36,6 +36,10 @@ PURPOSE. See the above copyright notices for more information. #include "igtlCommandMessage.h" #endif // OpenIGTLink_PROTOCOL_VERSION >= 3 +#if OpenIGTLink_ENABLE_VIDEOSTREAMING +#include "igtlVideoMessage.h" +#endif + #include "igtl_header.h" #include @@ -87,6 +91,10 @@ MessageFactory::MessageFactory() this->AddMessageType("COMMAND", (PointerToMessageBaseNew)&igtl::CommandMessage::New); this->AddMessageType("RTS_COMMAND", (PointerToMessageBaseNew)&igtl::RTSCommandMessage::New); #endif + +#if OpenIGTLink_ENABLE_VIDEOSTREAMING + this->AddMessageType("VIDEO", (PointerToMessageBaseNew)&igtl::VideoMessage::New); +#endif } diff --git a/Source/igtlMessageHandlerMacro.h b/Source/igtlMessageHandlerMacro.h index bcafafaf5..1ee40e4ce 100644 --- a/Source/igtlMessageHandlerMacro.h +++ b/Source/igtlMessageHandlerMacro.h @@ -122,10 +122,6 @@ return this->m_Message->GetMessageType(); \ } \ virtual const char* GetMessageType() \ - { \ - return this->m_Message->GetType(); \ - } \ - virtual const char* GetMessageType() \ { \ return this->m_Message->GetDeviceType(); \ } \ diff --git a/SuperBuild/Superbuild.cmake b/SuperBuild/Superbuild.cmake index 77b261997..6b656169e 100644 --- a/SuperBuild/Superbuild.cmake +++ b/SuperBuild/Superbuild.cmake @@ -31,7 +31,7 @@ IF(OpenIGTLink_USE_OpenHEVC) ENDIF() ENDIF() -IF(USE_WEBSOCKET) +IF(OpenIGTLink_USE_WEBSOCKET) INCLUDE(${CMAKE_CURRENT_LIST_DIR}/External_WebSocket.cmake) LIST(APPEND OpenIGTLink_DEPENDENCIES websocket) ENDIF() @@ -58,7 +58,7 @@ ExternalProject_Add( OpenIGTLink-lib -DOpenIGTLink_USE_VP9:BOOL=${OpenIGTLink_USE_VP9} -DOpenIGTLink_USE_X265:BOOL=${OpenIGTLink_USE_X265} -DOpenIGTLink_USE_OpenHEVC:BOOL=${OpenIGTLink_USE_OpenHEVC} - -DUSE_WEBSOCKET:BOOL=${USE_WEBSOCKET} + -DOpenIGTLink_USE_WEBSOCKET:BOOL=${OpenIGTLink_USE_WEBSOCKET} -DBUILD_EXAMPLES:BOOL=${BUILD_EXAMPLES} -DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS} -DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS} diff --git a/UseOpenIGTLink.cmake.in b/UseOpenIGTLink.cmake.in index 6a3e5fc3a..b263bd053 100644 --- a/UseOpenIGTLink.cmake.in +++ b/UseOpenIGTLink.cmake.in @@ -23,7 +23,7 @@ INCLUDE_DIRECTORIES(BEFORE ${OpenIGTLink_INCLUDE_DIRS}) # Load the OpenIGTLink targets include(${OpenIGTLink_LIBRARY_TARGETS_FILE}) -IF(USE_WEBSOCKET) +IF(OpenIGTLink_USE_WEBSOCKET) SET(CMAKE_PREFIX_PATH "${CMAKE_BINARY_DIR}/websocketpp") find_package(WebSocket REQUIRED) ENDIF() \ No newline at end of file diff --git a/igtlConfigure.h.in b/igtlConfigure.h.in index 27aef87b5..84defd390 100644 --- a/igtlConfigure.h.in +++ b/igtlConfigure.h.in @@ -40,7 +40,7 @@ #cmakedefine OpenIGTLink_USE_VP9 #cmakedefine OpenIGTLink_USE_X265 #cmakedefine OpenIGTLink_USE_OpenHEVC -#cmakedefine USE_WEBSOCKET +#cmakedefine OpenIGTLink_USE_WEBSOCKET #define OpenIGTLink_ENABLE_VIDEOSTREAMING @OpenIGTLink_ENABLE_VIDEOSTREAMING@ #define OpenIGTLink_PROTOCOL_VERSION_1 1