Skip to content

Commit

Permalink
cmake: bump minimum required to version 3.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
scribam committed Jul 12, 2023
1 parent bea4423 commit f17d319
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 28 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -341,26 +341,26 @@ jobs:
cat build/libxxhash.pc | grep "libdir=/usr/lib"
cat build/libxxhash.pc | grep "includedir=/usr/include"
- name: cmake minimum version v2.8.12 test
- name: cmake minimum version v3.5 test
run: |
mkdir -p cmake_bins
cd cmake_bins
wget https://cmake.org/files/v2.8/cmake-2.8.12.2-Linux-i386.tar.gz
tar xzf cmake-2.8.12.2-Linux-i386.tar.gz
wget https://cmake.org/files/v3.5/cmake-3.5.0-Linux-i386.tar.gz
tar xzf cmake-3.5.0-Linux-i386.tar.gz
cd ../cmake_unofficial
rm -rf build
pwd
ls
mkdir -p build
cd build
../../cmake_bins/cmake-2.8.12.2-Linux-i386/bin/cmake --version
../../cmake_bins/cmake-2.8.12.2-Linux-i386/bin/cmake ..
../../cmake_bins/cmake-2.8.12.2-Linux-i386/bin/cmake --build .
../../cmake_bins/cmake-3.5.0-Linux-i386/bin/cmake --version
../../cmake_bins/cmake-3.5.0-Linux-i386/bin/cmake ..
../../cmake_bins/cmake-3.5.0-Linux-i386/bin/cmake --build .
mkdir -p test_install_dir
DESTDIR=test_install_dir ../../cmake_bins/cmake-2.8.12.2-Linux-i386/bin/cmake --install .
DESTDIR=test_install_dir ../../cmake_bins/cmake-3.5.0-Linux-i386/bin/cmake --install .
rm -rf *
../../cmake_bins/cmake-2.8.12.2-Linux-i386/bin/cmake -DCMAKE_BUILD_TYPE=Debug ..
../../cmake_bins/cmake-2.8.12.2-Linux-i386/bin/cmake --build .
../../cmake_bins/cmake-3.5.0-Linux-i386/bin/cmake -DCMAKE_BUILD_TYPE=Debug ..
../../cmake_bins/cmake-3.5.0-Linux-i386/bin/cmake --build .
Expand Down
24 changes: 5 additions & 19 deletions cmake_unofficial/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
# For details, see <https://creativecommons.org/publicdomain/zero/1.0/>.

cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR)
cmake_minimum_required (VERSION 3.5 FATAL_ERROR)

set(XXHASH_DIR "${CMAKE_CURRENT_SOURCE_DIR}/..")

Expand All @@ -25,14 +25,10 @@ if("${CMAKE_VERSION}" VERSION_LESS "3.13")
else()
cmake_policy (SET CMP0077 NEW)
endif()
if("${CMAKE_VERSION}" VERSION_LESS "3.0")
project(xxHash C)
else()
cmake_policy (SET CMP0048 NEW)
project(xxHash
VERSION ${XXHASH_VERSION_STRING}
LANGUAGES C)
endif()
cmake_policy (SET CMP0048 NEW)
project(xxHash
VERSION ${XXHASH_VERSION_STRING}
LANGUAGES C)

if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Project build type" FORCE)
Expand Down Expand Up @@ -168,19 +164,9 @@ if(NOT XXHASH_BUNDLED_MODE)
${PROJECT_SOURCE_DIR}/xxHashConfig.cmake.in
${xxHash_PROJECT_CONFIG}
INSTALL_DESTINATION ${xxHash_CONFIG_INSTALL_DIR})
if("${CMAKE_VERSION}" VERSION_LESS "3.0")
set(XXHASH_EXPORT_SET xxhash)
if(XXHASH_BUILD_XXHSUM)
set(XXHASH_EXPORT_SET ${XXHASH_EXPORT_SET} xxhsum)
endif()
export(TARGETS ${XXHASH_EXPORT_SET}
FILE ${xxHash_TARGETS_CONFIG}
NAMESPACE ${PROJECT_NAME}::)
else()
export(EXPORT xxHashTargets
FILE ${xxHash_TARGETS_CONFIG}
NAMESPACE ${PROJECT_NAME}::)
endif()

install(FILES ${xxHash_PROJECT_CONFIG} ${xxHash_VERSION_CONFIG}
DESTINATION ${xxHash_CONFIG_INSTALL_DIR})
Expand Down

0 comments on commit f17d319

Please sign in to comment.