Advertisement
vivienneanthony

if not

Nov 4th, 2015
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. if(NOT WIN32 AND NOT WIN64)
  2.  
  3. ########################################
  4. ## require and enable C++0x/11/14
  5. ########################################
  6. include(CheckCXXCompilerFlag)
  7. CHECK_CXX_COMPILER_FLAG("-std=c++14" COMPILER_SUPPORTS_CXX14)
  8. CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
  9. CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
  10. if(COMPILER_SUPPORTS_CXX14)
  11. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
  12. message("-- Nanodbc compiler flag -std=c++14")
  13. elseif(COMPILER_SUPPORTS_CXX11)
  14. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
  15. message("-- Nanodbc compiler flag -std=c++11")
  16. elseif(COMPILER_SUPPORTS_CXX0X)
  17. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
  18. message("-- Nanodbc compiler flag -std=c++0x9")
  19. else()
  20. message(WARNING "-- Nanodbc compiler ${CMAKE_CXX_COMPILER} has no C++ 0x/11/14 support.")
  21. endif()
  22.  
  23.  
  24.  
  25. ########################################
  26. ## find unixODBC or iODBC config binary
  27. ########################################
  28. find_program(ODBC_CONFIG odbc_config $ENV{ODBC_PATH}/bin /usr/bin /usr/local/bin PATHS)
  29.  
  30. if(NOT ODBC_CONFIG)
  31. find_program(ODBC_CONFIG iodbc-config $ENV{ODBC_PATH}/bin /usr/bin /usr/local/bin PATHS)
  32. endif()
  33.  
  34. if(NOT ODBC_CONFIG)
  35. message(FATAL_ERROR "can not find odbc config program")
  36. else()
  37. message("-- ODBC found")
  38. endif()
  39.  
  40.  
  41. endif()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement