summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Grasman <kim.grasman@gmail.com>2018-07-07 10:29:18 +0200
committerKim Gräsman <kim.grasman@gmail.com>2018-07-08 11:30:28 +0200
commit23f592039aff4cbc2bea4c79168b469cff6a579d (patch)
tree753cbdbe06cc6203368de82b174789a5cc5dfee6
parent4a0cb6a5262243aad338b15e75dc713a1625b245 (diff)
Set CMake policy CMP0048 unconditionally
Now that we require CMake 3.4.3, we no longer need to check if CMP0048 is available before setting it to NEW. Also move the policy setting and project declaration so we only create a project for out-of-tree builds. In-tree builds will become part of the LLVM project, which already has this policy set.
-rw-r--r--CMakeLists.txt10
1 files changed, 3 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ade19e8..85850de 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,15 +1,11 @@
cmake_minimum_required(VERSION 3.4.3)
-if (POLICY CMP0048)
- # Silence CMP0048 warning about missing project VERSION.
- cmake_policy(SET CMP0048 NEW)
-endif()
-
-project(include-what-you-use)
-
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
message(STATUS "IWYU: out-of-tree configuration")
+ cmake_policy(SET CMP0048 NEW)
+ project(include-what-you-use)
+
find_package(LLVM CONFIG REQUIRED)
find_package(Clang CONFIG REQUIRED)