Skip to content

Commit

Permalink
Added a check for C++11 support. If not supported a warning is printe…
Browse files Browse the repository at this point in the history
…d and tests are not compiled.
  • Loading branch information
joelself committed Sep 6, 2016
1 parent d71d547 commit ab1b983
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ endif ()

project (FANN)

INCLUDE(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG(-std=c++11 COMPILER_SUPPORTS_CXX11)

IF(NOT COMPILER_SUPPORTS_CXX11)
message(WARNING "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Tests will not be compiled. To enable tests use a compiler that supports C++11.")
ENDIF()

list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules)

set (FANN_VERSION_MAJOR 2)
Expand Down Expand Up @@ -142,6 +149,9 @@ install (FILES
################# compile tests ################

ADD_SUBDIRECTORY( lib/googletest )
ADD_SUBDIRECTORY( tests )

if(COMPILER_SUPPORTS_CXX11)
ADD_SUBDIRECTORY( tests )
endif()

ENDIF()

0 comments on commit ab1b983

Please sign in to comment.