MacroAddPlugin.cmake 994 B

123456789101112131415161718192021222324252627282930
  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, <neundorf@kde.org>
  8. # Copyright (c) 2006, Laurent Montel, <montel@kde.org>
  9. # Copyright (c) 2006, Andreas Schneider, <asn@cryptomilk.org>
  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. macro (MACRO_ADD_PLUGIN _target_NAME _with_PREFIX)
  14. if (${_with_PREFIX} STREQUAL "WITH_PREFIX")
  15. set(_first_SRC)
  16. else (${_with_PREFIX} STREQUAL "WITH_PREFIX")
  17. set(_first_SRC ${_with_PREFIX})
  18. endif (${_with_PREFIX} STREQUAL "WITH_PREFIX")
  19. add_library(${_target_NAME} MODULE ${_first_SRC} ${ARGN})
  20. if (_first_SRC)
  21. set_target_properties(${_target_NAME} PROPERTIES PREFIX "")
  22. endif (_first_SRC)
  23. endmacro (MACRO_ADD_PLUGIN _name _sources)