Hello,

How to write a library (myLib as .a or .so) that can be used from an executable (myExe) ?

I read the CMake doc but, obviously, I still miss some major points !... My understanding is that, I need : - to write a FindMyLib.cmake for myExe to find myLib (= finding include/library directories, and, libraries to link with)
- to use find_package from myExe to find myLib

I tried to write a mini-project (attached to this mail) to do that but it doesn't work: find_package doesn't find FindMyLib.cmake although CMAKE_MODULE_PATH has been updated.

Can somebody help me on making this project to work ? (not able to find FindMyLib.cmake, not sure to know the "good" way to write FindMyLib.cmake, others... - I would appreciate any remarks to explain me the "good" way to do thing)

Thanks,

Franck

Note: I set CMAKE_MODULE_PATH in the CMakeLists.txt of myLib (doing that from myExe sounds not relevant: if you know where the package is, no need to call find_package). Note: my understanding is that when this will work, I would be possible to build myLib as a .a or a .so, am I correct ?

Attachment: myProject.tar.gz
Description: GNU Zip compressed data

-- 

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