[CMake] find_package_handle_standard_args for target-only modules

Mateusz Loskot mateusz at loskot.net
Fri May 11 12:27:47 EDT 2018


Hi,

When writing a new FindX.cmake module following the spirit of Modern CMake,
that is without setting any X_LIBRARY and X_INCLUDE_DIR variables,
what is the strategy regarding use of find_package_handle_standard_args?

Shall I not use find_package_handle_standard_args at all?
If yes, shall I set X_FOUND and issue any related messages myself?

Shall I use it:
   find_package_handle_standard_args(X DEFAULT_MSG X_LIBRARY X_INCLUDE_DIR)
and follow with
   unset(X_LIBRARY)
    unset(X_INCLUDE_DIR)
annoying users of FindX.cmake

Shall I simply forget the Modern CMake and set the legacy style variables?

Or something else?

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net


More information about the CMake mailing list