[CMake] Checking function or symbol in namespace

Eric Noulard eric.noulard at gmail.com
Thu Jan 21 10:58:27 EST 2010


2010/1/21 Mateusz Loskot <mateusz at loskot.net>:

> The fact check_function_exists checks C function but not C++ free
> function is a bit confusing.

That's true.

> AFAIU, CMake is dedicated to build C++ source code,

However that's look false to me :-(

> so I suppose many users may expect it works
> well for both C and C++ free functions.
>
> Why it can not work, actually?

You don't want to "enable " ( see CMake command
enable_language(languageName [OPTIONAL] )
C++ for people which do "only" use plain C.

Thus the check_functions may be updated to be smart enough to try C++
free function
if ever C++ language has been enabled?
My be checking CMAKE_CXX_COMPILER_WORKS is possible ?
or may be it would be easier to explicitely tell this fact to the macro


CHECK_FUNCTION_EXISTS(std::copy HAVE_COPY LANGUAGE CXX)


-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


More information about the CMake mailing list