Eugene.Zelenko created this revision.
Eugene.Zelenko added reviewers: labath, krytarowski, zturner.
Eugene.Zelenko added a subscriber: lldb-commits.
Eugene.Zelenko set the repository for this revision to rL LLVM.

Patch also includes fix for CMake 2.8.12.2, see D18018.

Repository:
  rL LLVM

http://reviews.llvm.org/D20344

Files:
  cmake/modules/LLDBStandalone.cmake

Index: cmake/modules/LLDBStandalone.cmake
===================================================================
--- cmake/modules/LLDBStandalone.cmake
+++ cmake/modules/LLDBStandalone.cmake
@@ -4,6 +4,10 @@
   project(lldb)
   cmake_minimum_required(VERSION 2.8.12.2)
 
+  if (POLICY CMP0022)
+    cmake_policy(SET CMP0022 NEW) # automatic when 2.8.12 is required
+  endif()
+
   option(LLVM_INSTALL_TOOLCHAIN_ONLY "Only include toolchain files in the 
'install' target." OFF)
 
   # Rely on llvm-config.
@@ -96,7 +100,9 @@
 
   # Import CMake library targets from LLVM and Clang.
   
include("${LLVM_OBJ_ROOT}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm/LLVMConfig.cmake")
-  
include("${LLVM_OBJ_ROOT}/lib${LLVM_LIBDIR_SUFFIX}/cmake/clang/ClangConfig.cmake")
+  if (EXISTS 
"${LLVM_OBJ_ROOT}/lib${LLVM_LIBDIR_SUFFIX}/cmake/clang/ClangConfig.cmake")
+    
include("${LLVM_OBJ_ROOT}/lib${LLVM_LIBDIR_SUFFIX}/cmake/clang/ClangConfig.cmake")
+  endif()
 
   set(PACKAGE_VERSION "${LLVM_PACKAGE_VERSION}")
 
@@ -104,6 +110,15 @@
 
   set(CMAKE_INCLUDE_CURRENT_DIR ON)
   include_directories("${LLVM_BINARY_DIR}/include" "${LLVM_MAIN_INCLUDE_DIR}")
+  if (EXISTS "${LLVM_OBJ_ROOT}/include")
+    include_directories("${LLVM_OBJ_ROOT}/include")
+  endif()
+  if (EXISTS "${LLVM_MAIN_SRC_DIR}/tools/clang/include")
+    include_directories("${LLVM_MAIN_SRC_DIR}/tools/clang/include")
+  endif()
+  if (EXISTS "${LLVM_OBJ_ROOT}/tools/clang/include")
+    include_directories("${LLVM_OBJ_ROOT}/tools/clang/include")
+  endif()
   link_directories("${LLVM_LIBRARY_DIR}")
 
   set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)


Index: cmake/modules/LLDBStandalone.cmake
===================================================================
--- cmake/modules/LLDBStandalone.cmake
+++ cmake/modules/LLDBStandalone.cmake
@@ -4,6 +4,10 @@
   project(lldb)
   cmake_minimum_required(VERSION 2.8.12.2)
 
+  if (POLICY CMP0022)
+    cmake_policy(SET CMP0022 NEW) # automatic when 2.8.12 is required
+  endif()
+
   option(LLVM_INSTALL_TOOLCHAIN_ONLY "Only include toolchain files in the 'install' target." OFF)
 
   # Rely on llvm-config.
@@ -96,7 +100,9 @@
 
   # Import CMake library targets from LLVM and Clang.
   include("${LLVM_OBJ_ROOT}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm/LLVMConfig.cmake")
-  include("${LLVM_OBJ_ROOT}/lib${LLVM_LIBDIR_SUFFIX}/cmake/clang/ClangConfig.cmake")
+  if (EXISTS "${LLVM_OBJ_ROOT}/lib${LLVM_LIBDIR_SUFFIX}/cmake/clang/ClangConfig.cmake")
+    include("${LLVM_OBJ_ROOT}/lib${LLVM_LIBDIR_SUFFIX}/cmake/clang/ClangConfig.cmake")
+  endif()
 
   set(PACKAGE_VERSION "${LLVM_PACKAGE_VERSION}")
 
@@ -104,6 +110,15 @@
 
   set(CMAKE_INCLUDE_CURRENT_DIR ON)
   include_directories("${LLVM_BINARY_DIR}/include" "${LLVM_MAIN_INCLUDE_DIR}")
+  if (EXISTS "${LLVM_OBJ_ROOT}/include")
+    include_directories("${LLVM_OBJ_ROOT}/include")
+  endif()
+  if (EXISTS "${LLVM_MAIN_SRC_DIR}/tools/clang/include")
+    include_directories("${LLVM_MAIN_SRC_DIR}/tools/clang/include")
+  endif()
+  if (EXISTS "${LLVM_OBJ_ROOT}/tools/clang/include")
+    include_directories("${LLVM_OBJ_ROOT}/tools/clang/include")
+  endif()
   link_directories("${LLVM_LIBRARY_DIR}")
 
   set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to