Selaa lähdekoodia

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 vuotta sitten
vanhempi
commit
35d412f639
1 muutettua tiedostoa jossa 7 lisäystä ja 0 poistoa
  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 ""