From 733a35985d7ffbee9ad9ecdf0e79262be6292269 Mon Sep 17 00:00:00 2001 From: Kris Thielemans Date: Sun, 2 Jul 2017 17:16:23 +0100 Subject: [PATCH] Pass essential CMake vars to dependent projects Use mark_as_superbuild to pass generator, platform info etc. This will partial solve Issue #14 (but only for dependencies that build via CMake). --- SuperBuild.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/SuperBuild.cmake b/SuperBuild.cmake index d70c92a..1088888 100644 --- a/SuperBuild.cmake +++ b/SuperBuild.cmake @@ -44,6 +44,14 @@ set(EXTERNAL_PROJECT_BUILD_TYPE "Release" CACHE STRING "Default build type for s set_property(CACHE EXTERNAL_PROJECT_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") +# Make sure that some CMake variables are passed to all dependencies +mark_as_superbuild( + PROJECTS ALL_PROJECTS + VARS CMAKE_GENERATOR:STRING CMAKE_GENERATOR_PLATFORM:STRING CMAKE_GENERATOR_TOOLSET:STRING + CMAKE_C_COMPILER:FILEPATH CMAKE_CXX_COMPILER:FILEPATH + CMAKE_INSTALL_PREFIX:PATH +) + set(MATLAB_ROOT CACHE PATH "Path to Matlab root directory")