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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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%CMake_VERSION_MAJOR%%CMake_VERSION_MINOR%_BIN_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 + "/%CMAKE_BIN_DIR%";
  18. installer.setValue("CMAKE%CMake_VERSION_MAJOR%%CMake_VERSION_MINOR%_BIN_DIR", path.replace(/\\/g, "/"));
  19. }
  20. }
  21. Component.prototype.createOperations = function()
  22. {
  23. component.createOperations();
  24. try {
  25. if (installer.value("SDKToolBinary") == "")
  26. return;
  27. var cmId = component.name;
  28. installer.setValue("CMAKE%CMake_VERSION_MAJOR%%CMake_VERSION_MINOR%_ID", cmId);
  29. component.addOperation("Execute",
  30. ["{0,2}", "@SDKToolBinary@", "addCMake",
  31. "--id", cmId,
  32. "--name", "%CMake_IFW_ROOT_COMPONENT_DISPLAY_NAME%",
  33. "--path", "@CMAKE%CMake_VERSION_MAJOR%%CMake_VERSION_MINOR%_BIN_DIR@/cmake%CMAKE_EXECUTABLE_SUFFIX%",
  34. "UNDOEXECUTE",
  35. "@SDKToolBinary@", "rmCMake", "--id", cmId]);
  36. } catch( e ) {
  37. print( e );
  38. }
  39. }