[LLVMdev] [CMake] Generated LLVMConfig.cmake and LLVMExports.cmake broken under Visual Studio 2015

Brad King brad.king at kitware.com
Mon Jun 22 06:01:19 PDT 2015


On 06/19/2015 06:08 PM, Dan Liew wrote:
>> However, CMake should also be taught to escape the backslashes correctly
>> when generating the export files.  Take a look at
> 
> Thanks for the explanation. Would you like me to file a bug on the
> CMake bug tracker?
> Alternatively I could try writing a patch but I don't really know what
> I'm doing.

Please bring the issue over to the cmake developers' list because such
discussion will be more relevant there.

> Did you have any thoughts on the other issue I saw which was paths
> containing "$(Configuration)". E.g.
> 
> ```
> set(LLVM_TOOLS_BINARY_DIR
> "C:/Users/alexander.APRELEV/Documents/halide/llvm-build/$(Configuration)/bin")
> ```

This is indeed for multi-configuration generators like Visual Studio.
Paths like this are meant only for reference in the build system
files.  The $(Configuration) placeholder will be replaced by the
native build system tools (like msbuild) at build time.  Generally
these paths should not be exported from a project install tree but
may be from its build tree.

Any code path that needs to get one of these directories for use
somewhere other than build system files must choose a specific
configuration to get the corresponding path.  The LOCATION_<CONFIG>
target property or the $<TARGET_FILE:...> generator expression
can be used to reference them.  The latter can be used with
commands like file(GENERATE) to write into external files.

-Brad




More information about the llvm-dev mailing list