Skip to content

Commit

Permalink
Merge pull request #79 from joelself/cmakec++11
Browse files Browse the repository at this point in the history
Added a CMake check for C++11 support.
  • Loading branch information
bukka authored May 19, 2018
2 parents 9d44c81 + ab1b983 commit 104f5a5
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 104f5a5

Please sign in to comment.