[CMake] Make LLVM_EXTERNAL_*_SOURCE_DIR consistent against older buildsites.
authorNAKAMURA Takumi <geek4civic@gmail.com>
Sat, 22 Aug 2015 04:53:52 +0000 (04:53 +0000)
committerNAKAMURA Takumi <geek4civic@gmail.com>
Sat, 22 Aug 2015 04:53:52 +0000 (04:53 +0000)
commit44c617819c702572607f2345adf358a1db53ee62
tree58c069cbb6a3495eb6cdbdaca26b168f9bdb0afd
parentc0346c0fdc7a30c85cd9c00801522ebedd83abe5
[CMake] Make LLVM_EXTERNAL_*_SOURCE_DIR consistent against older buildsites.

If corresponding in-tree subdirectory exists, just ignore LLVM_EXTERNAL* stuff.
Otherwise, set LLVM_TOOL_*_BUILD ON/OFF properly according to LLVM_EXTERNAL_*.

This makes easier to walk among old revisions *without* deleteing CMakeCache.txt.

Before r242059, LLVM_EXTERNAL_* was working like;

  if(EXISTS ${*_SOURCE_DIR}/CMakeLists.txt)
    set(*_BUILD ON CACHE)
    if(*_BUILD is ON)
      add_subdirectory(*_SOURCE_DIR)
    endif()
  endif()

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