Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump minimum cmake version to 3.5 to avoid deprecation warning #1097

Merged
merged 1 commit into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
CMAKE_MINIMUM_REQUIRED (VERSION 2.8.12)

IF ((CMAKE_VERSION VERSION_GREATER 3.1) OR
(CMAKE_VERSION VERSION_EQUAL 3.1))
CMAKE_POLICY(SET CMP0054 NEW)
ENDIF ()
if(${CMAKE_VERSION} VERSION_GREATER "3.4")
CMAKE_MINIMUM_REQUIRED (VERSION 3.5)
else()
CMAKE_MINIMUM_REQUIRED (VERSION 2.8.12)
IF ((CMAKE_VERSION VERSION_GREATER 3.1) OR
(CMAKE_VERSION VERSION_EQUAL 3.1))
CMAKE_POLICY(SET CMP0054 NEW)
ENDIF ()
endif()

OPTION (MSGPACK_BUILD_TESTS "Build msgpack tests." OFF)
OPTION (MSGPACK_GEN_COVERAGE "Enable running gcov to get a test coverage report." OFF)
Expand Down Expand Up @@ -38,7 +41,7 @@ IF (BIGENDIAN)
SET(MSGPACK_ENDIAN_LITTLE_BYTE 0)
ELSE ()
SET(MSGPACK_ENDIAN_BIG_BYTE 0)
SET(MSGPACK_ENDIAN_LITTLE_BYTE 1)
SET(MSGPACK_ENDIAN_LITTLE_BYTE 1)
ENDIF ()

CONFIGURE_FILE (
Expand Down
3 changes: 2 additions & 1 deletion ci/build_cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ if [ "${ARCH}" == "32" ]
then
export BIT32="ON"
export ARCH_FLAG="-m32"
ZLIB32="-DZLIB_LIBRARY=/usr/lib32/libz.a"
else
export BIT32="OFF"
export ARCH_FLAG="-m64"
fi

cmake -DMSGPACK_BUILD_TESTS=ON -DMSGPACK_32BIT=${BIT32} -DBUILD_SHARED_LIBS=${SHARED} -DMSGPACK_CHAR_SIGN=${CHAR_SIGN} -DCMAKE_CXX_FLAGS="${ARCH_FLAG} ${CXXFLAGS} ${SAN}" -DCMAKE_C_FLAGS="${CFLAGS} ${SAN}" ..
cmake -DMSGPACK_BUILD_TESTS=ON -DMSGPACK_32BIT=${BIT32} -DBUILD_SHARED_LIBS=${SHARED} -DMSGPACK_CHAR_SIGN=${CHAR_SIGN} -DCMAKE_CXX_FLAGS="${ARCH_FLAG} ${CXXFLAGS} ${SAN}" -DCMAKE_C_FLAGS="${CFLAGS} ${SAN}" ${ZLIB32} ..

ret=$?
if [ $ret -ne 0 ]
Expand Down
2 changes: 1 addition & 1 deletion example/cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 3.0)
cmake_minimum_required (VERSION 3.5)
project (example)

if(EXAMPLE_MSGPACK_EMBEDDED)
Expand Down
Loading