Try to fix generation of LLVMExports.cmake under Visual Studio.
authorDan Liew <dan@su-root.co.uk>
Fri, 19 Jun 2015 21:50:27 +0000 (21:50 +0000)
committerDan Liew <dan@su-root.co.uk>
Fri, 19 Jun 2015 21:50:27 +0000 (21:50 +0000)
If LLVMDebugInfoPDB links against the DIA SDK then the exports file
would contain an INTERFACE_LINK_LIBRARIES property that contained an
absolute path to ``diaguids.lib`` which used a native windows path (interpreted
as escape sequences when LLVMExports.cmake is imported causing
``find_package(LLVM)`` to fail) rather than the correct CMake style path.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240181 91177308-0d34-0410-b5e6-96231b3b80d8

lib/DebugInfo/PDB/CMakeLists.txt

index 68d3402c560343febd3b05322a19ef902a9a1a01..1645a95aac36dd1d063a4a3b20dfe0e54b116de5 100644 (file)
@@ -9,7 +9,7 @@ if(HAVE_DIA_SDK)
   if (CMAKE_SIZEOF_VOID_P EQUAL 8)
     set(LIBPDB_LINK_FOLDERS "${LIBPDB_LINK_FOLDERS}\\amd64")
   endif()
-  set(LIBPDB_ADDITIONAL_LIBRARIES "${LIBPDB_LINK_FOLDERS}\\diaguids.lib")
+  file(TO_CMAKE_PATH "${LIBPDB_LINK_FOLDERS}\\diaguids.lib" LIBPDB_ADDITIONAL_LIBRARIES)
 
   add_pdb_impl_folder(DIA
     DIA/DIADataStream.cpp