[CMake] CMAKE 2.8.9 not observing CMAKE_FILES_DIRECTORY?

Eric Noulard eric.noulard at gmail.com
Fri Aug 24 10:33:27 EDT 2012


2012/8/24 Jason T. Slack-Moehrle <slackmoehrle at gmail.com>:
> Hi Eric,
>
>>> OS X 10.8, CMAKE 2.8.9.
>>>
>>> In CMAKE 2.8.9 it seems that CMAKE_FILES_DIRECTORY
>>>
>>> SET( PROJECT_BINARY_DIR "." )
>>> SET( CMAKE_FILES_DIRECTORY  ${PROJECT_BINARY_DIR}/output/CMakeFiles )
>>> SET( EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin )
>>>
>>> I dont see an 'output/CMakeFiles' created but I do see a 'bin' where
>>> my executable is put.
>
>> What makes you think that "PROJECT_BINARY_DIR" or
>> "CMAKE_FILES_DIRECTORY" may be modified?
>
> Ah, well, I had no idea that it was a read-only variable.
>
> So how do people move the location of CMakeFiles and the cache, etc
> away from the root? I dont want all the clutter there...

I guess 'root' means your source tree right?

Usually you use out-of-source build:
http://www.cmake.org/Wiki/CMake_FAQ#Out-of-source_build_trees

that way the "build" tree (a.k.a: PROJECT_BINARY_DIR)
is separated from "source" tree ((a.k.a: PROJECT_SOURCE_DIR).

That way all generated files goes into the build tree and your source
tree remains "clean", i.e. it only contains "manually" added/modified file.

-- 
Erk
Le gouvernement représentatif n'est pas la démocratie --
http://www.le-message.org


More information about the CMake mailing list