Page MenuHomePhabricator

ctkMacroSetPaths does not check if the path is already included
Closed, WontfixPublic

Description

The ctkMacroSetPaths macro does not check if the directory that should be added is already part of the PATH variable.
In my environment the path to the QT binaries is added to the PATH environment variable for each plugin that is build.

The ctkMAcroSetPaths is called from somewhere in ctkMacroSetupPlugins.

I would propose to change ctkMAcroSetPath in the following way:

macro(ctkMacroSetPaths PATH_LIST)

foreach(p ${PATH_LIST})
  string (FIND "$ENV{PATH}" "${p}" _PATH_FOUND)

if (${_PATH_FOUND} EQUAL -1)

      if(WIN32)
        set(ENV{PATH} "${p};$ENV{PATH}")
      elseif(APPLE)
        set(ENV{DYLD_LIBRARY_PATH} "${p}:$ENV{DYLD_LIBRARY_PATH}")
      else()
        set(ENV{LD_LIBRARY_PATH} "${p}:$ENV{LD_LIBRARY_PATH}")
      endif()
   endif()
endforeach()

endmacro()

Event Timeline

kislinsk claimed this task.
kislinsk added a subscriber: kislinsk.
This task was automatically closed because it wasn't updated at least since July 2016 (over 2 years). Please re-open this task if you think that it is still relevant. This most probably means that you will resolve it.