On Mon, May 23, 2016 at 11:30 PM, Eric Eide <ee...@cs.utah.edu> wrote:
> Hi!  I am a CMake newbie, and I have a question about examining the set of
> available Perl modules on a system.
>
> In CMake (version 2.8.12+), how can I test for the presence of a particular
> Perl module, e.g., "Sys::CPU"?

I think use execute_process to execute a command like

   perl -MSys::CPU -e ""

So, something like

execute_process(COMMAND ${PERL_EXECUTABLE} -MSys::CPU -e ""
     ERROR_QUIET RESULT_VARIABLE status)

if ${status} is zero then the module exists, otherwise it doesn't. You
can wrap it in a function,
obviously.
-- 

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