openscenegraph - When building with cmake, prevent a third party library from using its own implementation of a find module, if CMake already comes with one -


rephrased question

how can control order in cmake uses findxxx.cmake modules?

my exact issue

for example, openscenegraph comes own findzlib not findzlib cmake comes with.the findzlib module comes osg not able find zlib installation. have zlib installed in cmake_install_prefix path.

during build, cmake warns me this.

osg sets module path own dir, , findpng (from cmake) improperly uses findzlib openscenegraph comes with. , so, fails find zlib.

how can prevent happening? i'm building openscenegraph through call externalproject_add. i've read setting cmake policy (cmp0017 precise) might fix it? not know how through externalproject_add.

more details

this related warning when cmake (called generated visual studio solution) tries configure , build osg: 4> cmake warning (dev) @ c:/program files (x86)/cmake 2.8/share/cmake-2.8/modules/findpng.cmake:34 (find_package):

4>    file c:/program files (x86)/cmake 2.8/share/cmake-2.8/modules/findpng.cmake 4>    includes e:/project/third-party/openscenegraph/cmakemodules/findzlib.cmake 4>    (found via cmake_module_path) shadows c:/program files (x86)/cmake 4>    2.8/share/cmake-2.8/modules/findzlib.cmake.  may cause errors later on 4>    . 4>   4>    policy cmp0017 not set: prefer files cmake module directory 4>    when including there.  run "cmake --help-policy cmp0017" policy 4>    details.  use cmake_policy command set policy , suppress 4>    warning. 

you can set cmake policy mentioned. don't know how through externalproject_add, fix problem. cmakelists.txt file comes source distribution has section cmake policies set. can add line sets cmp0017 policy new , gets rid of warning.

if (command cmake_policy)     ...      cmake_policy (set cmp0017 new)      ... endif () 

Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -