Commit b41455fd authored by Alain Vaucher's avatar Alain Vaucher

Change minimum CMake version that supports the introduced features

parent 574446ae
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# #
cmake_minimum_required(VERSION 2.8.4) cmake_minimum_required(VERSION 2.8.12)
project(dlib) project(dlib)
# default to a Release build (except if CMAKE_BUILD_TYPE is set) # default to a Release build (except if CMAKE_BUILD_TYPE is set)
...@@ -646,7 +646,12 @@ if (NOT TARGET dlib) ...@@ -646,7 +646,12 @@ if (NOT TARGET dlib)
else() else()
add_library(dlib STATIC ${source_files} ) add_library(dlib STATIC ${source_files} )
endif() endif()
target_link_libraries(dlib PRIVATE ${dlib_needed_libraries} ) target_include_directories(dlib
INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
INTERFACE $<INSTALL_INTERFACE:include>
PUBLIC ${dlib_needed_includes}
)
target_link_libraries(dlib PRIVATE ${dlib_needed_libraries})
if (UNIX AND NOT DLIB_IN_PROJECT_BUILD) if (UNIX AND NOT DLIB_IN_PROJECT_BUILD)
if (DLIB_USE_CUDA) if (DLIB_USE_CUDA)
cuda_add_library(dlib_shared SHARED ${source_files} ) cuda_add_library(dlib_shared SHARED ${source_files} )
...@@ -655,7 +660,12 @@ if (NOT TARGET dlib) ...@@ -655,7 +660,12 @@ if (NOT TARGET dlib)
add_library(dlib_shared SHARED ${source_files} ) add_library(dlib_shared SHARED ${source_files} )
add_dependencies(dlib_shared dlib) add_dependencies(dlib_shared dlib)
endif() endif()
target_link_libraries(dlib_shared PRIVATE ${dlib_needed_libraries} ) target_include_directories(dlib_shared
INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
INTERFACE $<INSTALL_INTERFACE:include>
PUBLIC ${dlib_needed_includes}
)
target_link_libraries(dlib_shared PRIVATE ${dlib_needed_libraries})
endif() endif()
endif () ##### end of if NOT DLIB_ISO_CPP_ONLY ########################################################## endif () ##### end of if NOT DLIB_ISO_CPP_ONLY ##########################################################
...@@ -665,20 +675,6 @@ if (NOT TARGET dlib) ...@@ -665,20 +675,6 @@ if (NOT TARGET dlib)
ADD_LIBRARY(dlib_all_source_cpp STATIC all/source.cpp) ADD_LIBRARY(dlib_all_source_cpp STATIC all/source.cpp)
endif() endif()
# Specify the include directory for CMake targets relying on dlib.
target_include_directories(dlib
INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
INTERFACE $<INSTALL_INTERFACE:include>
PUBLIC ${dlib_needed_includes}
)
if (UNIX AND NOT DLIB_IN_PROJECT_BUILD)
target_include_directories(dlib_shared
INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
INTERFACE $<INSTALL_INTERFACE:include>
PUBLIC ${dlib_needed_includes}
)
endif()
# Install the library # Install the library
if (NOT DLIB_IN_PROJECT_BUILD) if (NOT DLIB_IN_PROJECT_BUILD)
set (LIB_INSTALL_DIR lib CACHE STRING "Install location of libraries (e.g. lib32 or lib64 for multilib installations)") set (LIB_INSTALL_DIR lib CACHE STRING "Install location of libraries (e.g. lib32 or lib64 for multilib installations)")
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# It will trigger a compilation of dlib *in the project* # It will trigger a compilation of dlib *in the project*
# including it # including it
cmake_minimum_required(VERSION 2.8.4) cmake_minimum_required(VERSION 2.8.12)
set(DLIB_IN_PROJECT_BUILD true) set(DLIB_IN_PROJECT_BUILD true)
......
cmake_minimum_required(VERSION 2.8.4) cmake_minimum_required(VERSION 2.8.12)
# Make macros that can add compiler switches to the entire project. Not just # Make macros that can add compiler switches to the entire project. Not just
# to the current cmake folder being built. # to the current cmake folder being built.
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Including this cmake script into your cmake project will cause visual studio # Including this cmake script into your cmake project will cause visual studio
# to build your project against the static C runtime. # to build your project against the static C runtime.
cmake_minimum_required(VERSION 2.8.4) cmake_minimum_required(VERSION 2.8.12)
if (POLICY CMP0054) if (POLICY CMP0054)
cmake_policy(SET CMP0054 NEW) cmake_policy(SET CMP0054 NEW)
endif() endif()
......
cmake_minimum_required(VERSION 2.8.4) cmake_minimum_required(VERSION 2.8.12)
project(cpp11_test) project(cpp11_test)
# Try to enable C++11 # Try to enable C++11
......
cmake_minimum_required(VERSION 2.8.4) cmake_minimum_required(VERSION 2.8.12)
project(cuda_test) project(cuda_test)
include_directories(../../dnn) include_directories(../../dnn)
......
cmake_minimum_required(VERSION 2.8.4) cmake_minimum_required(VERSION 2.8.12)
project(cudnn_test) project(cudnn_test)
include(../use_cpp_11.cmake) include(../use_cpp_11.cmake)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Also, it sets the COMPILER_CAN_DO_CPP_11 variable to 1 if it was successful. # Also, it sets the COMPILER_CAN_DO_CPP_11 variable to 1 if it was successful.
cmake_minimum_required(VERSION 2.8.4) cmake_minimum_required(VERSION 2.8.12)
# Don't rerun this script if its already been executed. # Don't rerun this script if its already been executed.
if (DEFINED COMPILER_CAN_DO_CPP_11) if (DEFINED COMPILER_CAN_DO_CPP_11)
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# #
cmake_minimum_required(VERSION 2.8.4) cmake_minimum_required(VERSION 2.8.12)
project(cblas) project(cblas)
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# information about it at http://www.cmake.org # information about it at http://www.cmake.org
# #
cmake_minimum_required(VERSION 2.8.4) cmake_minimum_required(VERSION 2.8.12)
# create a variable called target_name and set it to the string "dtest" # create a variable called target_name and set it to the string "dtest"
set (target_name dtest) set (target_name dtest)
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# information about it at http://www.cmake.org # information about it at http://www.cmake.org
# #
cmake_minimum_required(VERSION 2.8.4) cmake_minimum_required(VERSION 2.8.12)
# This variable contains a list of all the tests we are building # This variable contains a list of all the tests we are building
# into the regression test suite. # into the regression test suite.
......
cmake_minimum_required(VERSION 2.8.4) cmake_minimum_required(VERSION 2.8.12)
add_subdirectory(../../../tools/imglab imglab_build) add_subdirectory(../../../tools/imglab imglab_build)
add_subdirectory(../../../tools/htmlify htmlify_build) add_subdirectory(../../../tools/htmlify htmlify_build)
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# #
cmake_minimum_required(VERSION 2.8.4) cmake_minimum_required(VERSION 2.8.12)
PROJECT(examples) PROJECT(examples)
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# information about it at http://www.cmake.org # information about it at http://www.cmake.org
# #
cmake_minimum_required(VERSION 2.8.4) cmake_minimum_required(VERSION 2.8.12)
# create a variable called target_name and set it to the string "htmlify" # create a variable called target_name and set it to the string "htmlify"
set (target_name htmlify) set (target_name htmlify)
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# information about it at http://www.cmake.org # information about it at http://www.cmake.org
# #
cmake_minimum_required(VERSION 2.8.4) cmake_minimum_required(VERSION 2.8.12)
# create a variable called target_name and set it to the string "imglab" # create a variable called target_name and set it to the string "imglab"
set (target_name imglab) set (target_name imglab)
......
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.4) CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12)
set(USE_SSE4_INSTRUCTIONS ON CACHE BOOL "Use SSE4 instructions") set(USE_SSE4_INSTRUCTIONS ON CACHE BOOL "Use SSE4 instructions")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment