summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-12-15 10:14:23 (GMT)
committerStephen Kelly <steveire@gmail.com>2013-12-15 10:22:19 (GMT)
commit2410b912fe371fb41ac745bece20a447296ff51b (patch)
tree0bf846936abc4bc3beb4a8090520f430507cbf97 /Tests
parent4017db13aa54527e979f80f059b9aab1b344734e (diff)
downloadCMake-2410b912fe371fb41ac745bece20a447296ff51b.zip
CMake-2410b912fe371fb41ac745bece20a447296ff51b.tar.gz
CMake-2410b912fe371fb41ac745bece20a447296ff51b.tar.bz2
Merge some GenerateExportHeader subtests.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/Module/GenerateExportHeader/CMakeLists.txt5
-rw-r--r--Tests/Module/GenerateExportHeader/lib_shared_and_static/CMakeLists.txt16
-rw-r--r--Tests/Module/GenerateExportHeader/lib_shared_and_static/libshared_and_static.h26
-rw-r--r--Tests/Module/GenerateExportHeader/override_symbol/CMakeLists.txt11
-rw-r--r--Tests/Module/GenerateExportHeader/override_symbol/main.cpp9
-rw-r--r--Tests/Module/GenerateExportHeader/override_symbol/someclass.cpp7
-rw-r--r--Tests/Module/GenerateExportHeader/override_symbol/someclass.h8
-rw-r--r--Tests/Module/GenerateExportHeader/prefix/CMakeLists.txt15
-rw-r--r--Tests/Module/GenerateExportHeader/prefix/main.cpp8
-rw-r--r--Tests/Module/GenerateExportHeader/prefix/useprefixclass.cpp7
-rw-r--r--Tests/Module/GenerateExportHeader/prefix/useprefixclass.h13
-rw-r--r--Tests/Module/GenerateExportHeader/visibility_preset/CMakeLists.txt17
-rw-r--r--Tests/Module/GenerateExportHeader/visibility_preset/main.cpp9
-rw-r--r--Tests/Module/GenerateExportHeader/visibility_preset/visibility_preset.cpp7
-rw-r--r--Tests/Module/GenerateExportHeader/visibility_preset/visibility_preset.h13
15 files changed, 28 insertions, 143 deletions
diff --git a/Tests/Module/GenerateExportHeader/CMakeLists.txt b/Tests/Module/GenerateExportHeader/CMakeLists.txt
index 9b0f0c0..bf867a9 100644
--- a/Tests/Module/GenerateExportHeader/CMakeLists.txt
+++ b/Tests/Module/GenerateExportHeader/CMakeLists.txt
@@ -57,7 +57,7 @@ endif()
include(GenerateExportHeader)
-add_subdirectory(visibility_preset)
+add_subdirectory(lib_shared_and_static)
add_compiler_export_flags()
@@ -79,11 +79,8 @@ endmacro()
macro_add_test_library(libshared)
macro_add_test_library(libstatic)
-add_subdirectory(lib_shared_and_static)
-add_subdirectory(override_symbol)
add_subdirectory(nodeprecated)
-add_subdirectory(prefix)
if(NOT BORLAND)
add_subdirectory(c_identifier)
endif()
diff --git a/Tests/Module/GenerateExportHeader/lib_shared_and_static/CMakeLists.txt b/Tests/Module/GenerateExportHeader/lib_shared_and_static/CMakeLists.txt
index be0387f..c1be125 100644
--- a/Tests/Module/GenerateExportHeader/lib_shared_and_static/CMakeLists.txt
+++ b/Tests/Module/GenerateExportHeader/lib_shared_and_static/CMakeLists.txt
@@ -5,7 +5,15 @@ project(lib_shared_and_static)
include(GenerateExportHeader)
-add_compiler_export_flags()
+set(CMAKE_CXX_VISIBILITY_PRESET hidden)
+set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
+
+if (CMAKE_CXX_FLAGS MATCHES "-fvisibility=hidden")
+ message(SEND_ERROR "Do not use add_compiler_export_flags before adding this directory")
+endif()
+if (CMAKE_CXX_FLAGS MATCHES "-fvisibility-inlines-hidden")
+ message(SEND_ERROR "Do not use add_compiler_export_flags before adding this directory")
+endif()
set(CMAKE_INCLUDE_CURRENT_DIR ON)
@@ -14,9 +22,13 @@ set(lib_SRCS
)
add_library(shared_variant SHARED ${lib_SRCS})
+set_target_properties(shared_variant PROPERTIES DEFINE_SYMBOL SHARED_VARIANT_MAKEDLL)
add_library(static_variant ${lib_SRCS})
-generate_export_header(shared_variant BASE_NAME libshared_and_static)
+generate_export_header(shared_variant
+ BASE_NAME libshared_and_static
+ PREFIX_NAME MYPREFIX_
+)
set_target_properties(static_variant PROPERTIES COMPILE_FLAGS -DLIBSHARED_AND_STATIC_STATIC_DEFINE)
diff --git a/Tests/Module/GenerateExportHeader/lib_shared_and_static/libshared_and_static.h b/Tests/Module/GenerateExportHeader/lib_shared_and_static/libshared_and_static.h
index 049bfe9..5ad77f4 100644
--- a/Tests/Module/GenerateExportHeader/lib_shared_and_static/libshared_and_static.h
+++ b/Tests/Module/GenerateExportHeader/lib_shared_and_static/libshared_and_static.h
@@ -4,51 +4,51 @@
#include "libshared_and_static_export.h"
-class LIBSHARED_AND_STATIC_EXPORT LibsharedAndStatic {
+class MYPREFIX_LIBSHARED_AND_STATIC_EXPORT LibsharedAndStatic {
public:
int libshared_and_static() const;
int libshared_and_static_exported() const;
- int LIBSHARED_AND_STATIC_DEPRECATED libshared_and_static_deprecated() const;
+ int MYPREFIX_LIBSHARED_AND_STATIC_DEPRECATED libshared_and_static_deprecated() const;
int libshared_and_static_not_exported() const;
- int LIBSHARED_AND_STATIC_NO_EXPORT libshared_and_static_excluded() const;
+ int MYPREFIX_LIBSHARED_AND_STATIC_NO_EXPORT libshared_and_static_excluded() const;
};
class LibsharedAndStaticNotExported {
public:
int libshared_and_static() const;
- int LIBSHARED_AND_STATIC_EXPORT libshared_and_static_exported() const;
+ int MYPREFIX_LIBSHARED_AND_STATIC_EXPORT libshared_and_static_exported() const;
- int LIBSHARED_AND_STATIC_DEPRECATED libshared_and_static_deprecated() const;
+ int MYPREFIX_LIBSHARED_AND_STATIC_DEPRECATED libshared_and_static_deprecated() const;
int libshared_and_static_not_exported() const;
- int LIBSHARED_AND_STATIC_NO_EXPORT libshared_and_static_excluded() const;
+ int MYPREFIX_LIBSHARED_AND_STATIC_NO_EXPORT libshared_and_static_excluded() const;
};
-class LIBSHARED_AND_STATIC_NO_EXPORT LibsharedAndStaticExcluded {
+class MYPREFIX_LIBSHARED_AND_STATIC_NO_EXPORT LibsharedAndStaticExcluded {
public:
int libshared_and_static() const;
- int LIBSHARED_AND_STATIC_EXPORT libshared_and_static_exported() const;
+ int MYPREFIX_LIBSHARED_AND_STATIC_EXPORT libshared_and_static_exported() const;
- int LIBSHARED_AND_STATIC_DEPRECATED libshared_and_static_deprecated() const;
+ int MYPREFIX_LIBSHARED_AND_STATIC_DEPRECATED libshared_and_static_deprecated() const;
int libshared_and_static_not_exported() const;
- int LIBSHARED_AND_STATIC_NO_EXPORT libshared_and_static_excluded() const;
+ int MYPREFIX_LIBSHARED_AND_STATIC_NO_EXPORT libshared_and_static_excluded() const;
};
-LIBSHARED_AND_STATIC_EXPORT int libshared_and_static_exported();
+MYPREFIX_LIBSHARED_AND_STATIC_EXPORT int libshared_and_static_exported();
-LIBSHARED_AND_STATIC_DEPRECATED_EXPORT int libshared_and_static_deprecated();
+MYPREFIX_LIBSHARED_AND_STATIC_DEPRECATED_EXPORT int libshared_and_static_deprecated();
int libshared_and_static_not_exported();
-int LIBSHARED_AND_STATIC_NO_EXPORT libshared_and_static_excluded();
+int MYPREFIX_LIBSHARED_AND_STATIC_NO_EXPORT libshared_and_static_excluded();
#endif
diff --git a/Tests/Module/GenerateExportHeader/override_symbol/CMakeLists.txt b/Tests/Module/GenerateExportHeader/override_symbol/CMakeLists.txt
deleted file mode 100644
index aeeef20..0000000
--- a/Tests/Module/GenerateExportHeader/override_symbol/CMakeLists.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-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
deleted file mode 100644
index eec46d3..0000000
--- a/Tests/Module/GenerateExportHeader/override_symbol/main.cpp
+++ /dev/null
@@ -1,9 +0,0 @@
-
-#include "someclass.h"
-
-int main(int, char**)
-{
- SomeClass sc;
- sc.someMethod();
- return 0;
-}
diff --git a/Tests/Module/GenerateExportHeader/override_symbol/someclass.cpp b/Tests/Module/GenerateExportHeader/override_symbol/someclass.cpp
deleted file mode 100644
index 427ec29..0000000
--- a/Tests/Module/GenerateExportHeader/override_symbol/someclass.cpp
+++ /dev/null
@@ -1,7 +0,0 @@
-
-#include "someclass.h"
-
-void SomeClass::someMethod() const
-{
-
-}
diff --git a/Tests/Module/GenerateExportHeader/override_symbol/someclass.h b/Tests/Module/GenerateExportHeader/override_symbol/someclass.h
deleted file mode 100644
index ae5e844..0000000
--- a/Tests/Module/GenerateExportHeader/override_symbol/someclass.h
+++ /dev/null
@@ -1,8 +0,0 @@
-
-#include "somelib_export.h"
-
-class SOMELIB_EXPORT SomeClass
-{
-public:
- void someMethod() const;
-};
diff --git a/Tests/Module/GenerateExportHeader/prefix/CMakeLists.txt b/Tests/Module/GenerateExportHeader/prefix/CMakeLists.txt
deleted file mode 100644
index bd64df2..0000000
--- a/Tests/Module/GenerateExportHeader/prefix/CMakeLists.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-project(use_prefix)
-
-set(use_prefix_lib_SRCS
- useprefixclass.cpp
-)
-
-add_library(use_prefix_lib SHARED useprefixclass.cpp)
-
-generate_export_header(use_prefix_lib
- PREFIX_NAME MYPREFIX_
-)
-
-add_executable(use_prefix main.cpp)
-
-target_link_libraries(use_prefix use_prefix_lib) \ No newline at end of file
diff --git a/Tests/Module/GenerateExportHeader/prefix/main.cpp b/Tests/Module/GenerateExportHeader/prefix/main.cpp
deleted file mode 100644
index 507f6fd..0000000
--- a/Tests/Module/GenerateExportHeader/prefix/main.cpp
+++ /dev/null
@@ -1,8 +0,0 @@
-
-#include "useprefixclass.h"
-
-int main(int argc, char **argv)
-{
- UsePrefixClass upc;
- return upc.someMethod();
-}
diff --git a/Tests/Module/GenerateExportHeader/prefix/useprefixclass.cpp b/Tests/Module/GenerateExportHeader/prefix/useprefixclass.cpp
deleted file mode 100644
index 1fd2cb2..0000000
--- a/Tests/Module/GenerateExportHeader/prefix/useprefixclass.cpp
+++ /dev/null
@@ -1,7 +0,0 @@
-
-#include "useprefixclass.h"
-
-int UsePrefixClass::someMethod() const
-{
- return 0;
-}
diff --git a/Tests/Module/GenerateExportHeader/prefix/useprefixclass.h b/Tests/Module/GenerateExportHeader/prefix/useprefixclass.h
deleted file mode 100644
index f5e31b5..0000000
--- a/Tests/Module/GenerateExportHeader/prefix/useprefixclass.h
+++ /dev/null
@@ -1,13 +0,0 @@
-
-#ifndef USEPREFIXCLASS_H
-#define USEPREFIXCLASS_H
-
-#include "use_prefix_lib_export.h"
-
-class MYPREFIX_USE_PREFIX_LIB_EXPORT UsePrefixClass
-{
-public:
- int someMethod() const;
-};
-
-#endif
diff --git a/Tests/Module/GenerateExportHeader/visibility_preset/CMakeLists.txt b/Tests/Module/GenerateExportHeader/visibility_preset/CMakeLists.txt
deleted file mode 100644
index 2571d22..0000000
--- a/Tests/Module/GenerateExportHeader/visibility_preset/CMakeLists.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-
-set(CMAKE_CXX_VISIBILITY_PRESET hidden)
-set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
-
-if (CMAKE_CXX_FLAGS MATCHES "-fvisibility=hidden")
- message(SEND_ERROR "Do not use add_compiler_export_flags before adding this directory")
-endif()
-if (CMAKE_CXX_FLAGS MATCHES "-fvisibility-inlines-hidden")
- message(SEND_ERROR "Do not use add_compiler_export_flags before adding this directory")
-endif()
-
-add_library(visibility_preset SHARED visibility_preset.cpp)
-generate_export_header(visibility_preset)
-
-add_executable(visibility_preset_exe main.cpp)
-
-target_link_libraries(visibility_preset_exe visibility_preset)
diff --git a/Tests/Module/GenerateExportHeader/visibility_preset/main.cpp b/Tests/Module/GenerateExportHeader/visibility_preset/main.cpp
deleted file mode 100644
index 89c3977..0000000
--- a/Tests/Module/GenerateExportHeader/visibility_preset/main.cpp
+++ /dev/null
@@ -1,9 +0,0 @@
-
-#include "visibility_preset.h"
-
-int main()
-{
- VisibilityPreset vp;
- vp.someMethod();
- return 0;
-}
diff --git a/Tests/Module/GenerateExportHeader/visibility_preset/visibility_preset.cpp b/Tests/Module/GenerateExportHeader/visibility_preset/visibility_preset.cpp
deleted file mode 100644
index c97dec6..0000000
--- a/Tests/Module/GenerateExportHeader/visibility_preset/visibility_preset.cpp
+++ /dev/null
@@ -1,7 +0,0 @@
-
-#include "visibility_preset.h"
-
-void VisibilityPreset::someMethod()
-{
-
-}
diff --git a/Tests/Module/GenerateExportHeader/visibility_preset/visibility_preset.h b/Tests/Module/GenerateExportHeader/visibility_preset/visibility_preset.h
deleted file mode 100644
index 8becbe1..0000000
--- a/Tests/Module/GenerateExportHeader/visibility_preset/visibility_preset.h
+++ /dev/null
@@ -1,13 +0,0 @@
-
-#ifndef VISIBILITY_PRESET_H
-#define VISIBILITY_PRESET_H
-
-#include "visibility_preset_export.h"
-
-class VISIBILITY_PRESET_EXPORT VisibilityPreset
-{
-public:
- void someMethod();
-};
-
-#endif