https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230070
Adriaan de Groot <adr...@freebsd.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |adr...@freebsd.org --- Comment #3 from Adriaan de Groot <adr...@freebsd.org> --- This is a misunderstanding what CheckLibraryExists does. It takes **one** LOCATION and checks for the given function in that location. You can pass it a list, but in CMake's internals -- see CheckLibraryExists.cmake -- it then gets passed on to try_compile as a string; this loses all the list-ness of LOCATION. You can see this for yourself by running cmake --debug-trycompile and then grepping through the resulting CMakeFiles/ directory. The correct way (well, **one** working way) to look for XOpenIM is to *first* find the library, then check for the function: ``` find_library(_x11forreal X11 HINTS ${X11_LIB_SEARCH_PATH}) if (_x11forreal) check_library_exists(${_x11forreal} XOpenIM "" XIM2_FOUND) if(${XIM2_FOUND}) MESSAGE("YES XOpenIM is found (2)") else() MESSAGE("NO XOpenIM is NOT found (2)") endif() endif() ``` This just leaves out the LOCATION and uses the direct path to the library. Note, also, that X11_LIB_SEARCH_PATH is an internal variable, not documented, that contains the list of places FindX11.cmake is going to look: it's not a computed value. So another way to do this is to use the X11 library variable that **is** documented: ``` check_library_exists(${X11_X11_LIB} XOpenIM "" XIM_FOUND) ``` I'll grant you that the documentation of check_library_exists could be a lot better. -- You are receiving this mail because: You are the assignee for the bug.