Skip to content

Allow use of latest c++ standards. #122

Closed

Description

@VladimirTeza

the file cmake/SetCXXStandard.cmake forces compilation to either c++11 or c++14.
However project compiles with c++17 and c++20.
Would it be possible to add support of ^^?

Activity

  1. VladimirTeza commented on Jan 9, 2023

    @VladimirTeza
    Author

    One of the possible solutions, do not set standard if it is already set:

    diff --git a/cmake/SetCXXStandard.cmake b/cmake/SetCXXStandard.cmake
    index a0402ee..847171b 100644
    --- a/cmake/SetCXXStandard.cmake
    +++ b/cmake/SetCXXStandard.cmake
    @@ -1,10 +1,12 @@

    find_package(Boost 1.59.0 REQUIRED)
    +if(NOT DEFINED ${CMAKE_CXX_STANDARD})
    if(Boost_VERSION VERSION_LESS "1.72.0")
    set(CMAKE_CXX_STANDARD 11 CACHE INTERNAL "specifies the C++ standard whose features are requested to build this target")
    else()
    set(CMAKE_CXX_STANDARD 14 CACHE INTERNAL "specifies the C++ standard whose features are requested to build this target")
    endif()
    +endif()

    set(CMAKE_CXX_STANDARD_REQUIRED ON)
    if (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions