开发者

how to work on a project with visual studio and eclipse

开发者 https://www.devze.com 2023-01-19 13:08 出处:网络
we are currently starting a project involving people on windows and linux and using SVN. The problem is that people who want to use Visual Studio (2010 for most of them) have problem with the folder

we are currently starting a project involving people on windows and linux and using SVN.

The problem is that people who want to use Visual Studio (2010 for most of them) have problem with the folder structure and the syncing of开发者_运维技巧 there project.

they've got ankhsvn (http://ankhsvn.open.collab.net/), they are mapping the project to real folder, so everyone have the good file structure and the solution is on the SVN (we would prefer not to but ankhsvn kind of need it) other people just chekout the project folder under the solution on SVN.

But if someone that is not using SVN add a new file VS doesn't add it automatically and that cause a lot of trouble.

So is our setup right? is there a way to work well with this kind of environment? how would you suggest us to work?


Maintaining multiple build targets is difficult if you have to update project files for each target. For example, adding a new source file requires updating a Visual Studio project and a makefile.

How about giving CMake a try? It can generate project files for several build environments. We use it at my job to support multiple versions of Visual Studio on either 32 or 64-bit Windows as well as multiple versions of gcc on 32 or 64-bit Linux. Each project (a library or executable) requires maintaining a single CMakeLists.txt file that is used to generate the target project files.


I'd say that Cmake is definitely the way to go: it will allow you to maintain only one set of files (the CMakeLists.txt) and you will be able to generate projects for all Visual Studio versions, for Eclipse, Xcode and makefiles for gcc, CC, etc...

In terms of the difficulty of setting up cmake: it's not that much work in most cases. You don't need to specify the list of files to be included, as you mention in your comment to Jaime's answer. You can include (glob) a folder. That way, when new source files are added, they will be included in your solution whenever you refresh it by running the cmake command.

Also having your project in cmake may help setting up a continuous integration framework, such as Hudson. It can monitor your code repository (svn) and call cmake when changes are submitted, build your project, run unit tests.

project(MyNeatProject)

include_directories(h/ hpp/)
file(GLOB_RECURSE _my_src ./c/*.c)
file(GLOB_RECURSE _my_hdr ./h/*.h)
add_library( some_library SHARED ${YBMBS_SRC} ${YBMBS_HDR})
target_link_libraries( some_library dependency1 dependency2)


I would separate my tree structure (maybe completely separate repos) based on your team's makeup or the environment you're targeting.

Everyone needs to have an SVN client - those who can't use AnkhSVN because they are in Eclipse can use something like Tortoise or an SVN plugin for Eclipse. SVN doesn't know or care about the fact that it's tracking your C# or Java or whatever code. If you add a file to your local HDD it will not magically appear inside the repo.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号