cmake will not compile to C++ 11 standard
<p>I'm new to C++ and have been struggling with compiling/making/linking/building/whatever, lets see if somebody can help me out.  I did some searches and found other people with similar problems but I tried their solutions with no luck, so here goes:</p>

<p>A simple c++ program that uses C++ 11 functionality such as uniform initialization, threads, <code>to_string</code>, etc... generates errors that <em>"xxx" was not declared in the scope</em>.  Specifically right now I'd like to use <code>to_string</code>, and using it in the <code>std</code> namespace or specifically <code>std::to_string</code> creates the error <em>"to_string" is not a member of STD</em>.  So clearly it's not compiling with C++ 11.</p>

<p>So here's my make file:</p>

<pre><code>#####################################
cmake_minimum_required (VERSION 2.8)
project (raspicam_test)
find_package(raspicam REQUIRED)
find_package(OpenCV)

IF  ( OpenCV_FOUND AND raspicam_CV_FOUND)
        MESSAGE(STATUS "COMPILING OPENCV TESTS")
        add_executable (main main.cpp)
        #target_compile_features(main PRIVATE cxx_range_for)
        set_property(TARGET main PROPERTY CXX_STANDARD 11)
        target_link_libraries (main ${raspicam_CV_LIBS})
ELSE()
        MESSAGE(FATAL_ERROR "OPENCV NOT FOUND IN YOUR SYSTEM")
ENDIF()
#####################################
</code></pre>

<p>As you can see I'm playing around with OpenCV on a raspberry pi.  But without the C++11 functions the program compiles and runs no issues.  But I would like to add threads and other goodies from C++11.  I added the line <code>set_property(TARGET main PROPERTY CXX_STANDARD_REQUIRED 11)</code> according to the CMAKE documentation:</p>

<p><a href="https://cmake.org/cmake/help/v3.1/prop_tgt/CXX_STANDARD.html" rel="noreferrer">https://cmake.org/cmake/help/v3.1/prop_tgt/CXX_STANDARD.html</a></p>

<p>And it made no difference in the errors generated.  I did it first without the <code>_REQUIRED</code> and then with it.  I also tried <code>target_compile_features()</code> instead but CMAKE returned with "unknown CMAKE command".</p>

<p>Other details:
-Compiling on a raspberry pi 3 running debian jessie
-CXX compiler is GNU 4.9.2
-CMAKE 3.0.2</p>