Hi All,<div><br></div><div>The proposed patch makes possible to use LLVM's CMake build infrastructure (most importantly add_llvm_library and add_llvm_executable macros) from the project that has llvm in a subdirectory.</div>
<div><br></div><div><div>For example:</div><div><br></div><div>demo/</div><div> llvm/</div><div> demo.cpp</div><div> CMakeLists.txt</div><div><br></div><div>where CMakeLists.txt is as follows:</div><div><br></div>
<div># ----------------------------- Start of CMakeLists.txt ----------------------------------------</div><div><br></div><div><div><div>project(DEMO)</div><div>cmake_minimum_required(VERSION 2.6.1)</div><div><br></div><div>
add_subdirectory("${DEMO_SOURCE_DIR}/llvm")</div><div><br></div></div><div>include_directories(</div><div> "${LLVM_SOURCE_DIR}/include"</div><div> "${LLVM_BINARY_DIR}/include"</div><div>)</div>
<div>set(LLVM_LINK_COMPONENTS core jit interpreter native)</div><div><br></div><div>add_llvm_executable(DEMO demo.cpp)</div><div><br></div><div># ----------------------------- End of CMakeLists.txt ----------------------------------------</div>
<div><br></div><div>As you can see with this patch creating a project using CMake outside of the LLVM directory structure is as simple as inside.</div><div><br></div><div>To this end I made the following CMake variables stored in cache:</div>
</div></div><div><br></div><div>LLVM_COMMON_DEPENDS</div><div>LLVM_NATIVE_ARCH</div><div>llvm_libs</div><div>MSVC_LIB_DEPS_LLVM*</div><div><br></div><div>Best regards,</div><div>Victor</div><div><br></div><div><br></div>