[CMake] Include path perference

Marcel Loose loose at astron.nl
Wed Jan 14 05:45:50 EST 2015


On 13/01/15 18:18, leemachine wrote:
> Hello all,
>
> I am using CMAKE 2.8.7:
>
> My question is I have a project that looks for dependencies (libraries and
> headers) in both the source tree (*CMAKE_SOURCE_DIR* and
> *CMAKE_CURRENT_SOURCE_DIR* as well as the *CMAKE_INSTALL_PREFIX*. The issue
> I am having is I'm making changes to the source tree that are not compatible
> with the header files installed in the *CMAKE_INSTALL_PREFIX*.
>
> In all the cmake message prints statements I make it returns the expected
> results. CMAKE is using .cc and .h files in the source tree even though the
> .h files are also in the *CMAKE_INSTALL_PREFIX*.
>
> When compiling I get an error relating to the incompatablity I mentioned.
> GCC is using the header files in the *CMAKE_INSTALL_PREFIX* and the .cc
> files in *CMAKE_CURRENT_SOURCE_DIR*
>
> How do I tell CMAKE to NOT use the header files in the
> *CMAKE_INSTALL_PREFIX*?
>
> I understand a fresh *CMAKE_INSTALL_PREFIX* would resolve this issue, but
> I'm looking for a workaround to that as well.
>
> Thanks,
>
> -Brandon
>
>
>
> --
> View this message in context: http://cmake.3232098.n2.nabble.com/Include-path-perference-tp7589463.html
> Sent from the CMake mailing list archive at Nabble.com.
Hi Brandon,

I'm confused as to why you would want to look for dependencies in
CMAKE_INSTALL_PREFIX at all. The header files in there will (obviously)
always be (at least) one cycle behind with those in your source tree.

Cheers,
Marcel Loose.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: loose.vcf
Type: text/x-vcard
Size: 292 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150114/2526533d/attachment.vcf>


More information about the CMake mailing list