summaryrefslogtreecommitdiff
path: root/Tests/Complex/Library
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2003-01-15 17:31:22 -0500
committerBill Hoffman <bill.hoffman@kitware.com>2003-01-15 17:31:22 -0500
commitc6d2312619f008a691d9a313988b15c02e4f94cd (patch)
tree3dfde773b647d2739f97f0217dd1a40225f1c0ff /Tests/Complex/Library
parent17d8775e82aafe373f25b6d6ce9a568ab78816f2 (diff)
downloadcmake-c6d2312619f008a691d9a313988b15c02e4f94cd.tar.gz
ENH: add testing for modules and one two config modes for cmaketest
Diffstat (limited to 'Tests/Complex/Library')
-rw-r--r--Tests/Complex/Library/CMakeLists.txt3
-rw-r--r--Tests/Complex/Library/moduleFile.c6
-rw-r--r--Tests/Complex/Library/moduleFile.h12
3 files changed, 20 insertions, 1 deletions
diff --git a/Tests/Complex/Library/CMakeLists.txt b/Tests/Complex/Library/CMakeLists.txt
index 9fccfc5211..0df970b59e 100644
--- a/Tests/Complex/Library/CMakeLists.txt
+++ b/Tests/Complex/Library/CMakeLists.txt
@@ -38,6 +38,7 @@ ENDIF(WIN32)
#
SOURCE_FILES(SharedLibrarySources sharedFile)
ADD_LIBRARY(CMakeTestLibraryShared SHARED ${SharedLibrarySources})
+ADD_LIBRARY(CMakeTestModule MODULE moduleFile.c)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS")
ADD_LIBRARY(CMakeTestCLibraryShared SHARED testConly.c)
SET_TARGET_PROPERTIES(CMakeTestCLibraryShared PROPERTIES FOO BAR)
@@ -55,7 +56,7 @@ ENDIF(${FOO_BAR_VAR} MATCHES "BAR")
# The 'complex' executable will then test if this file exists and remove it.
#
ADD_DEPENDENCIES(CMakeTestLibraryShared create_file)
-
+MESSAGE("complex bin dir is ${Complex_BINARY_DIR}")
ADD_CUSTOM_COMMAND(COMMAND ${CREATE_FILE_EXE}
ARGS "${Complex_BINARY_DIR}/Library/postbuild.txt"
TARGET CMakeTestLibraryShared)
diff --git a/Tests/Complex/Library/moduleFile.c b/Tests/Complex/Library/moduleFile.c
new file mode 100644
index 0000000000..608d750f19
--- /dev/null
+++ b/Tests/Complex/Library/moduleFile.c
@@ -0,0 +1,6 @@
+#include "moduleFile.h"
+
+int ModuleFunction()
+{
+ return 1;
+}
diff --git a/Tests/Complex/Library/moduleFile.h b/Tests/Complex/Library/moduleFile.h
new file mode 100644
index 0000000000..6b561e1092
--- /dev/null
+++ b/Tests/Complex/Library/moduleFile.h
@@ -0,0 +1,12 @@
+#if defined(_WIN32) || defined(WIN32) /* Win32 version */
+#ifdef CMakeTestModule_EXPORTS
+# define CMakeTest_EXPORT __declspec(dllexport)
+#else
+# define CMakeTest_EXPORT __declspec(dllimport)
+#endif
+#else
+/* unix needs nothing */
+#define CMakeTest_EXPORT
+#endif
+
+CMakeTest_EXPORT int ModuleFunction();