ctkPluginGeneratorTargetLibraries.cpp 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*=============================================================================
  2. Library: CTK
  3. Copyright (c) German Cancer Research Center,
  4. Division of Medical and Biological Informatics
  5. Licensed under the Apache License, Version 2.0 (the "License");
  6. you may not use this file except in compliance with the License.
  7. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. =============================================================================*/
  15. #include "ctkPluginGeneratorTargetLibraries.h"
  16. #include <QTextStream>
  17. const QString ctkPluginGeneratorTargetLibraries::TARGETLIBRARIES_MARKER = "targetlibraries";
  18. ctkPluginGeneratorTargetLibraries::ctkPluginGeneratorTargetLibraries(ctkPluginGeneratorAbstractTemplate* parent)
  19. : ctkPluginGeneratorAbstractTemplate("target_libraries.cmake", parent)
  20. {
  21. }
  22. QString ctkPluginGeneratorTargetLibraries::generateContent()
  23. {
  24. QString content;
  25. QTextStream stream(&content);
  26. stream << "# See CMake/ctkFunctionGetTargetLibraries.cmake\n"
  27. << "#\n"
  28. << "# This file should list the libraries required to build the current CTK plugin.\n"
  29. << "# For specifying required plugins, see the manifest_headers.cmake file.\n"
  30. << "#\n\n"
  31. << "SET(target_libraries\n";
  32. QStringList libs = getContent(TARGETLIBRARIES_MARKER);
  33. foreach(QString lib, libs)
  34. {
  35. stream << " " << lib << "\n";
  36. }
  37. stream << ")\n";
  38. return content;
  39. }
  40. QStringList ctkPluginGeneratorTargetLibraries::getMarkers() const
  41. {
  42. QStringList markers = ctkPluginGeneratorAbstractTemplate::getMarkers();
  43. markers << TARGETLIBRARIES_MARKER;
  44. return markers;
  45. }