How do I activate C++ 11 in CMake?

As it turns out, SET(CMAKE_CXX_FLAGS “-std=c++0x”) does activate many C++11 features. The reason it did not work was that the statement looked like this: Following this approach, somehow the -std=c++0x flag was overwritten and it did not work. Setting the flags one by one or using a list method is working.

Looking for a ‘cmake clean’ command to clear up CMake output

CMake 3.X CMake 3.X offers a ‘clean’ target. From the CMake docs for 3.0.2: CMake 2.X There is no cmake clean in CMake version 2.X I usually build the project in a single folder like “build”. So if I want to make clean, I can just rm -rf build. The “build” folder in the same directory as the root … Read more

In CLion, header only library: file “does not belong to any project target, code insight features might not work properly”

Little background I was having the same problem, albeit the project was not header-only, nevertheless, the open files from inc folder were throwing the aforementioned warning, even though the CMake file clearly marked that folder to be include_directory. *.hpp files do not belong to ${SOURCE} Since this is a perfectly valid CMake file and adding the include files … Read more

Looking for a ‘cmake clean’ command to clear up CMake output

CMake 3.X CMake 3.X offers a ‘clean’ target. From the CMake docs for 3.0.2: CMake 2.X There is no cmake clean in CMake version 2.X I usually build the project in a single folder like “build”. So if I want to make clean, I can just rm -rf build. The “build” folder in the same directory as the root … Read more

tech