Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
2787edc9
Commit
2787edc9
authored
Oct 09, 2016
by
Davis King
Browse files
Improved error messages about non-C++11 compilers and made the example cmake
file a little clearer on this issue.
parent
60b1c440
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
dlib/cmake_utils/use_cpp_11.cmake
dlib/cmake_utils/use_cpp_11.cmake
+6
-2
examples/CMakeLists.txt
examples/CMakeLists.txt
+5
-2
No files found.
dlib/cmake_utils/use_cpp_11.cmake
View file @
2787edc9
...
@@ -47,7 +47,7 @@ if (CMAKE_VERSION VERSION_LESS "3.1.2")
...
@@ -47,7 +47,7 @@ if (CMAKE_VERSION VERSION_LESS "3.1.2")
message
(
STATUS
"C++11 activated."
)
message
(
STATUS
"C++11 activated."
)
set
(
COMPILER_CAN_DO_CPP_11 1
)
set
(
COMPILER_CAN_DO_CPP_11 1
)
else
()
else
()
message
(
STATUS
"*** Your compiler failed to build a C++11 project, so dlib won't use C++11 features.***"
)
message
(
FATAL_ERROR
"*** Your compiler failed to build a C++11 project, so dlib won't use C++11 features.***"
)
endif
()
endif
()
endif
()
endif
()
elseif
(
MSVC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0.24215.1
)
elseif
(
MSVC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0.24215.1
)
...
@@ -55,6 +55,9 @@ elseif(MSVC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0.24215.1 )
...
@@ -55,6 +55,9 @@ elseif(MSVC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0.24215.1 )
message
(
STATUS
"So we aren't enabling things that require full C++11 support (e.g. the deep learning tools)."
)
message
(
STATUS
"So we aren't enabling things that require full C++11 support (e.g. the deep learning tools)."
)
message
(
STATUS
"Also, be aware that Visual Studio's version naming is confusing, in particular, there are multiple versions of 'update 3'"
)
message
(
STATUS
"Also, be aware that Visual Studio's version naming is confusing, in particular, there are multiple versions of 'update 3'"
)
message
(
STATUS
"So if you are getting this message you need to update to the newer version of Visual Studio to use full C++11."
)
message
(
STATUS
"So if you are getting this message you need to update to the newer version of Visual Studio to use full C++11."
)
set
(
USING_OLD_VISUAL_STUDIO_COMPILER 1
)
elseif
(
MSVC AND MSVC_VERSION VERSION_LESS 1900
)
message
(
FATAL_ERROR
"C++11 is required to use dlib, but the version of Visual Studio you are using is too old and doesn't support C++11."
)
else
()
else
()
# Set a flag if the compiler you are using is capable of providing C++11 features.
# Set a flag if the compiler you are using is capable of providing C++11 features.
...
@@ -79,7 +82,8 @@ else()
...
@@ -79,7 +82,8 @@ else()
endif
()
endif
()
endif
()
endif
()
# Always enable whatever partial C++11 support we have, even if it isn't full support.
# Always enable whatever partial C++11 support we have, even if it isn't full
# support, and just hope for the best.
if
(
NOT COMPILER_CAN_DO_CPP_11
)
if
(
NOT COMPILER_CAN_DO_CPP_11
)
include
(
CheckCXXCompilerFlag
)
include
(
CheckCXXCompilerFlag
)
CHECK_CXX_COMPILER_FLAG
(
"-std=c++11"
COMPILER_SUPPORTS_CXX11
)
CHECK_CXX_COMPILER_FLAG
(
"-std=c++11"
COMPILER_SUPPORTS_CXX11
)
...
...
examples/CMakeLists.txt
View file @
2787edc9
...
@@ -38,8 +38,11 @@ MACRO(add_gui_example name)
...
@@ -38,8 +38,11 @@ MACRO(add_gui_example name)
endif
()
endif
()
ENDMACRO
()
ENDMACRO
()
# The deep learning toolkit requires a C++11 capable compiler.
# The deep learning toolkit requires a compiler with essentially complete C++11
if
(
COMPILER_CAN_DO_CPP_11
)
# support. However, versions of Visual Studio prior to October 2016 didn't
# provide enough C++11 support to compile the DNN tooling, but were good enough
# to compile the rest of dlib.
if
(
NOT USING_OLD_VISUAL_STUDIO_COMPILER
)
add_example
(
dnn_introduction_ex
)
add_example
(
dnn_introduction_ex
)
add_example
(
dnn_introduction2_ex
)
add_example
(
dnn_introduction2_ex
)
add_example
(
dnn_inception_ex
)
add_example
(
dnn_inception_ex
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment