[CMake] How to include the generated header file?

Michael Wild themiwi at gmail.com
Thu Mar 1 02:33:15 EST 2012


On 03/01/2012 07:21 AM, Tan, Tom (Shanghai) wrote:
> According to the doc,  generate_export_header(somelib) generates a file
> in the ${CMAKE_CURRENT_BUILD_DIR} called somelib_export.h.
> What's the recommended way to include this   "somelib_export.h".
> #include "somelib_export.h" does not work. And
> ${CMAKE_CURRENT_BUILD_DIR} is empty too.  I am using v2.8.7. The header
> file does get generated, only the doc is not very helpful on how to
> include it.

include_directories(${CMAKE_CURRENT_BINARY_DIR})

That's a bug in the documentation, the variable CMAKE_CURRENT_BUILD_DIR
does not exist (notice the difference is between BUILD and BINARY)...

Michael


More information about the CMake mailing list