[CMake] Precompiled headers path bug(?)

Michael Wild themiwi at gmail.com
Mon Mar 14 03:44:59 EDT 2011


On 03/14/2011 05:58 AM, Paulo Silva wrote:
> Hi,
> 
> if I do
> 
> set(PCHDIR ../include.pch)
> add_precompiled_header( ${PROJECT_NAME} ${PCHDIR}/pch.hpp )
> 
> an extra ../ is added to PCHDIR. Isn't this a bug.
> However if I do
> set(PCHDIR ../../include.pch)
> or anything else nothing gets added.
> This might be a feature  but for me it's working like a bug.
> 
> So how can I set
> set(PCHDIR ../include.pch)
> without having to use a softlink on the file system?
> 
> Thanks

I'd recommend using a full path instead (using one of the variables
CMAKE_BINARY_DIR, CMAKE_CURRENT_BINARY_DIR, PROJECT_BINARY_DIR or
<PROJECT_NAME>_BINARY_DIR)

Michael


More information about the CMake mailing list