[CMake] Finding an unexisting library

Lucas Soltic lucas.soltic at orange.fr
Sat Jul 20 19:33:19 EDT 2013


Hello,

I'm trying to write a CMakeLists that allows linking against a library that does not exist yet but that would be created by the build process.

I'm wondering how I can get find_library() working with such a scheme, because if I give it the library name and directory, it'll obviously not find it. The non-existing library is created during a configure/make build process triggered by a add_custom_target() and I don't think I can have a reliable way of knowing the exact output name of the library (especially concerning the file extension, or is there a CMake variable for that?).

I want to use find_library() because it correctly handles the library names on the different platforms, and I prefer not to handle this manually.

Is this possible?

Regards,
Lucas


More information about the CMake mailing list