Re: [CMake] How to include the generated header file?

2012-03-01 Thread Tan, Tom (Shanghai)
Thanks. Speaking of bugs, there's one more in the generated header file:
#ifdef machine_side-msvc-32bit_EXPORTS
/* We are building this library */
#  define HostlinkPP_EXPORT __declspec(dllexport)
#else
/* We are using this library */
#  define HostlinkPP_EXPORT __declspec(dllimport)
#endif

The inserted comments breaks the line and invokes a warning in VC++. A
better way is like this :
 
#ifdef machine_side-msvc-32bit_EXPORTS 
#  define HostlinkPP_EXPORT __declspec(dllexport)/* We are
building this library */
#else
#  define HostlinkPP_EXPORT __declspec(dllimport)/* We are
using this library */
#endif

-Original Message-
From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf
Of Michael Wild
Sent: Thursday, March 01, 2012 3:33 PM
To: cmake@cmake.org
Subject: Re: [CMake] How to include the generated header file?

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
--

Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] How to include the generated header file?

2012-02-29 Thread Tan, Tom (Shanghai)
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.
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] How to include the generated header file?

2012-02-29 Thread Michael Wild
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
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake