[CMake] Problems with CMP0037

Erik de Castro Lopo mle+tools at mega-nerd.com
Sun Nov 2 15:01:55 EST 2014


Rolf Eike Beer wrote:

> Because you can't create files or directories with that name, you would end up 
> getting one directory "tests" and a file/directory win32_test*. And creating 
> both with one API call isn't possible, so this may work if there is a 
> directory "tests" before because of some other reason, but it will not 
> reliably work.

In the 2.8.whatever, the following worked without any complaints:

    add_executable (tests/win32_test tests/win32_test.c)

In fact it worked just as I expected to in all ways, including being
about to run

    make tests/win32_test

to make just that executable.

I also discussed this issue on IRC with @ngladitz who suggested the following:

    add_executable (win32_test tests/win32_test.c)
    set_target_properties (win32_test PROPERTIES EXECUTABLE_OUTPUT_PATH tests)

Unfortunately, that does not behave as intended. The win32_test target
ends up in the "." directory instead of the in the "tests/" directory.

Erik
-- 
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/


More information about the CMake mailing list