qt.tools.cmake.xx.qs.in 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /****************************************************************************
  2. **
  3. ** Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  4. ** file Copyright.txt or https://cmake.org/licensing for details.
  5. **
  6. ****************************************************************************/
  7. // constructor
  8. function Component()
  9. {
  10. installer.valueChanged.connect( this, Component.prototype.reactOnTargetDirChange );
  11. // set the default values to CMAKE@CM_VER_XY@_DIR
  12. Component.prototype.reactOnTargetDirChange("TargetDir", installer.value("TargetDir"));
  13. }
  14. Component.prototype.reactOnTargetDirChange = function(key, value)
  15. {
  16. if (key == "TargetDir") {
  17. var path = value + "/@CM_INST_PREF@";
  18. installer.setValue("CMAKE@CM_VER_XY@_DIR", path.replace(/\\/g, "/"));
  19. }
  20. }
  21. Component.prototype.createOperations = function()
  22. {
  23. component.createOperations();
  24. if (installer.value("os") == "win") {
  25. try {
  26. if (installer.value("SDKToolBinary") == "")
  27. return;
  28. var cmId = component.name;
  29. installer.setValue("CMAKE@CM_VER_XY@_ID", cmId);
  30. component.addOperation("Execute",
  31. ["{0,2}", "@SDKToolBinary@", "addCMake",
  32. "--id", cmId,
  33. "--name", "@CMake_IFW_ROOT_COMPONENT_DISPLAY_NAME@",
  34. "--path", "@CM_VER_XY_DIR@/bin/cmake.exe",
  35. "UNDOEXECUTE",
  36. "@SDKToolBinary@", "rmCMake", "--id", cmId]);
  37. } catch( e ) {
  38. print( e );
  39. }
  40. }
  41. }