You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2017/01/06 16:29:32 UTC

qpid-dispatch git commit: DISPATCH-103: Fix cmake/FindLibWebSockets

Repository: qpid-dispatch
Updated Branches:
  refs/heads/master 4e3843dc3 -> 8013c316f


DISPATCH-103: Fix cmake/FindLibWebSockets

The rules about capitalization of the FOO_FOUND variable change between cmake 2.6 and 3.0.
Switch to all-caps-everywhere: this is not the modern cmake recommendation but it is
the only thing that works in 2.6.


Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/8013c316
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/8013c316
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/8013c316

Branch: refs/heads/master
Commit: 8013c316fbfe36d64413c4965fce5d6b9bd2ab8c
Parents: 4e3843d
Author: Alan Conway <ac...@redhat.com>
Authored: Fri Jan 6 11:25:45 2017 -0500
Committer: Alan Conway <ac...@redhat.com>
Committed: Fri Jan 6 11:25:45 2017 -0500

----------------------------------------------------------------------
 CMakeLists.txt                |  2 +-
 cmake/FindLibWebSockets.cmake | 27 ++++++++++++++-------------
 src/CMakeLists.txt            |  4 ++--
 3 files changed, 17 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/8013c316/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f50a3dc..8f8624d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -104,7 +104,7 @@ find_package(Proton 0.15 REQUIRED)
 
 ## Optional dependencies
 include(FindLibWebSockets)
-option(USE_LIBWEBSOCKETS "Use libwebsockets for WebSocket support" ${LibWebSockets_FOUND})
+option(USE_LIBWEBSOCKETS "Use libwebsockets for WebSocket support" ${LIBWEBSOCKETS_FOUND})
 
 ##
 ## Find Valgrind

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/8013c316/cmake/FindLibWebSockets.cmake
----------------------------------------------------------------------
diff --git a/cmake/FindLibWebSockets.cmake b/cmake/FindLibWebSockets.cmake
index 132c903..18ef18a 100644
--- a/cmake/FindLibWebSockets.cmake
+++ b/cmake/FindLibWebSockets.cmake
@@ -21,9 +21,9 @@
 #
 # Sets the following variables:
 #
-#   LibWebSockets_FOUND            - True if headers and requested libraries were found
-#   LibWebSockets_INCLUDE_DIRS     - LibWebSockets include directories
-#   LibWebSockets_LIBRARIES        - Link these to use libwebsockets.
+#   LIBWEBSOCKETS_FOUND            - True if headers and requested libraries were found
+#   LIBWEBSOCKETS_INCLUDE_DIRS     - LibWebSockets include directories
+#   LIBWEBSOCKETS_LIBRARIES        - Link these to use libwebsockets.
 #
 # This module reads hints about search locations from variables::
 #   LIBWEBSOCKETS_LIBRARYDIR       - Preferred library directory e.g. <prefix>/lib
@@ -31,12 +31,12 @@
 #   CMAKE_INSTALL_PREFIX           - Install location for the current project.
 #   LIBWEBSOCKETS_INCLUDEDIR       - Preferred include directory e.g. <prefix>/include
 
-find_library(LibWebSockets_LIBRARIES
+find_library(LIBWEBSOCKETS_LIBRARIES
   NAMES websockets libwebsockets
   HINTS ${LIBWEBSOCKETS_LIBRARYDIR} ${LIBWEBSOCKETS_ROOT}  ${CMAKE_INSTALL_PREFIX}
   )
 
-find_path(LibWebSockets_INCLUDE_DIRS
+find_path(LIBWEBSOCKETS_INCLUDE_DIRS
   NAMES libwebsockets.h
   HINTS ${LIBWEBSOCKETS_INCLUDEDIR} ${LIBWEBSOCKETS_ROOT}/include ${CMAKE_INSTALL_PREFIX}/include
   PATHS /usr/include
@@ -44,21 +44,22 @@ find_path(LibWebSockets_INCLUDE_DIRS
 
 include(FindPackageHandleStandardArgs)
 
-find_package_handle_standard_args(LibWebSockets DEFAULT_MSG LibWebSockets_LIBRARIES LibWebSockets_INCLUDE_DIRS)
+find_package_handle_standard_args(LIBWEBSOCKETS DEFAULT_MSG LIBWEBSOCKETS_LIBRARIES LIBWEBSOCKETS_INCLUDE_DIRS)
 
-if(LibWebSockets_FOUND)
+if(LIBWEBSOCKETS_FOUND)
   # For the moment we need a patched version of LibWebSockets:
   # https://github.com/alanconway/libwebsockets/tree/v2.1-stable-aconway-adopt-ssl
   # This function check verifies we have it.
-  set(CMAKE_REQUIRED_INCLUDES ${LibWebSockets_INCLUDE_DIRS})
-  set(CMAKE_REQUIRED_LIBRARIES ${LibWebSockets_LIBRARIES})
+  set(CMAKE_REQUIRED_INCLUDES ${LIBWEBSOCKETS_INCLUDE_DIRS})
+  set(CMAKE_REQUIRED_LIBRARIES ${LIBWEBSOCKETS_LIBRARIES})
   check_function_exists(lws_adopt_socket_vhost LWS_ADOPT_SOCKET_VHOST_FOUND)
   if (NOT LWS_ADOPT_SOCKET_VHOST_FOUND)
-    unset(LibWebSockets_FOUND)
+    message("Cannot use LibWebSockets, no function lws_adopt_socket_vhost")
+    unset(LIBWEBSOCKETS_FOUND)
   endif()
 endif()
 
-if(NOT LibWebSockets_FOUND)
-  set(LibWebSockets_LIBRARIES "")
-  set(LibWebSockets_INCLUDE_DIRS "")
+if(NOT LIBWEBSOCKETS_FOUND)
+  set(LIBWEBSOCKETS_LIBRARIES "")
+  set(LIBWEBSOCKETS_INCLUDE_DIRS "")
 endif()

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/8013c316/src/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 5bafcab..25e6c24 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -39,7 +39,7 @@ add_custom_command (
 include_directories(
   ${CMAKE_CURRENT_SOURCE_DIR}
   ${CMAKE_CURRENT_BINARY_DIR}
-  ${LibWebSockets_INCLUDE_DIRS}
+  ${LIBWEBSOCKETS_INCLUDE_DIRS}
   )
 
 # Build the qpid-dispatch library.
@@ -108,7 +108,7 @@ set_property(
   )
 
 add_library(qpid-dispatch SHARED ${qpid_dispatch_SOURCES})
-target_link_libraries(qpid-dispatch ${Proton_LIBRARIES} ${pthread_lib} ${rt_lib} ${dl_lib} ${PYTHON_LIBRARIES} ${LibWebSockets_LIBRARIES})
+target_link_libraries(qpid-dispatch ${Proton_LIBRARIES} ${pthread_lib} ${rt_lib} ${dl_lib} ${PYTHON_LIBRARIES} ${LIBWEBSOCKETS_LIBRARIES})
 set_target_properties(qpid-dispatch PROPERTIES
   LINK_FLAGS "${CATCH_UNDEFINED}"
   )


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org