Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Experience converting Qt VS Tools MSVC project to cmake

Experience converting Qt VS Tools MSVC project to cmake

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 701 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • PerdrixP Offline
    PerdrixP Offline
    Perdrix
    wrote on last edited by Perdrix
    #1

    I just tried to use cmake-converter to do this conversion, but it all fell about on me :(

    I realise that this isn't a place for getting support for cmake-converter, but if there's any help that anyone can give me based on the below log I'd be most grateful. I'm particularly interested in the lines like:

    DeepSkyStackerLive/DeepSkyStackerLive.vcxproj(35): file
    or path "C:\Users\amonra\Documents\GitHub\DSS\DeepSkyStackerLive$(QtMsBuild)\qt_defaults.props" not found.

    as I'm unclear whether the qt_default.props file is relevant to a CMake build (and it shouldn't be trying to look there for that file anyway - it should be looking for: "$(QtMsBuild)\qt_defaults.props".

    Clearly moving from MsBuild with QT VS Tools to CMake is tricker than I'd hoped.

    C:\Users\amonra\Documents\GitHub\DSS>cmake-converter -s DeepSkyStacker.VS2022.sln
    0.000000 processes count = 16
    0.000000 warnings level = 2
    0.199718 1> Conversion started: Project DeepSkyStackerCL
    0.203894 2> Conversion started: Project DeepSkyStackerLive
    0.207380 3> Conversion started: Project DeepSkyStacker
    0.213875 4> Conversion started: Project libtiff
    0.215014 5> Conversion started: Project ZCLass
    0.216017 6> Conversion started: Project libraw0.216017 7>
    Conversion started: Project DeepSkyStackerTest
    0.224847 8> Conversion started: Project DeepSkyStackerKernel
    0.233438 2> WARN L1 : file:/C:/Users/amonra/Documents/GitHub/DSS/DeepSkyStackerLive/DeepSkyStackerLive.vcxproj(35): file
     or path "C:\Users\amonra\Documents\GitHub\DSS\DeepSkyStackerLive\$(QtMsBuild)\qt_defaults.props" not found.
    0.234435 2> WARN L1 : file:/C:/Users/amonra/Documents/GitHub/DSS/DeepSkyStackerLive/DeepSkyStackerLive.vcxproj(35): gett
    ing actual filesystem name failed : "C:\Users\amonra\Documents\GitHub\DSS\DeepSkyStackerLive\$(QtMsBuild)\qt_defaults.pr
    ops"
    0.237427 6> WARN L1 : file:/C:/Users/amonra/Documents/GitHub/DSS/LibRaw/buildfiles/libraw.vcxproj(49): ('Debug', 'x64')
    : Unknown variable: $(PlatformTarget), trying $ENV{PlatformTarget}0.238425 2> WARN L1 :
    0.239422 6> WARN L1 : file:/C:/Users/amonra/Documents/GitHub/DSS/DeepSkyStackerLive/DeepSkyStackerLive.vcxproj(56): ('Re
    lease', 'x64') : file or path "C:\Users\amonra\Documents\GitHub\DSS\DeepSkyStackerLive\$(QtMsBuild)\Qt.props" not found.
    file:/C:/Users/amonra/Documents/GitHub/DSS/LibRaw/buildfiles/libraw.vcxproj(53): ('Release', 'x64') : Unknown variable:
    $(PlatformTarget), trying $ENV{PlatformTarget}
    0.240422 2> WARN L1 :
    file:/C:/Users/amonra/Documents/GitHub/DSS/DeepSkyStackerLive/DeepSkyStackerLive.vcxproj(56): ('Release', 'x64') : getti
    ng actual filesystem name failed : "C:\Users\amonra\Documents\GitHub\DSS\DeepSkyStackerLive\$(QtMsBuild)\Qt.props"
    0.243465 4> WARN L1 : 0.243465 5> WARN L1 : 0.243465 7> WARN L1 : file:/C:/Users/amonra/Documents/GitHub/DSS/LibTiff/lib
    tiff.vcxproj(51): ('Release', 'x64') : Unknown variable: $(PlatformTarget), trying $ENV{PlatformTarget}file:/C:/Users/am
    onra/Documents/GitHub/DSS/ZCLass/ZCLass.vcxproj(36): file or path "C:\Users\amonra\Documents\GitHub\DSS\ZCLass\$(QtMsBui
    ld)\qt_defaults.props" not found.file:/C:/Users/amonra/Documents/GitHub/DSS/DeepSkyStackerTest/DeepSkyStackerTest.vcxpro
    j(37): file or path "C:\Users\amonra\Documents\GitHub\DSS\DeepSkyStackerTest\$(QtMsBuild)\qt_defaults.props" not found.
    
    0.245470 4> WARN L1 : 0.245470 2> WARN L1 : 0.245470 5> WARN L1 :
    file:/C:/Users/amonra/Documents/GitHub/DSS/LibTiff/libtiff.vcxproj(56): ('Debug', 'x64') : Unknown variable: $(PlatformT
    arget), trying $ENV{PlatformTarget}0.245470 7> WARN L1 : file:/C:/Users/amonra/Documents/GitHub/DSS/DeepSkyStackerLive/D
    eepSkyStackerLive.vcxproj(61): ('Debug', 'x64') : file or path "C:\Users\amonra\Documents\GitHub\DSS\DeepSkyStackerLive\
    $(QtMsBuild)\Qt.props" not found.file:/C:/Users/amonra/Documents/GitHub/DSS/ZCLass/ZCLass.vcxproj(36): getting actual fi
    lesystem name failed : "C:\Users\amonra\Documents\GitHub\DSS\ZCLass\$(QtMsBuild)\qt_defaults.props"
    file:/C:/Users/amonra/Documents/GitHub/DSS/DeepSkyStackerTest/DeepSkyStackerTest.vcxproj(37): getting actual filesystem
    name failed : "C:\Users\amonra\Documents\GitHub\DSS\DeepSkyStackerTest\$(QtMsBuild)\qt_defaults.props"
    
    0.247972 2> WARN L1 :
    file:/C:/Users/amonra/Documents/GitHub/DSS/DeepSkyStackerLive/DeepSkyStackerLive.vcxproj(61): ('Debug', 'x64') : getting
     actual filesystem name failed : "C:\Users\amonra\Documents\GitHub\DSS\DeepSkyStackerLive\$(QtMsBuild)\Qt.props"
    0.250325 5> WARN L1 : file:/C:/Users/amonra/Documents/GitHub/DSS/ZCLass/ZCLass.vcxproj(56): ('Release', 'x64') : file or
     path "C:\Users\amonra\Documents\GitHub\DSS\ZCLass\$(QtMsBuild)\Qt.props" not found.0.251328 7> WARN L1 :
    file:/C:/Users/amonra/Documents/GitHub/DSS/DeepSkyStackerTest/DeepSkyStackerTest.vcxproj(58): ('Debug', 'x64') : file or
     path "C:\Users\amonra\Documents\GitHub\DSS\DeepSkyStackerTest\$(QtMsBuild)\Qt.props" not found.0.251328 5> WARN L1 : fi
    le:/C:/Users/amonra/Documents/GitHub/DSS/ZCLass/ZCLass.vcxproj(56): ('Release', 'x64') : getting actual filesystem name
    failed : "C:\Users\amonra\Documents\GitHub\DSS\ZCLass\$(QtMsBuild)\Qt.props"
    0.252803 7> WARN L1 :
    file:/C:/Users/amonra/Documents/GitHub/DSS/DeepSkyStackerTest/DeepSkyStackerTest.vcxproj(58): ('Debug', 'x64') : getting
     actual filesystem name failed : "C:\Users\amonra\Documents\GitHub\DSS\DeepSkyStackerTest\$(QtMsBuild)\Qt.props"
    0.255816 7> WARN L1 : file:/C:/Users/amonra/Documents/GitHub/DSS/DeepSkyStackerTest/DeepSkyStackerTest.vcxproj(62): ('Re
    lease', 'x64') : file or path "C:\Users\amonra\Documents\GitHub\DSS\DeepSkyStackerTest\$(QtMsBuild)\Qt.props" not found.
    
    0.256812 7> WARN L1 : 0.256812 5> WARN L1 : file:/C:/Users/amonra/Documents/GitHub/DSS/DeepSkyStackerTest/DeepSkyStacker
    Test.vcxproj(62): ('Release', 'x64') : getting actual filesystem name failed : "C:\Users\amonra\Documents\GitHub\DSS\Dee
    pSkyStackerTest\$(QtMsBuild)\Qt.props"file:/C:/Users/amonra/Documents/GitHub/DSS/ZCLass/ZCLass.vcxproj(62): ('Debug', 'x
    64') : file or path "C:\Users\amonra\Documents\GitHub\DSS\ZCLass\$(QtMsBuild)\Qt.props" not found.
    
    0.259968 5> WARN L1 : file:/C:/Users/amonra/Documents/GitHub/DSS/ZCLass/ZCLass.vcxproj(62): ('Debug', 'x64') : getting a
    ctual filesystem name failed : "C:\Users\amonra\Documents\GitHub\DSS\ZCLass\$(QtMsBuild)\Qt.props"
    0.263376 5> WARN L1 : file:/C:/Users/amonra/Documents/GitHub/DSS/ZCLass/ZCLass.vcxproj(68): ('Debug', 'x64') : Unknown v
    ariable: $(PlatformTarget), trying $ENV{PlatformTarget}
    0.264443 5> WARN L1 : file:/C:/Users/amonra/Documents/GitHub/DSS/ZCLass/ZCLass.vcxproj(74): ('Release', 'x64') : Unknown
     variable: $(PlatformTarget), trying $ENV{PlatformTarget}0.264443 7> WARN L1 :
    file:/C:/Users/amonra/Documents/GitHub/DSS/DeepSkyStackerTest/DeepSkyStackerTest.vcxproj(83): ('Debug', 'x64') : file or
     path "C:\Users\amonra\Documents\GitHub\DSS\DeepSkyStackerTest\$(Boost_1_80_0)" not found.
    0.265499 7> WARN L1 : file:/C:/Users/amonra/Documents/GitHub/DSS/DeepSkyStackerTest/DeepSkyStackerTest.vcxproj(83): ('De
    bug', 'x64') : getting actual filesystem name failed : "C:\Users\amonra\Documents\GitHub\DSS\DeepSkyStackerTest\$(Boost_
    1_80_0)"
    0.266714 7> WARN L1 : file:/C:/Users/amonra/Documents/GitHub/DSS/DeepSkyStackerTest/DeepSkyStackerTest.vcxproj(93): ('De
    bug', 'x64') : Found absolute path : C:/Program Files %28x86%29/Visual Leak Detector/lib/Win64
    0.269983 2> WARN L1 : file:/C:/Users/amonra/Documents/GitHub/DSS/DeepSkyStackerLive/DeepSkyStackerLive.vcxproj(95): ('De
    bug', 'x64') : file or path "C:\Users\amonra\Documents\GitHub\DSS\zlib" not found.
    0.271015 2> WARN L1 : file:/C:/Users/amonra/Documents/GitHub/DSS/DeepSkyStackerLive/DeepSkyStackerLive.vcxproj(95): ('De
    bug', 'x64') : getting actual filesystem name failed : "C:\Users\amonra\Documents\GitHub\DSS\zlib"
    0.272180 7> WARN L1 : file:/C:/Users/amonra/Documents/GitHub/DSS/DeepSkyStackerTest/DeepSkyStackerTest.vcxproj(106): ('R
    elease', 'x64') : file or path "C:\Users\amonra\Documents\GitHub\DSS\DeepSkyStackerTest\$(Boost_1_80_0)" not found.
    0.273177 7> WARN L1 : file:/C:/Users/amonra/Documents/GitHub/DSS/DeepSkyStackerTest/DeepSkyStackerTest.vcxproj(106): ('R
    elease', 'x64') : getting actual filesystem name failed : "C:\Users\amonra\Documents\GitHub\DSS\DeepSkyStackerTest\$(Boo
    st_1_80_0)"0.274174 2> WARN L1 :
    file:/C:/Users/amonra/Documents/GitHub/DSS/DeepSkyStackerLive/DeepSkyStackerLive.vcxproj(95): ('Debug', 'x64') : file or
     path "C:\Users\amonra\Documents\GitHub\DSS\DeepSkyStackerLive\$(Boost_1_80_0)" not found.
    0.275171 2> WARN L1 : file:/C:/Users/amonra/Documents/GitHub/DSS/DeepSkyStackerLive/DeepSkyStackerLive.vcxproj(95): ('De
    bug', 'x64') : getting actual filesystem name failed : "C:\Users\amonra\Documents\GitHub\DSS\DeepSkyStackerLive\$(Boost_
    1_80_0)"
    0.276168 2> WARN L1 : file:/C:/Users/amonra/Documents/GitHub/DSS/DeepSkyStackerLive/DeepSkyStackerLive.vcxproj(96): ('De
    bug', 'x64') : Unknown variable: $(Qt_DEFINES_), trying $ENV{Qt_DEFINES_}
    0.294335 5> Conversion done   : Project ZCLass (8 warnings)
    0.295396 2> WARN L1 : file:/C:/Users/amonra/Documents/GitHub/DSS/DeepSkyStackerLive/DeepSkyStackerLive.vcxproj(151): ('R
    elease', 'x64') : file or path "C:\Users\amonra\Documents\GitHub\DSS\zlib" not found.
    0.296577 2> WARN L1 : file:/C:/Users/amonra/Documents/GitHub/DSS/DeepSkyStackerLive/DeepSkyStackerLive.vcxproj(151): ('R
    elease', 'x64') : getting actual filesystem name failed : "C:\Users\amonra\Documents\GitHub\DSS\zlib"
    0.299079 2> WARN L1 : file:/C:/Users/amonra/Documents/GitHub/DSS/DeepSkyStackerLive/DeepSkyStackerLive.vcxproj(151): ('R
    elease', 'x64') : file or path "C:\Users\amonra\Documents\GitHub\DSS\DeepSkyStackerLive\$(Boost_1_80_0)" not found.
    0.299079 2> WARN L1 : file:/C:/Users/amonra/Documents/GitHub/DSS/DeepSkyStackerLive/DeepSkyStackerLive.vcxproj(151): ('R
    elease', 'x64') : getting actual filesystem name failed : "C:\Users\amonra\Documents\GitHub\DSS\DeepSkyStackerLive\$(Boo
    st_1_80_0)"
    0.300534 2> WARN L1 : file:/C:/Users/amonra/Documents/GitHub/DSS/DeepSkyStackerLive/DeepSkyStackerLive.vcxproj(152): ('R
    elease', 'x64') : Unknown variable: $(Qt_DEFINES_), trying $ENV{Qt_DEFINES_}
    0.313326 7> Conversion done   : Project DeepSkyStackerTest (11 warnings)
    0.362292 4> Conversion done   : Project libtiff (2 warnings)
    0.384336 2> Conversion done   : Project DeepSkyStackerLive (16 warnings)
    0.433261 6> Conversion done   : Project libraw (2 warnings)
    multiprocessing.pool.RemoteTraceback:
    """
    Traceback (most recent call last):
      File "C:\Program Files\Python311\Lib\multiprocessing\pool.py", line 125, in worker
        result = (True, func(*args, **kwds))
                        ^^^^^^^^^^^^^^^^^^^
      File "C:\Program Files\Python311\Lib\multiprocessing\pool.py", line 48, in mapstar
        return list(map(*args))
               ^^^^^^^^^^^^^^^^
      File "C:\Program Files\Python311\Lib\site-packages\cmake_converter\data_converter.py", line 285, in run_conversion
        converted = self.convert_project(
                    ^^^^^^^^^^^^^^^^^^^^^
      File "C:\Program Files\Python311\Lib\site-packages\cmake_converter\data_converter.py", line 252, in convert_project
        self.collect_data(context)
      File "C:\Program Files\Python311\Lib\site-packages\cmake_converter\data_converter.py", line 53, in collect_data
        context.parser.parse(context)
      File "C:\Program Files\Python311\Lib\site-packages\cmake_converter\visual_studio\vcxproj\parser.py", line 145, in pars
    e
        self._parse_nodes(context, root)
      File "C:\Program Files\Python311\Lib\site-packages\cmake_converter\parser.py", line 101, in _parse_nodes
        node_handlers[child_node_tag](context, child_node)
      File "C:\Program Files\Python311\Lib\site-packages\cmake_converter\visual_studio\vcxproj\parser.py", line 190, in __pa
    rse_property_group
        self._parse_nodes(context, node)
      File "C:\Program Files\Python311\Lib\site-packages\cmake_converter\parser.py", line 92, in _parse_nodes
        self._parse_attributes(context, child_node)
      File "C:\Program Files\Python311\Lib\site-packages\cmake_converter\parser.py", line 119, in _parse_attributes
        attributes_handlers[attr](context, attr, node.get(attr), node)
      File "C:\Program Files\Python311\Lib\site-packages\cmake_converter\visual_studio\vcxproj\parser.py", line 291, in __pa
    rse_condition
        cmake_setting = make_cmake_configuration(context, found.group(1))
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Program Files\Python311\Lib\site-packages\cmake_converter\utils.py", line 508, in make_cmake_configuration
        return "{}|{}".format(*sln_conf_arch)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    IndexError: Replacement index 1 out of range for positional args tuple
    """
    
    The above exception was the direct cause of the following exception:
    
    Traceback (most recent call last):
      File "<frozen runpy>", line 198, in _run_module_as_main
      File "<frozen runpy>", line 88, in _run_code
      File "C:\Program Files\Python311\Scripts\cmake-converter.exe\__main__.py", line 7, in <module>
      File "C:\Program Files\Python311\Lib\site-packages\cmake_converter\main.py", line 144, in main
        converter.convert_solution(project_context, os.path.abspath(args.solution))
      File "C:\Program Files\Python311\Lib\site-packages\cmake_converter\visual_studio\solution.py", line 330, in convert_so
    lution
        results = self.do_conversion(project_context, input_data_for_converter)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Program Files\Python311\Lib\site-packages\cmake_converter\data_converter.py", line 317, in do_conversion
        results = pool.map(self.run_conversion, input_converter_data_list)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Program Files\Python311\Lib\multiprocessing\pool.py", line 367, in map
        return self._map_async(func, iterable, mapstar, chunksize).get()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Program Files\Python311\Lib\multiprocessing\pool.py", line 774, in get
        raise self._value
    IndexError: Replacement index 1 out of range for positional args tuple
    
    C:\Users\amonra\Documents\GitHub\DSS>
    

    Thanks, David

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SimonSchroeder
      wrote on last edited by
      #2

      I haven't really used CMake so far (but I'm an interested observer). My guess is that automatic conversion might give a working CMake file, but it is most likely not maintainable. Automatic conversion will try to handle Qt like any other library while there is a simple, maintainable solution by importing the Qt module/package inside the CMake file (not entirely sure about the terminology).

      I would personally try to remove everything Qt-related (but not your own source using Qt) from the project(s) and then try to convert the solution. After that it is a single line to include Qt again into your CMake configuration. Also, I would create a separate CMake file for each project in your solution. Then, you'd have to add the dependencies between the different projects back into the CMake files by hand (also very simple).

      1 Reply Last reply
      0
      • PerdrixP Offline
        PerdrixP Offline
        Perdrix
        wrote on last edited by Perdrix
        #3

        there is a simple, maintainable solution by importing the Qt module/package inside the CMake file

        Where do I find information about this please

        1 Reply Last reply
        0
        • Christian EhrlicherC Online
          Christian EhrlicherC Online
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Lmgtfy: https://doc.qt.io/qt-6/cmake-manual.html

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          1 Reply Last reply
          1

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved