aboutsummaryrefslogtreecommitdiff
path: root/cmake/Modules/MacroAddPlugin.cmake
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2009-02-02 14:44:46 +0000
committerAndreas Schneider <mail@cynapses.org>2009-02-02 14:44:46 +0000
commit460d0b402bac86221fd94f086ef88f94f584df1f (patch)
tree5f04167dabc7bff9273a4dffafcba7b9d7f0a578 /cmake/Modules/MacroAddPlugin.cmake
parent234706548121cb9acf609b6cce71d53144143968 (diff)
downloadlibssh-460d0b402bac86221fd94f086ef88f94f584df1f.tar.gz
libssh-460d0b402bac86221fd94f086ef88f94f584df1f.tar.xz
libssh-460d0b402bac86221fd94f086ef88f94f584df1f.zip
Add Makefiles for the CMake build system.
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@203 7dcaeef0-15fb-0310-b436-a5af3365683c
Diffstat (limited to 'cmake/Modules/MacroAddPlugin.cmake')
-rw-r--r--cmake/Modules/MacroAddPlugin.cmake30
1 files changed, 30 insertions, 0 deletions
diff --git a/cmake/Modules/MacroAddPlugin.cmake b/cmake/Modules/MacroAddPlugin.cmake
new file mode 100644
index 00000000..36b5e57e
--- /dev/null
+++ b/cmake/Modules/MacroAddPlugin.cmake
@@ -0,0 +1,30 @@
+# - MACRO_ADD_PLUGIN(name [WITH_PREFIX] file1 .. fileN)
+#
+# Create a plugin from the given source files.
+# If WITH_PREFIX is given, the resulting plugin will have the
+# prefix "lib", otherwise it won't.
+#
+# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
+# Copyright (c) 2006, Laurent Montel, <montel@kde.org>
+# Copyright (c) 2006, Andreas Schneider, <mail@cynapses.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+macro (MACRO_ADD_PLUGIN _target_NAME _with_PREFIX)
+
+ if (${_with_PREFIX} STREQUAL "WITH_PREFIX")
+ set(_first_SRC)
+ else (${_with_PREFIX} STREQUAL "WITH_PREFIX")
+ set(_first_SRC ${_with_PREFIX})
+ endif (${_with_PREFIX} STREQUAL "WITH_PREFIX")
+
+ add_library(${_target_NAME} MODULE ${_first_SRC} ${ARGN})
+
+ if (_first_SRC)
+ set_target_properties(${_target_NAME} PROPERTIES PREFIX "")
+ endif (_first_SRC)
+
+endmacro (MACRO_ADD_PLUGIN _name _sources)
+