From 845b98f45b09b399f914d9df3c6a6008d7558b1b Mon Sep 17 00:00:00 2001 From: Chuck Atkins Date: Wed, 5 Oct 2016 10:19:55 -0400 Subject: [PATCH 1/2] Use find_package for JsonCpp and LibUV instead of include --- CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 309e224ff..bafca23b6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,10 @@ if(POLICY CMP0053) endif() project(CMake) +# Make sure we can find internal find_package modules only used for +# building CMake and not for shipping externally +list(INSERT CMAKE_MODULE_PATH 0 ${CMake_SOURCE_DIR}/Source/Modules) + if(CMAKE_BOOTSTRAP) # Running from bootstrap script. Set local variable and remove from cache. set(CMAKE_BOOTSTRAP 1) @@ -441,7 +445,7 @@ macro (CMAKE_BUILD_UTILITIES) # Build jsoncpp library. if(CMAKE_USE_SYSTEM_JSONCPP) if(NOT CMAKE_VERSION VERSION_LESS 3.0) - include(${CMake_SOURCE_DIR}/Source/Modules/FindJsonCpp.cmake) + find_package(JsonCpp) else() message(FATAL_ERROR "CMAKE_USE_SYSTEM_JSONCPP requires CMake >= 3.0") endif() @@ -487,7 +491,7 @@ int main(void) { return 0; } if(CMAKE_USE_LIBUV) if(CMAKE_USE_SYSTEM_LIBUV) if(NOT CMAKE_VERSION VERSION_LESS 3.0) - include(${CMake_SOURCE_DIR}/Source/Modules/FindLibUV.cmake) + find_package(LibUV) else() message(FATAL_ERROR "CMAKE_USE_SYSTEM_LIBUV requires CMake >= 3.0") endif() From 20e8dcf162b9963c9ff195525bc433df2bc2de2a Mon Sep 17 00:00:00 2001 From: Chuck Atkins Date: Wed, 5 Oct 2016 10:20:28 -0400 Subject: [PATCH 2/2] Set minimum version for LibUV to 1.0.0 Older versions of libuv did not have the uv_loop_close API. It first showed up in unstable releases ~ v0.11.20 but was not available in a stable release until v1.0 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bafca23b6..b4a577c85 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -491,7 +491,7 @@ int main(void) { return 0; } if(CMAKE_USE_LIBUV) if(CMAKE_USE_SYSTEM_LIBUV) if(NOT CMAKE_VERSION VERSION_LESS 3.0) - find_package(LibUV) + find_package(LibUV 1.0.0) else() message(FATAL_ERROR "CMAKE_USE_SYSTEM_LIBUV requires CMake >= 3.0") endif()