Tôi sắp bắt đầu làm việc trên một thư viện đa nền tảng được viết bằng C++. Xuống đường, tôi dự định triển khai các ràng buộc cho các ngôn ngữ khác như Python, Java, vv Thư viện cần có sẵn trên các nền tảng chính: win32, Linux và Mac OSX.Cấu trúc thư mục tốt nhất cho thư viện đa nền tảng C++ và các ràng buộc
Mặc dù ứng dụng thực sự là một thư viện, một số chương trình điều khiển cơ bản sẽ được nhóm cùng với nó để trình diễn và thử nghiệm.
Tôi muốn tìm ra cấu trúc thư mục tối ưu trước khi tôi bắt đầu lưu trữ nội dung trong Subversion.
Tôi đang nghĩ đến một cái gì đó như:
/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
Nếu bạn có gợi ý, tôi muốn nghe họ. Tôi tự hỏi nếu có một công cụ có thể giúp tạo ra cấu trúc này.
Tôi đang lên kế hoạch sử dụng CMake và Subversion.
Tôi có một câu hỏi cho bạn: vì nó là một lib, main.cpp là gì và làm thế nào điều này sẽ được sử dụng bởi người khác? Tôi đang đối mặt với câu hỏi ATM, và tôi nghĩ main.cpp thực sự là một thử nghiệm của lib. Không phải nó? –
Tôi có một câu trả lời liên quan ở đây: [Tốt nhất (sạch) cách để viết mã nền tảng cụ thể] (https://stackoverflow.com/a/32685299/3258851) –