Closed playgithub closed 3 years ago
@playgithub ,You can setting it during the configure call.
vcpkg_configure_cmake(
...
-DCMAKE_CXX_STANDARD 17
)
@playgithub ,You can setting it during the configure call.
vcpkg_configure_cmake( ... -DCMAKE_CXX_STANDARD 17 )
But by this who is using C++14 can't use the port.
@playgithub ,It can be solved by adding features, adding C++17 as an option to the portifile.cmake file:
if("cxx17" IN_LIST FEATURES)
set(CXX_STANDARD 17)
else()
set(CXX_STANDARD 14)
endif()
vcpkg_configure_cmake(
...
-DCXX_STANDARD=${CXX_STANDARD}
)
For a new version of vcpkg(version 2024-03-14-7d353e869753e5609a1f1a057df3db8fd356e49d), I change the file in ~/vcpkg/ports/avro-cpp/portfile.cmake
for the library avro-cpp
that I want to use, e.g.-DCMAKE_CXX_STANDARD=20
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}/lang/c++"
OPTIONS
-DBUILD_TESTING=OFF
-DCMAKE_CXX_STANDARD=20
${FEATURE_OPTIONS}
)
e.g. C++17 application can not use poppler that is built in C++14.
In
CMakeLists.txt
Does it need multiple ports to support different C++ standards, e.g. port
poppler-cpp14
for C++14 and portpoppler-cpp17
for C++17? Any better way?