我即将开始开发一个用C++编写的跨平台库。在未来,我打算实现其他语言的绑定,如Python、Java等。该库需要在主要平台上可用: win32、Linux和Mac。
尽管该应用程序实际上是一个库,但一些基本的控制台程序将与它捆绑在一起,用于演示和测试。
在我开始在Subversion中存储东西之前,我想要想出一个最佳的文件夹结构。
我在想一些类似的东西:
/project //Top level folder
/bin //Binaries ready for deployment
/linux_amd64 //Linux AMD64 platform
/debug //Debug build - duplicated in all platforms
/release //Release build - duplicated in all platforms
/linux_i386 //Linux 32-bit platform
/macosx //Mac OS X
/win32 //Windows 32-bit platform
/cygwin //Windows 32-bit platform compiled with Cygwin
/vs.net //Windows 32-bit platform compiled with Visual Studio .NET
/win64 //Windows 64-bit platform
/build //Make and build files, IDE project files
/linux_amd64 //Linux AMD64 platform
/linux_i386 //Linux 32-bit platform
/macosx //Mac OS X
/win32 //Windows 32-bit platform
/win64 //Windows 64-bit platform
/config //Configuration files that accompany the binaries
/data //Data files that accompany the binaries
/doc //Documentation
/lib //External or third-party libraries
/platforms //Platform-specific code for ...
/linux_amd64 //Linux AMD64 platform
/linux_i386 //Linux 32-bit platform
/macosx //Mac OS X
/win32 //Windows 32-bit platform
/win64 //Windows 64-bit platform
/src //Available library source code in subfolders
/src //Source code tree - this will contain main.cpp
/bindings //Bindings to other languages such as ...
/python
/java
/h //Header files
/modules //Platform-independent modules, components or subprojects
/platforms //Platform-specific code for ...
/linux_amd64 //Linux AMD64 platform-specific code
/linux_i386 //Linux 32-bit platform-specific code
/macosx
/win32 //Windows 32-bit platform-specific code
/win64 //Windows 64-bit platform
/test //Automated test scripts如果你有什么建议,我很乐意听听。我想知道是否有工具可以帮助创建这种结构。
我计划使用CMake和Subversion。
发布于 2009-04-05 02:44:35
我最近在一个目录中发布了一个question about packaging headers,决定使用少量的include目录。
你要为Win64提供食物吗?这将是一个越来越重要的目标。
不要将您的构建中间文件放在签入svn的树下的任何位置。如果您这样做,取决于您的svn客户端工具,它们将生成许多噪音作为不在存储库中的文件。这使得您很难看到您添加的本应在存储库中的文件。
相反,如果你的编译器允许的话,把中间目录放在一边。
否则,请确保将整个中间目录添加到svn排除属性中。一些GUI比其他的( Windows上的Tortoise、Cornerstone或OS/X上的版本)更容易做到这一点。
https://stackoverflow.com/questions/718126
复制相似问题