Hi, I'm writing some FindXXX.cmake macros [1] and I'd like to master some best practices I use and I'm having troubles with picturing what should canonical use of FindPackageHandleStandardArgs look like. I'm aware I've used it incorrectly in many places.
I'm looking for confirmation if it should be something along these 1) Set lookup mode to quiet if user explicitly asked to find MYLIB quietly or if it's already found: if(MYLIB_FIND_QUIETLY OR MYLIB_FOUND) set(FIND_MYLIB_QUIET_ARG QUIET) endif() 2) Call find passing selected lookup mode find_package(MYLIB ${FIND_MYLIB_QUIET_ARG}) 3) Perform other checks, but do not call message() if MYLIB_FIND_QUIETLY is requested, otherwise lookup will not be really quiet 4) Check and report results find_package_handle_standard_args(MYLIB DEFAULT_MSG MYLIB_LIBRARY MY_INCLUDE_DIR) Have I missed anything? [1] http://github.com/mloskot/workshop/blob/master/cmake/modules/ Best regards, -- Mateusz Loskot, http://mateusz.loskot.net Charter Member of OSGeo, http://osgeo.org _______________________________________________ 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