Browse Source

Add option to test CMake itself against its hosting CMake

Brad King 6 years ago
parent
commit
4b8a864d52
1 changed files with 4 additions and 0 deletions
  1. 4 0
      CMakeLists.txt

+ 4 - 0
CMakeLists.txt

@@ -18,6 +18,10 @@ if(CMAKE_BOOTSTRAP)
   unset(CMAKE_BOOTSTRAP CACHE)
 endif()
 
+if(CMake_TEST_HOST_CMAKE)
+  get_filename_component(CMake_TEST_EXTERNAL_CMAKE "${CMAKE_COMMAND}" DIRECTORY)
+endif()
+
 if(NOT CMake_TEST_EXTERNAL_CMAKE)
   if(CMAKE_SYSTEM_NAME STREQUAL "HP-UX")
     message(FATAL_ERROR