I was working on a find module, and ran into some rather unpredicted behavior - it appears that including ENV ProgramFiles at the end the list of PATHS makes the search fail! Remove that line, put it first, or put it in quotes, and it works just fine. Does anyone have any clue why this might happen? For reference, here's the command and the value of ProgramFiles on my machine:

ProgramFiles=C:\Program Files (x86)

#Fails:
find_path(wxWidgets_ROOT_DIR
    NAMES include/wx/wx.h
    PATHS
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\wxWidgets_is1;Inno Setup: App Path]"
      ENV ProgramFiles
    )
#Works:
find_path(wxWidgets_ROOT_DIR
    NAMES include/wx/wx.h
    PATHS
      ENV ProgramFiles
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\wxWidgets_is1;Inno Setup: App Path]"
    )
#Works
find_path(wxWidgets_ROOT_DIR
    NAMES include/wx/wx.h
    PATHS
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\wxWidgets_is1;Inno Setup: App Path]"
      "ENV ProgramFiles"
    )

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to