mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
Make everything work in cmake 3.8
This commit is contained in:
parent
b7834324b4
commit
806b629035
@ -184,7 +184,11 @@ if (CMAKE_COMPILER_IS_GNUCXX)
|
|||||||
# definitely heap allocated.
|
# definitely heap allocated.
|
||||||
add_compile_options(-Wno-free-nonheap-object)
|
add_compile_options(-Wno-free-nonheap-object)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
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>)
|
target_link_options(${target_name} PRIVATE $<$<CONFIG:RELEASE>:-s>)
|
||||||
|
endif()
|
||||||
|
|
||||||
elseif (MSVC)
|
elseif (MSVC)
|
||||||
# Treat warnings as errors.
|
# Treat warnings as errors.
|
||||||
@ -194,7 +198,11 @@ else() # basically Clang
|
|||||||
add_compile_options(-W -Werror)
|
add_compile_options(-W -Werror)
|
||||||
# This is for the comment in face_detection_ex.cpp that says "faces/*.jpg"
|
# This is for the comment in face_detection_ex.cpp that says "faces/*.jpg"
|
||||||
add_compile_options(-Wno-comment)
|
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>)
|
target_link_options(${target_name} PRIVATE $<$<CONFIG:RELEASE>:-s>)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
@ -106,8 +106,12 @@ target_link_libraries(assignment_learning_ex dlib::dlib)
|
|||||||
macro(add_example name)
|
macro(add_example name)
|
||||||
add_executable(${name} ${name}.cpp)
|
add_executable(${name} ${name}.cpp)
|
||||||
target_link_libraries(${name} dlib::dlib )
|
target_link_libraries(${name} dlib::dlib )
|
||||||
# And strip symbols to make your binary smaller if you like. Certainly not required though.
|
|
||||||
|
if(${CMAKE_VERSION} VERSION_GREATER "3.8.0")
|
||||||
|
# And strip symbols to make your binary smaller if you like. Certainly not
|
||||||
|
# required though.
|
||||||
target_link_options(${name} PRIVATE $<$<CONFIG:RELEASE>:-s>)
|
target_link_options(${name} PRIVATE $<$<CONFIG:RELEASE>:-s>)
|
||||||
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
# if an example requires GUI, call this macro to check DLIB_NO_GUI_SUPPORT to include or exclude
|
# if an example requires GUI, call this macro to check DLIB_NO_GUI_SUPPORT to include or exclude
|
||||||
|
Loading…
Reference in New Issue
Block a user