You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by as...@apache.org on 2023/01/13 00:00:34 UTC
[qpid-proton] 01/02: PROTON-2669: Update examples CMakefiles for cmake 3.16
This is an automated email from the ASF dual-hosted git repository.
astitcher pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-proton.git
commit 767372b2c686d367d24d425e4d792f8dfadb8938
Author: Andrew Stitcher <as...@apache.org>
AuthorDate: Thu Jan 12 18:55:16 2023 -0500
PROTON-2669: Update examples CMakefiles for cmake 3.16
---
c/examples/CMakeLists.txt | 20 +-------------------
cpp/examples/CMakeLists.txt | 32 +++-----------------------------
tests/share/CMakeLists.txt | 2 +-
3 files changed, 5 insertions(+), 49 deletions(-)
diff --git a/c/examples/CMakeLists.txt b/c/examples/CMakeLists.txt
index 04758e2f7..c0a984c09 100644
--- a/c/examples/CMakeLists.txt
+++ b/c/examples/CMakeLists.txt
@@ -16,7 +16,7 @@
# specific language governing permissions and limitations
# under the License.
#
-cmake_minimum_required (VERSION 2.8.12)
+cmake_minimum_required (VERSION 3.16)
project(ProtonCExamples C)
@@ -24,24 +24,6 @@ find_package(Proton REQUIRED Core Proactor)
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
find_package(Threads REQUIRED)
-# The following block is purely for CMake 2.8.12
-# Remove it when we no longer support CMake 2.8.12
-if(NOT TARGET Threads::Threads)
- add_library(Threads::Threads UNKNOWN IMPORTED)
-
- if(THREADS_HAVE_PTHREAD_ARG)
- set_target_properties(Threads::Threads PROPERTIES
- INTERFACE_COMPILE_OPTIONS "-pthread"
- )
- endif()
-
- if(CMAKE_THREAD_LIBS_INIT)
- set_target_properties(Threads::Threads PROPERTIES
- IMPORTED_LOCATION "${CMAKE_THREAD_LIBS_INIT}"
- )
- endif()
-endif()
-
foreach (name broker send receive direct send-abort send-ssl raw_echo raw_connect)
add_executable(c-${name} ${name}.c)
target_link_libraries(c-${name} Proton::core Proton::proactor Threads::Threads)
diff --git a/cpp/examples/CMakeLists.txt b/cpp/examples/CMakeLists.txt
index ed0abf083..328e71ced 100644
--- a/cpp/examples/CMakeLists.txt
+++ b/cpp/examples/CMakeLists.txt
@@ -16,7 +16,7 @@
# specific language governing permissions and limitations
# under the License.
#
-cmake_minimum_required (VERSION 2.8.12)
+cmake_minimum_required (VERSION 3.16)
project(ProtonCppExamples C CXX)
@@ -24,34 +24,8 @@ find_package(ProtonCpp REQUIRED)
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
find_package(Threads REQUIRED)
-# The following block is purely for CMake 2.8.12
-# Remove it when we no longer support CMake 2.8.12
-if(NOT TARGET Threads::Threads)
- add_library(Threads::Threads UNKNOWN IMPORTED)
-
- if(THREADS_HAVE_PTHREAD_ARG)
- set_target_properties(Threads::Threads PROPERTIES
- INTERFACE_COMPILE_OPTIONS "-pthread"
- )
- endif()
-
- if(CMAKE_THREAD_LIBS_INIT)
- set_target_properties(Threads::Threads PROPERTIES
- IMPORTED_LOCATION "${CMAKE_THREAD_LIBS_INIT}"
- )
- endif()
-endif()
-
-# This effectively checks for cmake version 3.1 or later
-if (DEFINED CMAKE_CXX_COMPILE_FEATURES)
- set(CMAKE_CXX_STANDARD 11)
- set(CMAKE_CXX_EXTENSIONS OFF)
-else ()
- # This can only be a fairly old version of Linux in practice
- set(CXX_STANDARD "-std=c++11")
- add_definitions(${CXX_STANDARD})
-endif()
-
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_EXTENSIONS OFF)
# Single-threaded examples
foreach(example
diff --git a/tests/share/CMakeLists.txt b/tests/share/CMakeLists.txt
index 88884145a..68bffcc47 100644
--- a/tests/share/CMakeLists.txt
+++ b/tests/share/CMakeLists.txt
@@ -17,7 +17,7 @@
# under the License.
#
-cmake_minimum_required(VERSION 2.8.12)
+cmake_minimum_required(VERSION 3.16)
project(ProtonExamples)
include(CTest)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org