Skip to content

Commit

Permalink
increase cmake version to 3.17
Browse files Browse the repository at this point in the history
  • Loading branch information
TinyTinni committed Sep 7, 2024
1 parent e254b70 commit 5f94ad5
Show file tree
Hide file tree
Showing 37 changed files with 50 additions and 54 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/build_cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- master
- cuda-cmake
paths:
- ".github/workflows/build_cpp.yml"
- "**.cpp"
Expand All @@ -31,7 +30,7 @@ defaults:
working-directory: dlib/test

jobs:
ubuntu-latest-gcc-default-cmake-3-8-ffmpeg5:
ubuntu-latest-gcc-default-cmake-3-17-ffmpeg5:
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v2
Expand All @@ -41,18 +40,18 @@ jobs:
sudo apt update
sudo apt install libwebp-dev make yasm
- name: Cache cmake 3.8.0
- name: Cache cmake 3.17.0
uses: actions/cache@v3
id: cache-cmake-download
with:
# cache this folder:
path: ~/cmake-3.8.0-Linux-x86_64
key: cmake-3.8.0_try3
path: ~/cmake-3.17.0-Linux-x86_64
key: cmake-3.17.0_try3

- run: |
# Get the minimum version of cmake dlib supports
wget https://cmake.org/files/v3.8/cmake-3.8.0-Linux-x86_64.tar.gz
tar -xf cmake-3.8.0-Linux-x86_64.tar.gz -C ~
wget https://cmake.org/files/v3.17/cmake-3.17.0-Linux-x86_64.tar.gz
tar -xf cmake-3.17.0-Linux-x86_64.tar.gz -C ~
if: steps.cache-cmake-download.outputs.cache-hit != 'true'
- name: Cache FFmpeg 5
Expand All @@ -77,7 +76,7 @@ jobs:
run: |
mkdir build
cd build
~/cmake-3.8.0-Linux-x86_64/bin/cmake -DCMAKE_PREFIX_PATH=/home/runner/ffmpeg-n5.1.3_installation ..
~/cmake-3.17.0-Linux-x86_64/bin/cmake -DCMAKE_PREFIX_PATH=/home/runner/ffmpeg-n5.1.3_installation ..
- name: Build just tests
run: |
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.8.0)
cmake_minimum_required(VERSION 3.17.0)

project(dlib_project)

Expand Down
7 changes: 3 additions & 4 deletions dlib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -647,16 +647,15 @@ if (NOT TARGET dlib)
endif()
endif()

find_package(OpenMP)
set(openmp_libraries ${OpenMP_CXX_FLAGS})


if (DLIB_USE_CUDA)
find_package(CUDAToolkit 9.1)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake_utils)
find_package(CUDNN)
find_package(OpenMP)
set(openmp_libraries ${OpenMP_CXX_FLAGS})

if (CUDAToolkit_FOUND AND CUDNN_FOUND)
if (CUDAToolkit_FOUND AND CUDNN_FOUND AND OPENMP_FOUND)
set(source_files ${source_files}
cuda/cuda_dlib.cu
cuda/cudnn_dlibapi.cpp
Expand Down
2 changes: 1 addition & 1 deletion dlib/cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

cmake_minimum_required(VERSION 3.8.0)
cmake_minimum_required(VERSION 3.17.0)

add_subdirectory(${CMAKE_CURRENT_LIST_DIR} dlib_build)

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This script checks if your compiler and host processor can generate and then run programs with AVX instructions.

cmake_minimum_required(VERSION 3.8.0)
cmake_minimum_required(VERSION 3.17.0)

# Don't rerun this script if its already been executed.
if (DEFINED AVX_IS_AVAILABLE_ON_HOST)
Expand Down
2 changes: 1 addition & 1 deletion dlib/cmake_utils/check_if_neon_available.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This script checks if __ARM_NEON__ is defined for your compiler

cmake_minimum_required(VERSION 3.8.0)
cmake_minimum_required(VERSION 3.17.0)

# Don't rerun this script if its already been executed.
if (DEFINED ARM_NEON_IS_AVAILABLE)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This script checks if your compiler and host processor can generate and then run programs with SSE4 instructions.

cmake_minimum_required(VERSION 3.8.0)
cmake_minimum_required(VERSION 3.17.0)

# Don't rerun this script if its already been executed.
if (DEFINED SSE4_IS_AVAILABLE_ON_HOST)
Expand Down
2 changes: 1 addition & 1 deletion dlib/cmake_utils/find_ffmpeg.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.8.0)
cmake_minimum_required(VERSION 3.17.0)

message(STATUS "Searching for FFMPEG/LIBAV")
find_package(PkgConfig)
Expand Down
2 changes: 1 addition & 1 deletion dlib/cmake_utils/find_libjpeg.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#This script just runs CMake's built in JPEG finding tool. But it also checks that the
#copy of libjpeg that cmake finds actually builds and links.

cmake_minimum_required(VERSION 3.8.0)
cmake_minimum_required(VERSION 3.17.0)

if (BUILDING_PYTHON_IN_MSVC)
# Never use any system copy of libjpeg when building python in visual studio
Expand Down
2 changes: 1 addition & 1 deletion dlib/cmake_utils/find_libpng.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#This script just runs CMake's built in PNG finding tool. But it also checks that the
#copy of libpng that cmake finds actually builds and links.

cmake_minimum_required(VERSION 3.8.0)
cmake_minimum_required(VERSION 3.17.0)

if (BUILDING_PYTHON_IN_MSVC)
# Never use any system copy of libpng when building python in visual studio
Expand Down
2 changes: 1 addition & 1 deletion dlib/cmake_utils/set_compiler_specific_options.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

cmake_minimum_required(VERSION 3.8.0)
cmake_minimum_required(VERSION 3.17.0)


# Check if we are being built as part of a pybind11 module.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Including this cmake script into your cmake project will cause visual studio
# to build your project against the static C runtime.

cmake_minimum_required(VERSION 3.8.0)
cmake_minimum_required(VERSION 3.17.0)

if (MSVC OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
option (DLIB_FORCE_MSVC_STATIC_RUNTIME "use static runtime" ON)
Expand Down
2 changes: 1 addition & 1 deletion dlib/cmake_utils/test_for_avx/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

cmake_minimum_required(VERSION 3.8.0)
cmake_minimum_required(VERSION 3.17.0)
project(avx_test)

set(USE_AVX_INSTRUCTIONS ON CACHE BOOL "Use AVX instructions")
Expand Down
2 changes: 1 addition & 1 deletion dlib/cmake_utils/test_for_cuda/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

cmake_minimum_required(VERSION 3.8.0)
cmake_minimum_required(VERSION 3.17.0)
project(cuda_test)

include_directories(../../cuda)
Expand Down
2 changes: 1 addition & 1 deletion dlib/cmake_utils/test_for_cudnn/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

cmake_minimum_required(VERSION 3.8.0)
cmake_minimum_required(VERSION 3.17.0)
project(cudnn_test)

# Override the FindCUDA.cmake setting to avoid duplication of host flags if using a toolchain:
Expand Down
2 changes: 1 addition & 1 deletion dlib/cmake_utils/test_for_libjpeg/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

cmake_minimum_required(VERSION 3.8.0)
cmake_minimum_required(VERSION 3.17.0)
project(test_if_libjpeg_is_broken)

find_package(JPEG)
Expand Down
2 changes: 1 addition & 1 deletion dlib/cmake_utils/test_for_libjxl/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

cmake_minimum_required(VERSION 3.8.0)
cmake_minimum_required(VERSION 3.17.0)
project(test_if_libjxl_is_broken)

include_directories(${JXL_INCLUDE_DIR})
Expand Down
2 changes: 1 addition & 1 deletion dlib/cmake_utils/test_for_libpng/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

cmake_minimum_required(VERSION 3.8.0)
cmake_minimum_required(VERSION 3.17.0)
project(test_if_libpng_is_broken)

find_package(PNG)
Expand Down
2 changes: 1 addition & 1 deletion dlib/cmake_utils/test_for_libwebp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

cmake_minimum_required(VERSION 3.8.0)
cmake_minimum_required(VERSION 3.17.0)
project(test_if_libwebp_is_broken)

include_directories(${WEBP_INCLUDE_DIR})
Expand Down
2 changes: 1 addition & 1 deletion dlib/cmake_utils/test_for_neon/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

cmake_minimum_required(VERSION 3.8.0)
cmake_minimum_required(VERSION 3.17.0)
project(neon_test)

add_library(neon_test STATIC neon_test.cpp )
Expand Down
2 changes: 1 addition & 1 deletion dlib/cmake_utils/test_for_sse4/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

cmake_minimum_required(VERSION 3.8.0)
cmake_minimum_required(VERSION 3.17.0)
project(sse4_test)

set(USE_SSE4_INSTRUCTIONS ON CACHE BOOL "Use SSE4 instructions")
Expand Down
2 changes: 1 addition & 1 deletion dlib/external/cblas/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#


cmake_minimum_required(VERSION 3.8.0)
cmake_minimum_required(VERSION 3.17.0)
project(cblas)


Expand Down
6 changes: 3 additions & 3 deletions dlib/external/pybind11/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
if(OSX AND CMAKE_VERSION VERSION_LESS 3.7)
# Bug in macOS CMake < 3.7 is unable to download catch
message(WARNING "CMAKE 3.7+ needed on macOS to download catch, and newer HIGHLY recommended")
elseif(WINDOWS AND CMAKE_VERSION VERSION_LESS 3.8)
# Only tested with 3.8+ in CI.
message(WARNING "CMAKE 3.8+ tested on Windows, previous versions untested")
elseif(WINDOWS AND CMAKE_VERSION VERSION_LESS 3.17)
# Only tested with 3.8´17+ in CI.
message(WARNING "CMAKE 3.17+ tested on Windows, previous versions untested")
endif()

message(STATUS "CMake ${CMAKE_VERSION}")
Expand Down
2 changes: 1 addition & 1 deletion dlib/java/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

cmake_minimum_required(VERSION 3.8.0)
cmake_minimum_required(VERSION 3.17.0)
project (myproject)
set(java_package_name net.dlib)
set(source_files
Expand Down
4 changes: 2 additions & 2 deletions dlib/java/cmake_swig_jni
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# it by defining some CMake variables and then include(cmake_swig_jni). You
# would make a CMakeLists.txt file that looks like the following:
#
# cmake_minimum_required (VERSION 3.8.0)
# cmake_minimum_required (VERSION 3.17.0)
# project (example)
# set(java_package_name "org.mycompany")
# set(source_files
Expand Down Expand Up @@ -40,7 +40,7 @@
################################################################################
################################################################################

cmake_minimum_required (VERSION 3.8.0)
cmake_minimum_required (VERSION 3.17.0)

# This block of code tries to figure out what the JAVA_HOME environment
# variable should be by looking at the folder that contains the java
Expand Down
2 changes: 1 addition & 1 deletion dlib/matlab/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

cmake_minimum_required(VERSION 3.8.0)
cmake_minimum_required(VERSION 3.17.0)

PROJECT(mex_functions)

Expand Down
2 changes: 1 addition & 1 deletion dlib/matlab/cmake_mex_wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# that additional library dependencies can be added like this: add_mex_function(name lib1 dlib libetc).
# That is, just add more libraries after the name and they will be build into the mex file.

cmake_minimum_required(VERSION 3.8.0)
cmake_minimum_required(VERSION 3.17.0)

set(BUILDING_MATLAB_MEX_FILE true)
set(CMAKE_POSITION_INDEPENDENT_CODE True)
Expand Down
8 changes: 3 additions & 5 deletions dlib/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# information about it at http://www.cmake.org
#

cmake_minimum_required(VERSION 3.8.0)
cmake_minimum_required(VERSION 3.17.0)

# create a variable called target_name and set it to the string "dtest"
set (target_name dtest)
Expand Down Expand Up @@ -213,10 +213,8 @@ else() # basically Clang
# This is for the comment in face_detection_ex.cpp that says "faces/*.jpg"
add_compile_options(-Wno-comment)

if(${CMAKE_VERSION} VERSION_GREATER "3.8.0")
# strip debug symbols to make the binary smaller
target_link_options(${target_name} PRIVATE $<$<CONFIG:RELEASE>:-s>)
endif()
# strip debug symbols to make the binary smaller
target_link_options(${target_name} PRIVATE $<$<CONFIG:RELEASE>:-s>)
endif()


Expand Down
2 changes: 1 addition & 1 deletion dlib/test/blas_bindings/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# information about it at http://www.cmake.org
#

cmake_minimum_required(VERSION 3.8.0)
cmake_minimum_required(VERSION 3.17.0)

# This variable contains a list of all the tests we are building
# into the regression test suite.
Expand Down
2 changes: 1 addition & 1 deletion dlib/test/tools/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.8.0)
cmake_minimum_required(VERSION 3.17.0)

add_subdirectory(../../../tools/imglab imglab_build)
add_subdirectory(../../../tools/htmlify htmlify_build)
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/release_notes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ New Features and Improvements:
- FFMPEG wrappers: dlib::ffmpeg::decoder and dlib::ffmpeg::demuxer (PR #2707)

Non-Backwards Compatible Changes:
- Dlib now requires C++14 and at least CMake version 3.8.0.
- Dlib now requires C++14 and at least CMake version 3.17.0.

Bug fixes:
- Various adjustments to avoid errors on unusual platforms of system configurations.
Expand Down
2 changes: 1 addition & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#


cmake_minimum_required(VERSION 3.8.0)
cmake_minimum_required(VERSION 3.17.0)
# Every project needs a name. We call this the "examples" project.
project(examples)

Expand Down
2 changes: 1 addition & 1 deletion tools/archive/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#


cmake_minimum_required(VERSION 3.8.0)
cmake_minimum_required(VERSION 3.17.0)
PROJECT(archive)


Expand Down
2 changes: 1 addition & 1 deletion tools/convert_dlib_nets_to_caffe/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# information about it at http://www.cmake.org
#

cmake_minimum_required(VERSION 3.8.0)
cmake_minimum_required(VERSION 3.17.0)

set (target_name dtoc)

Expand Down
2 changes: 1 addition & 1 deletion tools/htmlify/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# information about it at http://www.cmake.org
#

cmake_minimum_required(VERSION 3.8.0)
cmake_minimum_required(VERSION 3.17.0)

# create a variable called target_name and set it to the string "htmlify"
set (target_name htmlify)
Expand Down
2 changes: 1 addition & 1 deletion tools/imglab/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# information about it at http://www.cmake.org
#

cmake_minimum_required(VERSION 3.8.0)
cmake_minimum_required(VERSION 3.17.0)

# create a variable called target_name and set it to the string "imglab"
set (target_name imglab)
Expand Down
2 changes: 1 addition & 1 deletion tools/python/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

CMAKE_MINIMUM_REQUIRED(VERSION 3.8.0)
CMAKE_MINIMUM_REQUIRED(VERSION 3.17.0)

if (WIN32 AND NOT "${CMAKE_GENERATOR}" MATCHES "Visual Studio")
message(FATAL_ERROR "\n"
Expand Down

0 comments on commit 5f94ad5

Please sign in to comment.