Make sure CXX_STANDARD can be overridden from outside (#1239)

This commit is contained in:
Gianfranco Costamagna 2023-10-23 14:20:22 +02:00 committed by GitHub
parent 145eec5f3e
commit db03655d58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,5 +15,7 @@ else()
endif()
add_executable(main main.cpp)
set_target_properties(main PROPERTIES CXX_STANDARD 11)
if (NOT DEFINED CMAKE_CXX_STANDARD)
set_target_properties(main PROPERTIES CXX_STANDARD 11)
endif()
target_link_libraries(main PRIVATE ${YAML_CPP_LIBRARIES})