[CMake] How to find libraries with custom folder structure

Stuermer, Michael SP/HZA-ZSEP michael.stuermer at schaeffler.com
Thu Jul 2 00:10:17 EDT 2015


Did you add the directory where your find script is in to the CMAKE_MODULE_PATH?

To verify your script is called, just add a "message("executing my module")" or so on top of your script, this always works very well for me when I'm not sure.

See here for more info about the CMAKE_MODULE_PATH:

http://www.cmake.org/cmake/help/v3.3/variable/CMAKE_MODULE_PATH.html?highlight=cmake_module_path

best regards,
Michael

> -----Original Message-----
> From: CMake [mailto:cmake-bounces at cmake.org] On Behalf Of Benedikt
> Führer
> Sent: Wednesday, July 01, 2015 6:28 PM
> To: cmake at cmake.org
> Subject: [CMake] How to find libraries with custom folder structure
> 
> Hi,
> 
> my jpeg-6b is located in the following folder structure:
> 
> \libs
> --\jpeg-6b
> ----\include
> ----\lib
> ------\x64
> --------\debug
> --------\release
> 
> How can I find the needed files here? The standard FindJPEG in the
> CMake folder seems to expect a different folder structure and so
> doesn't find all components. I've tried to write a custom FindJPEG but
> it seems like it always prefers the standard FindJPEG over my custom
> one. Do I have to put it into a specific location? The current folder
> is definitely known to my CMake scripts because I have other script
> files which are correctly loaded from there.
> 
> Thanks
> --
> 
> 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


More information about the CMake mailing list