Skip to content

Compilation fails with older CMake #2

@Narcolessico

Description

@Narcolessico

Hi,

CMAKE_CXX_STANDARD does not work with older cmake versions (not sure which one, but 2.4 does not support it); therefore, it builds with C++ < 11 and fails (e.g. "nullptr").

If version is less than 3.1, CXX flags should be set explicitly:

if (CMAKE_VERSION VERSION_LESS "3.1")
    if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
      set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
    endif ()
  else ()
    set (CMAKE_CXX_STANDARD 11)
  endif ()

Regards
Eugenio

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions