From aa336fc4f87fd98a4afb560e7a0f972102c6ace5 Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Thu, 22 Mar 2018 10:03:43 -0400 Subject: [PATCH] Move vtk_module_third_party() call back to the top The rest of the file depends on VTK_USE_SYSTEM_JSONCPP, which is set by the vtk_module_third_party() call. When the call happens at the end, and VTK_USE_SYSTEM_JSONCPP is set to true, the rest of the file doesn't take this into account because the cache value hasn't been created yet. (You only see this on the first run of CMake; if you run it again the problem solves itself because the value is already in the cache.) This moves the call back to the beginning so that the rest of the file uses the correct value. --- ThirdParty/jsoncpp/CMakeLists.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ThirdParty/jsoncpp/CMakeLists.txt b/ThirdParty/jsoncpp/CMakeLists.txt index 7c3e51705b..6168d911c0 100644 --- a/VTK/ThirdParty/jsoncpp/CMakeLists.txt +++ b/VTK/ThirdParty/jsoncpp/CMakeLists.txt @@ -1,4 +1,8 @@ include(CMakeDependentOption) + +vtk_module_third_party(JsonCpp + VERSION 0.7.0) + cmake_dependent_option(VTK_SYSTEM_JSONCPP_SHARED "Whether the system jsoncpp is shared or not" ON VTK_USE_SYSTEM_JSONCPP "${BUILD_SHARED_LIBS}") if (VTK_USE_SYSTEM_JSONCPP) @@ -18,6 +22,3 @@ if (NOT VTK_INSTALL_NO_DEVELOPMENT) DESTINATION "${VTK_INSTALL_INCLUDE_DIR}" COMPONENT Development) endif () - -vtk_module_third_party(JsonCpp - VERSION 0.7.0) -- 2.14.3