Commit 6ed65bf3 authored by Davis King's avatar Davis King

Fixed a few cmake errors, one regarding CUDA compilation and another

about the all/source.cpp test compile.
parent 974dc0cb
...@@ -22,13 +22,10 @@ if(has_parent) ...@@ -22,13 +22,10 @@ if(has_parent)
set(DLIB_VERSION ${VERSION} PARENT_SCOPE) set(DLIB_VERSION ${VERSION} PARENT_SCOPE)
endif() endif()
# Suppress cmake warnings about changes in new versions. # Set only because there are old target_link_libraries() statements in the
if(COMMAND cmake_policy) # FindCUDA.cmake file that comes with CMake that error out if the new behavior
cmake_policy(SET CMP0003 NEW) # is used.
if (POLICY CMP0054) cmake_policy(SET CMP0023 OLD)
cmake_policy(SET CMP0054 NEW)
endif()
endif()
include(cmake_utils/add_global_compiler_switch.cmake) include(cmake_utils/add_global_compiler_switch.cmake)
...@@ -634,6 +631,9 @@ if (NOT TARGET dlib) ...@@ -634,6 +631,9 @@ if (NOT TARGET dlib)
# Tell CMake to build dlib via add_library()/cuda_add_library() # Tell CMake to build dlib via add_library()/cuda_add_library()
if (DLIB_USE_CUDA) if (DLIB_USE_CUDA)
# The old cuda_add_library() command doesn't support CMake's newer dependency
# stuff, so we have to set the include path manually still, which we do here.
include_directories(${dlib_needed_includes})
cuda_add_library(dlib STATIC ${source_files} ) cuda_add_library(dlib STATIC ${source_files} )
else() else()
add_library(dlib STATIC ${source_files} ) add_library(dlib STATIC ${source_files} )
...@@ -665,6 +665,7 @@ if (NOT TARGET dlib) ...@@ -665,6 +665,7 @@ if (NOT TARGET dlib)
# Allow the unit tests to ask us to compile the all/source.cpp file just to make sure it compiles. # Allow the unit tests to ask us to compile the all/source.cpp file just to make sure it compiles.
if (DLIB_TEST_COMPILE_ALL_SOURCE_CPP) if (DLIB_TEST_COMPILE_ALL_SOURCE_CPP)
ADD_LIBRARY(dlib_all_source_cpp STATIC all/source.cpp) ADD_LIBRARY(dlib_all_source_cpp STATIC all/source.cpp)
target_link_libraries(dlib_all_source_cpp dlib)
endif() endif()
# Install the library # Install the library
......
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