Project conversion on the command line using vcpkg

vcpkg is a free C/C++ package manager for acquiring and managing libraries. It runs on all platforms, build systems, and work flows. it is maintained by the Microsoft C++ team and open source contributors.

In your favorite terminal application, change to the directory containing the uvprojx-based project.

  1. If you have not done it before, install vcpkg (otherwise continue to step 2):

        
    
            
            
                
       curl -LO https://aka.ms/vcpkg-init.cmd && .\vcpkg-init.cmd
         
            
        
    
        
    
            
            
                
       iex (iwr -useb https://aka.ms/vcpkg-init.ps1)
         
            
        
    
        
    
            
            
                
       . < (curl https://aka.ms/vcpkg-init.sh -L)
         
            
        
    
  2. Initialize vcpkg:

        
    
            
            
                
       %USERPROFILE%\.vcpkg\vcpkg-init.cmd
         
            
        
    
        
    
            
            
                
       . ~/.vcpkg/vcpkg-init.ps1
         
            
        
    
        
    
            
            
                
       . ~/.vcpkg/vcpkg-init
         
            
        
    
  3. Update the Arm vcpkg registry (this will give you access to tools hosted by Arm):

        
    
            
            
                vcpkg x-update-registry arm
            
        
    
  4. Enable the uv2csolution conversion tool:

        
    
            
            
                vcpkg use uv2csolution
            
        
    
  5. Run the conversion (in this example, the project is called MyProject.uvprojx):

        
    
            
            
                uv2csolution MyProject.uvprojx
            
        
    

    This step generates the following files:

    • MyProject.csolution.yaml
    • MyProject.cproject.yaml
    • vcpkg-configuration.json
  6. Activate the vcpkg configuration (this will install all required tools on your machine):

        
    
            
            
                vcpkg activate
            
        
    
  7. Get an MDK-Community license:

        
    
            
            
                armlm activate -product KEMDK-COM0 -server https://mdk-preview.keil.arm.com
            
        
    
  8. [Optional] Check your license:

        
    
            
            
                armlm inspect
            
        
    
  9. Build the project:

        
    
            
            
                cbuild MyProject.csolution.yaml --update-rte
            
        
    

    A successful project build will end with:

        
    
            
            Program size: Code=... RO-data=... RW-data=... ZI-data=...
    info cbuild: build finished successfully!
    
            
        
    
Back
Next