You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kp...@apache.org on 2017/02/28 14:04:28 UTC

qpid-interop-test git commit: QPIDIT-52 QPIDIT-55: Added better detection of Proton install following pattern suggested by Chuck Rolke

Repository: qpid-interop-test
Updated Branches:
  refs/heads/master 2aee75916 -> 7e868582e


QPIDIT-52 QPIDIT-55: Added better detection of Proton install following pattern suggested by Chuck Rolke


Project: http://git-wip-us.apache.org/repos/asf/qpid-interop-test/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-interop-test/commit/7e868582
Tree: http://git-wip-us.apache.org/repos/asf/qpid-interop-test/tree/7e868582
Diff: http://git-wip-us.apache.org/repos/asf/qpid-interop-test/diff/7e868582

Branch: refs/heads/master
Commit: 7e868582e226d285defa4054c35ea644c623dd27
Parents: 2aee759
Author: Kim van der Riet <kp...@apache.org>
Authored: Tue Feb 28 09:01:53 2017 -0500
Committer: Kim van der Riet <kp...@apache.org>
Committed: Tue Feb 28 09:01:53 2017 -0500

----------------------------------------------------------------------
 CMakeLists.txt                           | 23 +++++++-
 CMakeModules/FindProton.cmake            | 82 +++++++++++++++++++++++++++
 CMakeModules/FindProtonCpp.cmake         | 45 +++++++++++++++
 shims/qpid-proton-cpp/CMakeLists.txt     | 27 ---------
 shims/qpid-proton-cpp/src/CMakeLists.txt |  4 ++
 5 files changed, 153 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/7e868582/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8fcbf6c..9a792e2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -21,7 +21,28 @@ project(qpid-interop-test)
 
 cmake_minimum_required(VERSION 2.8.7 FATAL_ERROR)
 
-set(PROTON_INSTALL_DIR "/usr/local/qpid-proton" CACHE PATH "Proton install directory")
+
+# Find Proton components
+
+find_package(Proton)
+if (Proton_FOUND)
+    get_filename_component(PROTON_INSTALL_DIR ${Proton_INCLUDE_DIRS} DIRECTORY CACHE PATH "Proton install directory")
+    message(STATUS "Qpid proton found. Version ${Proton_VERSION} at ${Proton_INCLUDE_DIRS}")
+else ()
+    message(STATUS "Qpid proton not found.")
+endif ()
+
+find_package(ProtonCpp)
+if (ProtonCpp_FOUND)
+    get_filename_component(PROTON_CPP_INSTALL_DIR ${ProtonCpp_INCLUDE_DIRS} DIRECTORY CACHE PATH "ProtonCpp install directory")
+    message(STATUS "Qpid proton c++ binding found. Version ${ProtonCpp_VERSION} at ${ProtonCpp_INCLUDE_DIRS}")
+else()
+    message(STATUS "Qpid proton c++ binding not found.")
+endif ()
+
+if (NOT Proton_FOUND OR NOT ProtonCpp_FOUND)
+    message(FATAL_ERROR "Required proton components missing, aborting configuration.")
+endif ()
 
 add_subdirectory(shims/qpid-proton-cpp/src)
 add_subdirectory(shims/amqpnetlite/src)

http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/7e868582/CMakeModules/FindProton.cmake
----------------------------------------------------------------------
diff --git a/CMakeModules/FindProton.cmake b/CMakeModules/FindProton.cmake
new file mode 100644
index 0000000..71441fe
--- /dev/null
+++ b/CMakeModules/FindProton.cmake
@@ -0,0 +1,82 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+include(FindPackageHandleStandardArgs)
+include(FindPackageMessage)
+
+# First try to find the Installed Proton config (Proton 0.7 and later)
+find_package(Proton QUIET NO_MODULE)
+if (Proton_FOUND)
+    find_package_message(Proton "Found Proton: ${Proton_LIBRARIES} (found version \"${Proton_VERSION}\")" "$Proton_DIR ${Proton_LIBRARIES} $Proton_VERSION")
+    return()
+endif ()
+
+# Now look for the cooky Proton config installed with some earlier
+# versions of Proton
+find_package(proton QUIET NO_MODULE)
+if (proton_FOUND)
+    include("${proton_DIR}/libqpid-proton.cmake")
+    set (Proton_VERSION ${PROTON_VERSION})
+    set (Proton_INCLUDE_DIRS ${PROTON_INCLUDE_DIRS})
+    set (Proton_LIBRARIES ${PROTON_LIBRARIES})
+    set (Proton_FOUND true)
+    find_package_message(Proton "Found Proton: ${Proton_LIBRARIES} (found version \"${Proton_VERSION}\")" "$Proton_DIR ${Proton_LIBRARIES} $Proton_VERSION")
+    return()
+endif ()
+
+# Now look for any pkg-config configuration
+find_package(PkgConfig QUIET)
+
+if (PKG_CONFIG_FOUND)
+    # Check for cmake 2.6
+    if (NOT ${CMAKE_VERSION} VERSION_LESS "2.8.0")
+        set (FindPkgQUIET QUIET)
+    endif()
+
+    if (NOT Proton_FIND_VERSION)
+        pkg_check_modules(Proton ${FindPkgQUIET} libqpid-proton)
+    elseif(NOT Proton_FIND_VERSION_EXACT)
+        pkg_check_modules(Proton ${FindPkgQUIET} libqpid-proton>=${Proton_FIND_VERSION})
+    else()
+        pkg_check_modules(Proton ${FindPkgQUIET} libqpid-proton=${Proton_FIND_VERSION})
+    endif()
+    if (Proton_FOUND)
+        find_library(Proton_LIBRARY ${Proton_LIBRARIES} HINTS ${Proton_LIBRARY_DIRS})
+        set (Proton_LIBRARIES ${Proton_LIBRARY})
+        find_package_message(Proton "Found Proton: ${Proton_LIBRARIES} (found version \"${Proton_VERSION}\")" "$Proton_DIR ${Proton_LIBRARIES} $Proton_VERSION")
+        return()
+    endif ()
+endif()
+
+# Allow ccmake or command-line to set checked out but not installed Proton location
+# Defaule location is ${HOME}/qpid-proton
+set(Proton_CHECKOUT_DIR "$ENV{HOME}/qpid-proton" CACHE PATH "Proton checkout directory")
+set(Proton_BUILD_DIR_NAME "build" CACHE STRING "Proton build directory name within Proton_CHECKOUT_DIR")
+if (EXISTS ${Proton_CHECKOUT_DIR}/${Proton_BUILD_DIR_NAME}/proton-c/libqpid-proton.so)
+    include("${Proton_CHECKOUT_DIR}/${Proton_BUILD_DIR_NAME}/proton-c/ProtonConfig.cmake")
+    set (Proton_INCLUDE_DIRS "${Proton_CHECKOUT_DIR}/proton-c/include" "${Proton_CHECKOUT_DIR}/${Proton_BUILD_DIR_NAME}/proton-c/include")
+    set (Proton_LIBRARIES "${Proton_CHECKOUT_DIR}/${Proton_BUILD_DIR_NAME}/proton-c/libqpid-proton.so")
+    find_package_message(Proton "Found uninstalled Proton: ${Proton_LIBRARIES} (found version \"${Proton_VERSION}\")" "$ProtonX_DIR ${Proton_LIBRARIES} $Proton_VERSION")
+    return()
+endif ()
+
+# Proton not found print a standard error message
+if (NOT ${CMAKE_VERSION} VERSION_LESS "2.8.3")
+    find_package_handle_standard_args(Proton CONFIG_MODE)
+endif()

http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/7e868582/CMakeModules/FindProtonCpp.cmake
----------------------------------------------------------------------
diff --git a/CMakeModules/FindProtonCpp.cmake b/CMakeModules/FindProtonCpp.cmake
new file mode 100644
index 0000000..6fb5418
--- /dev/null
+++ b/CMakeModules/FindProtonCpp.cmake
@@ -0,0 +1,45 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+include(FindPackageHandleStandardArgs)
+include(FindPackageMessage)
+
+# First try to find the installed ProtonCpp config
+find_package(ProtonCpp QUIET NO_MODULE)
+if (ProtonCpp_FOUND)
+    find_package_message(ProtonCpp "Found ProtonCpp: ${ProtonCpp_LIBRARIES} (found version \"${ProtonCpp_VERSION}\")" "$ProtonCpp_DIR ${ProtonCpp_LIBRARIES} $ProtonCpp_VERSION")
+    return()
+endif ()
+
+# Allow ccmake or command-line to set checked out but not installed Proton location
+# Defaule location is ${HOME}/qpid-proton
+set(Proton_CHECKOUT_DIR "$ENV{HOME}/qpid-proton" CACHE PATH "Proton checkout directory")
+set(Proton_BUILD_DIR_NAME "build" CACHE STRING "Proton build directory name within Proton_CHECKOUT_DIR")
+if (EXISTS ${Proton_CHECKOUT_DIR}/${Proton_BUILD_DIR_NAME}/proton-c/libqpid-proton-cpp.so)
+    include("${Proton_CHECKOUT_DIR}/${Proton_BUILD_DIR_NAME}/proton-c/ProtonConfig.cmake")
+    set (ProtonCpp_INCLUDE_DIRS "${Proton_CHECKOUT_DIR}/proton-c/include" "${Proton_CHECKOUT_DIR}/${Proton_BUILD_DIR_NAME}/proton-c/include")
+    set (ProtonCpp_LIBRARIES "${Proton_CHECKOUT_DIR}/${Proton_BUILD_DIR_NAME}/proton-c/libqpid-proton-cpp.so")
+    find_package_message(ProtonCpp "Found uninstalled Proton: ${ProtonCpp_LIBRARIES} (found version \"${ProtonCpp_VERSION}\")" "$ProtonCppX_DIR ${ProtonCpp_LIBRARIES} $ProtonCpp_VERSION")
+    return()
+endif ()
+
+# Proton not found print a standard error message
+if (NOT ${CMAKE_VERSION} VERSION_LESS "2.8.3")
+    find_package_handle_standard_args(ProtonCpp CONFIG_MODE)
+endif()

http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/7e868582/shims/qpid-proton-cpp/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/shims/qpid-proton-cpp/CMakeLists.txt b/shims/qpid-proton-cpp/CMakeLists.txt
deleted file mode 100644
index 31a2581..0000000
--- a/shims/qpid-proton-cpp/CMakeLists.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-project (qpid-interop-test-cpp-shims)
-
-cmake_minimum_required(VERSION 2.8.7 FATAL_ERROR)
-
-set(PROTON_INSTALL_DIR "/usr/local/qpid-proton" CACHE PATH "Proton install directory")
-
-add_subdirectory(src)
-

http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/7e868582/shims/qpid-proton-cpp/src/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/shims/qpid-proton-cpp/src/CMakeLists.txt b/shims/qpid-proton-cpp/src/CMakeLists.txt
index 7b72c4a..13fdea5 100644
--- a/shims/qpid-proton-cpp/src/CMakeLists.txt
+++ b/shims/qpid-proton-cpp/src/CMakeLists.txt
@@ -17,6 +17,10 @@
 # under the License.
 #
 
+project (qpid-interop-test-cpp-shims)
+
+cmake_minimum_required(VERSION 2.8.7 FATAL_ERROR)
+
 message("PROTON_INSTALL_DIR=${PROTON_INSTALL_DIR}")
 include_directories(${PROTON_INSTALL_DIR}/include)
 include_directories(/usr/include/jsoncpp)


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