Changeset 3036 for trunk


Ignore:
Timestamp:
04/01/15 20:51:15 (9 years ago)
Author:
Kana Sugimoto
Message:

New Development: Yes

JIRA Issue: Yes (CAS-7383)

Ready for Test: Yes

Interface Changes: No

What Interface Changed:

Test Programs:

Put in Release Notes: No

Module(s): asap build

Description: Darrell's addition to CXX11 flag.


File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CMakeLists.txt

    r3035 r3036  
    77
    88# options
     9option (CXX11 "Compile as C++11 if possible" NO)
     10
    911option( USE_LIBCASACORE
    1012        "set ON to use libcasacore.so instead of libcasa_*.so"
     
    108110if( HAS_GCC_FORTRAN_RULES )
    109111     set( CMAKE_C_FLAGS "-fcx-fortran-rules ${CMAKE_C_FLAGS}" )
     112endif()
     113
     114# Detect if the compiler supports C++11 if we want to use it.
     115if (CXX11)
     116    if ((CMAKE_COMPILER_IS_GNUCXX AND NOT ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 4.6) OR
     117       (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND NOT ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 4.3))
     118        set(DEFAULT_CXX_FLAGS "${DEFAULT_CXX_FLAGS} -std=c++11 -DCXX11")
     119    else()
     120        option(CXX11 "" NO)
     121    endif()
    110122endif()
    111123
Note: See TracChangeset for help on using the changeset viewer.