[CMake] Newbie questions: verbosity and compiler invocation

Michael Wild themiwi at gmail.com
Thu Sep 9 07:00:18 EDT 2010


On 9. Sep, 2010, at 11:19 , David Aldrich wrote:

> Hi Michael
> 
> The makefile I am replacing uses VPATH to specify a source file that must be compiled for the target.
> 
> That source file is in a different directory to the one containing CMakeLists.txt.
> 
> How can I achieve this with CMake please?
> 
> Best regards
> 
> David

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}.

Michael

--
There is always a well-known solution to every human problem -- neat, plausible, and wrong.
H. L. Mencken

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100909/fabacf55/attachment.pgp>


More information about the CMake mailing list