Debian Codegraph @

cmake/Modules/MacroAddPlugin.cmake

raw
1 # - MACRO_ADD_PLUGIN(name [WITH_PREFIX] file1 .. fileN)
2 #
3 # Create a plugin from the given source files.
4 # If WITH_PREFIX is given, the resulting plugin will have the
5 # prefix "lib", otherwise it won't.
6 #
7 # Copyright (c) 2006, Alexander Neundorf, <[email protected]>
8 # Copyright (c) 2006, Laurent Montel, <[email protected]>
9 # Copyright (c) 2006, Andreas Schneider, <[email protected]>
10 #
11 # Redistribution and use is allowed according to the terms of the BSD license.
12 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
13
14
15 macro (MACRO_ADD_PLUGIN _target_NAME _with_PREFIX)
16
17 if (${_with_PREFIX} STREQUAL "WITH_PREFIX")
18 set(_first_SRC)
19 else (${_with_PREFIX} STREQUAL "WITH_PREFIX")
20 set(_first_SRC ${_with_PREFIX})
21 endif (${_with_PREFIX} STREQUAL "WITH_PREFIX")
22
23 add_library(${_target_NAME} MODULE ${_first_SRC} ${ARGN})
24
25 if (_first_SRC)
26 set_target_properties(${_target_NAME} PROPERTIES PREFIX "")
27 endif (_first_SRC)
28
29 endmacro (MACRO_ADD_PLUGIN _name _sources)
30