[CMake] 'uncaching' a path found by the find_XXX functions

J.S. van Bethlehem j.s.van.bethlehem at astro.rug.nl
Thu Apr 14 06:46:58 EDT 2011


Dear users,

As a new user CMake I've come across some things I don't fully 
understand yet. Here is such a thing:
When a library consists of multiple separate lib-files, from the 
archives it seems that the way to go when writing a 'Find'-module for 
such a library, say library LIB, is first find each lib-file separately:
 find_library(${LIB1_PATH} ${LIB1} ${SEARCH_PATH})
 find_library(${LIB2_PATH} ${LIB2} ${SEARCH_PATH})
etc.
Then, when each of these were successfully found, do:
 set(LIB_LIBRARIES ${LIB1_PATH} ${LIB2_PATH} [other library files] )

But now I want LIB_LIBRARIES do become cached - that can be done with 
the CACHE option. But I also want the ${LIBX_PATH} variables NOT to be 
cached. How do I accomplish that? And is this indeed the right way to go 
with CMake?

Yours sincerely,
Jakob van Bethlehem


More information about the CMake mailing list