[CMake] Re: CMake Marketing

E. Wing ewmailing at gmail.com
Fri Dec 23 17:12:14 EST 2005


> In your CMakeLists.txt file you can test for an in-source build and give
> an error:
>
> # Disallow in-source build
> STRING(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}"
>         INSOURCE)
> IF(INSOURCE)
>    MESSAGE(FATAL_ERROR "This project requires an out of source build.")
> ENDIF(INSOURCE)
>
> -Brad
>
Interesting, but the trouble I point out is not that my project
actually requires an out of source build, but new users just never
seem to do it the first time around. The projects will compile, but
then down the road if the user wants to clean up the source tree for
check-in, or if the CMake cache got stale/corrupted somehow and the
whole system needs to be purged and regenerated, it is very painful to
selectively kill-off just the CMake generated files. That's why a
dist-clean would be very helpful.

Thanks,
Eric


More information about the CMake mailing list