diff options
author | Stephen Kelly <steveire@gmail.com> | 2011-08-08 00:08:10 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2011-08-08 00:08:10 (GMT) |
commit | def0a54e0ae20d783aecf2761a4add5f40687cd6 (patch) | |
tree | bacca14f3bcc6f4933e57e94b766201f75202c75 /Tests/Module | |
parent | 30880707c094ac5c0edd85d0857afb6fbae55326 (diff) | |
download | CMake-def0a54e0ae20d783aecf2761a4add5f40687cd6.zip CMake-def0a54e0ae20d783aecf2761a4add5f40687cd6.tar.gz CMake-def0a54e0ae20d783aecf2761a4add5f40687cd6.tar.bz2 |
Handle the case where the user changes the DEFINE_SYMBOL property.
This eases porting of KDE code.
Diffstat (limited to 'Tests/Module')
5 files changed, 37 insertions, 0 deletions
diff --git a/Tests/Module/GenerateExportHeader/CMakeLists.txt b/Tests/Module/GenerateExportHeader/CMakeLists.txt index 2d6eabe..4570280 100644 --- a/Tests/Module/GenerateExportHeader/CMakeLists.txt +++ b/Tests/Module/GenerateExportHeader/CMakeLists.txt @@ -107,6 +107,8 @@ macro_add_test_library(libstatic) add_subdirectory(lib_shared_and_static) add_subdirectory(lib_shared_and_statictest) +add_subdirectory(override_symbol) + if (CMAKE_COMPILER_IS_GNUCXX) # We deliberately call deprecated methods, and test for that elsewhere. # No need to clutter the test output with warnings. diff --git a/Tests/Module/GenerateExportHeader/override_symbol/CMakeLists.txt b/Tests/Module/GenerateExportHeader/override_symbol/CMakeLists.txt new file mode 100644 index 0000000..aeeef20 --- /dev/null +++ b/Tests/Module/GenerateExportHeader/override_symbol/CMakeLists.txt @@ -0,0 +1,11 @@ +project(override_symbol) + +add_library(somelib SHARED someclass.cpp) + +set_target_properties(somelib PROPERTIES DEFINE_SYMBOL SOMELIB_MAKEDLL) + +generate_export_header(somelib) + +add_executable(consumer main.cpp) + +target_link_libraries(consumer somelib) diff --git a/Tests/Module/GenerateExportHeader/override_symbol/main.cpp b/Tests/Module/GenerateExportHeader/override_symbol/main.cpp new file mode 100644 index 0000000..445a652 --- /dev/null +++ b/Tests/Module/GenerateExportHeader/override_symbol/main.cpp @@ -0,0 +1,9 @@ + +#include "someclass.h" + +int main(int, char**) +{ + SomeClass sc; + sc.someMethod(); + return 0; +}
\ No newline at end of file diff --git a/Tests/Module/GenerateExportHeader/override_symbol/someclass.cpp b/Tests/Module/GenerateExportHeader/override_symbol/someclass.cpp new file mode 100644 index 0000000..7326b78 --- /dev/null +++ b/Tests/Module/GenerateExportHeader/override_symbol/someclass.cpp @@ -0,0 +1,7 @@ + +#include "someclass.h" + +void SomeClass::someMethod() const +{ + +}
\ No newline at end of file diff --git a/Tests/Module/GenerateExportHeader/override_symbol/someclass.h b/Tests/Module/GenerateExportHeader/override_symbol/someclass.h new file mode 100644 index 0000000..ae5e844 --- /dev/null +++ b/Tests/Module/GenerateExportHeader/override_symbol/someclass.h @@ -0,0 +1,8 @@ + +#include "somelib_export.h" + +class SOMELIB_EXPORT SomeClass +{ +public: + void someMethod() const; +}; |