Additional fix. Include LIBWEBSOCKETS_LIBRARIES only if LIBWEBSOCKETS_FOUND
@@ -36,11 +36,18 @@ add_custom_command (
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_BINARY_DIR}/tests/run.py -s ${CMAKE_CURRENT_SOURCE_DIR}/schema_c.py
DEPENDS ${GENERATOR_DEPENDS})
+if(NOT LIBWEBSOCKETS_FOUND)
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}
+ )
+else()
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${LIBWEBSOCKETS_INCLUDE_DIRS}
)
+endif()
# Build the qpid-dispatch library.
set(qpid_dispatch_SOURCES
@@ -92,6 +99,7 @@ set(qpid_dispatch_SOURCES
trace_mask.c
)
+# USE_LIBWEBSOCKETS is true only if LIBWEBSOCKETS_FOUND
if(USE_LIBWEBSOCKETS)
set(qpid_dispatch_SOURCES ${qpid_dispatch_SOURCES} http-libwebsockets.c)
else(USE_LIBWEBSOCKETS)
@@ -111,7 +119,11 @@ if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
endif (CMAKE_C_COMPILER_ID STREQUAL "GNU")
add_library(qpid-dispatch SHARED ${qpid_dispatch_SOURCES})
+if(NOT LIBWEBSOCKETS_FOUND)
+target_link_libraries(qpid-dispatch ${ProtonCore_LIBRARIES} ${ProtonProactor_LIBRARIES} ${pthread_lib} ${rt_lib} ${dl_lib} ${PYTHON_LIBRARIES})
+else()
target_link_libraries(qpid-dispatch ${ProtonCore_LIBRARIES} ${ProtonProactor_LIBRARIES} ${pthread_lib} ${rt_lib} ${dl_lib} ${PYTHON_LIBRARIES} ${LIBWEBSOCKETS_LIBRARIES})
+endif()
set_target_properties(qpid-dispatch PROPERTIES
LINK_FLAGS "${CATCH_UNDEFINED}"
)
