consider this simple wrapper:

  function(my_find_package)
    find_package(${ARGV})
  endfunction()

If I replace all the calls to find_package in my project with calls to
my_find_package, everything breaks.  It appears variable settings in any
found <packagename>Config.cmake files are visible inside
my_find_package, but disappear from the point of view of the caller,
unless I "manually" hoist them into the parent scope using

  function(my_find_package)
    find_package(${ARGV})
    set(some_variable ${some_variable} PARENT_SCOPE)
  endfunction()

I've tried hoisting everything as in
https://github.com/ryppl/ryppl-cmake/blob/find-package-hook/Modules/Ryppl.cmake#L9,
but apparently that is too much and it clobbers some variables that it
shouldn't.

Can anyone explain to me what I'm failing to grasp, here?

Thanks,

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com


--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to