question

RoeyNissim avatar image
0 Votes"
RoeyNissim asked geruni-5550 answered

cmake project - why rsync copies more then it should?


My cmake project is in a sub directory as a part of a much larger repo like so:

 repo_dir
   |
   some java projects dirs...
   |
   some dotnet projects dirs..
   |
   my cmake project dir
      CMakeLists.txt

I use VS 2022 and build my project on a remote linux machine. when i try to sync and build my project it copies the entire "repo_dir" to the remote machine and not just "my cmake project dir", why is that? what to i need to set in order to fix that?



vs-generalvs-extensions
· 6
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @RoeyNissim-4785 , could you share me the step(s) which you took to sync your project? Besides, if you try to sync other project from your repo_dir, will VS copy the entire repo_dir?

0 Votes 0 ·
  1. I sync using VS (2022) it does it automatically but also if i press "Configure cache"

  2. I don't have any other cmake projects, other projects in the repo are java/dotnet projects and are built locally





0 Votes 0 ·

OK i found a workaround (and its a bad one), it seems that its all have to do with how do i open my project for the first time in VS and where is the .vs dir generated

if I open the solution from the git menu (by adding the local repo to VS) then the .vs dir is generated in repo_dir and when rsync copied sources to remote machine it copies the entire repo (basically root dir is repo_dir defined by the location of .vs dir)
on the other hand if I open from file->open->cmake then the .vs dir is generated inside "my cmake project dir" (not the repo_dir) and then only the correct sources are copied (only the files under the cmake project dir

This is VS inconsistency

0 Votes 0 ·

Hi @RoeyNissim , I think this is caused by the different purposes of the VS options. When opening solution from Git menu, VS may focus on the whole Git repo and create related Git settings and configuration files for all the projects included in this repo. When opening project from File menu, VS will focus more on single project and its settings.

Besides, I appreciate that you share the workaround and what you found with us.

0 Votes 0 ·
Show more comments

1 Answer

geruni-5550 avatar image
0 Votes"
geruni-5550 answered

I have not encountered such a problem on VS 2020, it may be worth returning to this version

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.