[CMake] The Cygwin/Win32 warning

Nils Gladitz nilsgladitz at gmail.com
Sun Jul 13 05:32:03 EDT 2014


On 13.07.2014 02:19, Michael Enright wrote:
> I'm getting the WIN32 warning and I've tried a number of "first lines" 
> without making it go away. Since I'm using this two-file project to 
> gain experience with CMake I can and I have blown away the whole build 
> tree between attempts.
>
> I have used EACH of the following as the first line of CMakeLists.txt:
> set(CMAKE_LEGACY_CYGWIN_WIN32 0)
> cmake_minimum_required(VERSION 2.8.8)
> #cmake_minimum_required(VERSION 2.8.4)
>
> Also the above three lines are the head -3 of the current version of 
> the file. Indeed if those three lines are the ENTIRE file I get the 
> warning.
>

The code that emits the warning is run by "project()".
Since you do not have an explicit project() call in your top-level 
CMakeLists.txt CMake adds one to the top implicitly. [1]

A project file that explicitly calls project() after requiring CMake >= 
2.8.4 should make the warning go away:
   cmake_minimum_required(VERSION 2.8.8)
   project(Foo)

Nils

[1] http://www.cmake.org/cmake/help/v3.0/command/project.html (last 
paragraph)


More information about the CMake mailing list