Pārlūkot izejas kodu

COMP: If defined, pass CMAKE_TRY_COMPILE_CONFIGURATION to inner build

This is required to ensure the binaries compiled using "try_compile"
and executed during the configuration step can find the Release runtime
libraries when no Debug runtime libraries are available.

By default, binaries compiler using "try_compile" are build in Debug.

This applies when building the project using "Microsoft Visual C++
compiler for Python 2.7", in that case only the Release runtime libraries
are installed as side-by-side assemblies in the C:/Windows/winsxs directory.
Jean-Christophe Fillion-Robin 8 gadi atpakaļ
vecāks
revīzija
35d412f639
1 mainītis faili ar 7 papildinājumiem un 0 dzēšanām
  1. 7 0
      SuperBuild.cmake

+ 7 - 0
SuperBuild.cmake

@@ -34,6 +34,13 @@ endif()
 #-----------------------------------------------------------------------------
 set(proj CTK)
 
+if(DEFINED CMAKE_TRY_COMPILE_CONFIGURATION)
+  list(APPEND ${proj}_EP_ARGS
+    CMAKE_CACHE_ARGS
+      -DCMAKE_TRY_COMPILE_CONFIGURATION:STRING=${CMAKE_TRY_COMPILE_CONFIGURATION}
+    )
+endif()
+
 ExternalProject_Add(${proj}
   ${${proj}_EP_ARGS}
   DOWNLOAD_COMMAND ""