Make everything work in cmake 3.8

pull/2751/head
Davis King 2 years ago
parent b7834324b4
commit 806b629035

@ -184,7 +184,11 @@ if (CMAKE_COMPILER_IS_GNUCXX)
# definitely heap allocated.
add_compile_options(-Wno-free-nonheap-object)
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>)
endif()
elseif (MSVC)
# Treat warnings as errors.
@ -194,7 +198,11 @@ else() # basically Clang
add_compile_options(-W -Werror)
# 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()
endif()

@ -106,8 +106,12 @@ target_link_libraries(assignment_learning_ex dlib::dlib)
macro(add_example name)
add_executable(${name} ${name}.cpp)
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>)
endif()
endmacro()
# if an example requires GUI, call this macro to check DLIB_NO_GUI_SUPPORT to include or exclude

Loading…
Cancel
Save