Pārlūkot izejas kodu

Exclude variable name from *_{INCLUDE,LIBRARY}_DIRS variable

Before this commit, the list of include or library directories was
containing the name of the variable to be expand.

For example, the value for "VTK_LIBRARIES" was

  [VTK_LIBRARIES] Appended dirs: VTK_LIBRARIES;/home/jchris/Projects/Slicer-AHM-Superbuild-Release/VTK-build/bin

whereas the following was expected:

  [VTK_LIBRARIES] Appended dirs: /home/jchris/Projects/Slicer-AHM-Superbuild-Release/VTK-build/bin
Jean-Christophe Fillion-Robin 11 gadi atpakaļ
vecāks
revīzija
4bac099913
1 mainītis faili ar 14 papildinājumiem un 8 dzēšanām
  1. 14 8
      CMakeLists.txt

+ 14 - 8
CMakeLists.txt

@@ -878,28 +878,34 @@ endforeach()
 foreach(_external_target ${EXTERNAL_TARGETS})
   if(${_external_target}_INCLUDE_DIRS)
     #message("[${_external_target}] Resolving include variables: ${${_external_target}_INCLUDE_DIRS}")
+    set(_updated_include_dirs)
     foreach(_include_variable ${${_external_target}_INCLUDE_DIRS})
-      #message("[${_external_target}] Appending ${${_include_variable}}")
       if(${_include_variable})
-        list(APPEND ${_external_target}_INCLUDE_DIRS ${${_include_variable}})
+        #message("[${_external_target}] Substituting [${_include_variable}] with [${${_include_variable}}]")
+        list(APPEND _updated_include_dirs ${${_include_variable}})
       else()
-        list(APPEND ${_external_target}_INCLUDE_DIRS ${_include_variable})
+        #message("[${_external_target}] Appending ${${_include_variable}}")
+        list(APPEND _updated_include_dirs ${_include_variable})
       endif()
-      #message("[${_external_target}] New dirs: ${${_external_target}_INCLUDE_DIRS}")
+      #message("[${_external_target}] New dirs: ${_updated_include_dirs}")
     endforeach()
+    set(${_external_target}_INCLUDE_DIRS ${_updated_include_dirs})
     #message("[${_external_target}] Appended dirs: ${${_external_target}_INCLUDE_DIRS}")
   endif()
   if(${_external_target}_LIBRARY_DIRS)
     #message("[${_external_target}] Resolving library variables: ${${_external_target}_LIBRARY_DIRS}")
+    set(_updated_library_dirs)
     foreach(_library_variable ${${_external_target}_LIBRARY_DIRS})
-      #message("[${_external_target}] Appending ${${_library_variable}}")
       if(${_library_variable})
-        list(APPEND ${_external_target}_LIBRARY_DIRS ${${_library_variable}})
+        #message("[${_external_target}] Substituting [${_library_variable}] with [${${_library_variable}}]")
+        list(APPEND _updated_library_dirs ${${_library_variable}})
       else()
-        list(APPEND ${_external_target}_LIBRARY_DIRS ${_library_variable})
+        #message("[${_external_target}] Appending ${_library_variable}")
+        list(APPEND _updated_library_dirs ${_library_variable})
       endif()
-      #message("[${_external_target}] New dirs: ${${_external_target}_LIBRARY_DIRS}")
+      #message("[${_external_target}] New dirs: ${_updated_library_dirs}")
     endforeach()
+    set(${_external_target}_LIBRARY_DIRS ${_updated_library_dirs})
     #message("[${_external_target}] Appended dirs: ${${_external_target}_LIBRARY_DIRS}")
   endif()
 endforeach()