Re: [CMake] C++11 flag not being added

2015-10-16 Thread Roman Wüger
You can use CMake 3.x on older systems. Write platform checks for specific C++11 features and implement "old" style code if the C++11 features (e.g. lambdas) are not available. Use https://cmake.org/cmake/help/v3.1/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.html and

Re: [CMake] C++11 flag not being added

2015-10-16 Thread Petr Kmoch
Hi Petr. You're using a feature (`CMAKE_CXX_STANDARD`) introduced in CMake version 3.1, so you should require a minimum version >= that. You can learn the version of CMake by running `cmake --version` Petr On Thu, Oct 15, 2015 at 5:45 PM, Petr Bena wrote: > What do you

Re: [CMake] C++11 flag not being added

2015-10-16 Thread Petr Bena
If I did that nearly nobody would be able to compile my program as cmake >= 3.1 is extremely rare on most distributions. Even ubuntu's PPA builder has some ancient version. On Fri, Oct 16, 2015 at 9:44 AM, Petr Kmoch wrote: > Hi Petr. > > You're using a feature

Re: [CMake] C++11 flag not being added

2015-10-16 Thread Roman Wüger
Hi Petr, you can download CMake from https://cmake.org/download/. There are also prebuilt binaries available. We use the *.sh files to install CMake on our linux servers. .) Install CMake to /opt/cmake-3.4.2. .) Create a symlink to /opt/cmake .) Create another symlink from the /opt/cmake/bin/*

Re: [CMake] C++11 flag not being added

2015-10-16 Thread Petr Bena
I think you completely misunderstood me. I know I can install it on my machine, but I can hardly install it on PC's or servers of users who use my program. I want to make it as easy as possible to let users compile my program. Having to install anything by hand instead of system package manager

Re: [CMake] C++11 flag not being added

2015-10-16 Thread Hendrik Sattler
Am 16. Oktober 2015 11:29:48 MESZ, schrieb Petr Bena : >I think you completely misunderstood me. I know I can install it on my >machine, but I can hardly install it on PC's or servers of users who >use my program. > >I want to make it as easy as possible to let users compile

Re: [CMake] C++11 flag not being added

2015-10-16 Thread Pau Garcia i Quiles
Hello, CMake 3.3.1 is available from my PPA, in case it helps: https://launchpad.net/~pgquiles/+archive/ubuntu/ppa On Fri, Oct 16, 2015 at 10:58 AM, Petr Bena wrote: > If I did that nearly nobody would be able to compile my program as > cmake >= 3.1 is extremely rare on

Re: [CMake] C++11 flag not being added

2015-10-16 Thread Hendrik Sattler
Am 16. Oktober 2015 11:29:48 MESZ, schrieb Petr Bena : >I think you completely misunderstood me. I know I can install it on my >machine, but I can hardly install it on PC's or servers of users who >use my program. > >I want to make it as easy as possible to let users compile

Re: [CMake] C++11 flag not being added

2015-10-16 Thread Hendrik Sattler
Am 16. Oktober 2015 13:38:27 MESZ, schrieb Petr Bena : >By stable you mean Jessie that was recently released and is almost >nowhere in production yet? :) > >On my debian server: > >$ cmake --version >cmake version 2.8.9 > >On one of wikimedia's ubuntu servers (the newer

Re: [CMake] C++11 flag not being added

2015-10-16 Thread Petr Bena
By stable you mean Jessie that was recently released and is almost nowhere in production yet? :) On my debian server: $ cmake --version cmake version 2.8.9 On one of wikimedia's ubuntu servers (the newer ones): $ cmake --version cmake version 2.8.12.2 On travis-ci cmake is about 2.8.7 and on

Re: [CMake] C++11 flag not being added

2015-10-15 Thread Matthew S Wallace
What version of CMake are you using? I’m using 3.3.2. The only other thing I did was: set_property(GLOBAL PROPERTY CXX_STANDARD_REQUIRED) I’m guessing this probably does nothing since it is probably a target property. -Matt > On Oct 15, 2015, at 10:34 AM, Petr Bena

Re: [CMake] C++11 flag not being added

2015-10-15 Thread Petr Bena
Can you elaborate on it a bit? I put set(CMAKE_CXX_STANDARD 11) as first line of my CMakeLists and it still doesn't work, without the hack I used I get errors while compiling. Can you give me example file in which it works? I guess there is more needed for it to work. On Tue, Oct 13, 2015 at

Re: [CMake] C++11 flag not being added

2015-10-15 Thread Petr Bena
What do you mean by "target" property? I don't see any target mentioned there. I don't have this line in there. I don't know which CMake this is, it failed on server we use for unit tests, but I have required min. version set to 2.8.7 On Thu, Oct 15, 2015 at 5:41 PM, Matthew S Wallace

[CMake] C++11 flag not being added

2015-10-13 Thread Matthew S Wallace
I have the following two lines in my CMakeLists.txt set_property(GLOBAL PROPERTY CXX_STANDARD 11) set_property(GLOBAL PROPERTY CXX_STANDARD_REQUIRED) However when compiling some of my source files, the -std=c++11 flag is not added. Just for good measure I added:

Re: [CMake] C++11 flag not being added

2015-10-13 Thread Petr Bena
I would also like to know this, right now I do this and it works, but it produced warnings on MSVC, so I did this nasty patch: if(WIN32) if(MINGW) SET(CMAKE_CXX_FLAGS "-mwindows -std=c++11") endif() else() SET(CMAKE_CXX_FLAGS "-std=c++11") endif() however doing just the

Re: [CMake] C++11 flag not being added

2015-10-13 Thread Johannes Zarl-Zierl
Hi, CXX_STANDARD is a target property, not a global one. You can either set CXX_STANDARD for every target that needs it, or set it globally by changing the default value. You can do the latter by setting the variable CMAKE_CXX_STANDARD before defining any target that depends on it:

Re: [CMake] C++11 flag not being added

2015-10-13 Thread Matthew S Wallace
Thanks, setting the global variable solved my issue. -Matt > On Oct 13, 2015, at 10:46 AM, Johannes Zarl-Zierl > wrote: > > Hi, > > CXX_STANDARD is a target property, not a global one. You can either set > CXX_STANDARD for every target that needs it, or set it