[CMake] How to add "modifiers" to functions

Eric Noulard eric.noulard at gmail.com
Sat Dec 17 08:15:04 EST 2011


2011/12/17 Renato Utsch <renatoutsch at gmail.com>:
> Doing this checking of in-source and out-of-source is easy!
>
> if( "${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}" )
>    message( FATAL_ERROR
>          "Do not make an in-source build with this project."
>    )
> endif( "${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}" )

Yes it is but it doesn't prevent your source tree to be cluttered with
CMakeCache.txt
etc...

Thus the next try to build out-of-source will in fact try an in-source build,
which usually puzzles the average user.

You'll have to remove CMakeCache.txt from the source tree in order to make
things work as you want again.

Try yourself and read the previously mentioned bug report,
you'll see what I mean.

>
> Ok, I will look the CMakeParseArguments module... thanks!

Please do not drop the ML address

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


More information about the CMake mailing list