I am trying to get some help on a CMake tutorial, Step 3, Exercise 2
https://cmake.org/cmake/help/latest/guide/tutorial/Adding%20Usage%20Requirements%20for%20a%20Library.html#exercise-2-setting-the-c-standard-with-interface-libraries
It asks the user to remove the following lines.
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
and create an INTERFACE library target_compile_features(tutorial_compiler_flags INTERFACE cxx_std_11) and link tutorial_compiler_flags to other targets (libraries and executable).
In my opinion, the problem asks me to eliminate the global constraints and make the system more flexible, allowing any libraries linking to our executable to use any C++ version.
However, the solution manual (TODO 5-7) links to the INTERFACE library tutorial_compiler_flags using the PUBLIC keyword. I think this means that any library or executable linking to my executable will also have to use C++11, and the same applies to me. Since the point of the exercise was to make the system more flexible, I considered using the PRIVATE keyword to be more appropriate.
Do you think I misunderstood some concept?