[CMake] Newbie questions: verbosity and compiler invocation

Alexander Neundorf a.neundorf-work at gmx.net
Fri Sep 10 15:11:49 EDT 2010


On Thursday 09 September 2010, David Aldrich wrote:
> Hi Michael
>
> > With CMake you can use absolute and relative paths, no problem. If you
> > use absolute paths, please use one of the pre-defined variables, such as
> > ${CMAKE_SOURCE_DIR}, ${CMAKE_BINARY_DIR}, ${CMAKE_CURRENT_SOURCE_DIR}
> > ${CMAKE_CURRENT_BINARY_DIR} ${PROJECT_SOURCE_DIR}, ${PROJECT_BINARY_DIR},
> > ${<project_name>_SOURCE_DIR} or ${<project_name>_BINARY_DIR}.
>
> Thanks. My situation is:
>
>   ------ FolderA --- CMakeLists.txt
>
>       |- FolderB --- ErrorHandler.cpp
>
> As FolderB is not beneath FolderA, I don't know how to specify
> FolderB/ErrorHandler.cpp in CMakeLists.txt using CMAKE_CURRENT_SOURCE_DIR.
> Do I need to set PROJECT_SOURCE_DIR to the parent folder of A and B?

The *_SOURCE_DIR and *_BINARY_DIR variables are read-only, never try to set 
them.

Alex


More information about the CMake mailing list