mirror of
https://github.com/KingDuckZ/dindexer.git
synced 2025-08-06 13:19:47 +00:00
New page
parent
f996b6389b
commit
1462dccb90
1 changed files with 38 additions and 0 deletions
38
flat_git.md
Normal file
38
flat_git.md
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
# Introduction
|
||||||
|
|
||||||
|
# Usage
|
||||||
|
|
||||||
|
## Example
|
||||||
|
In this example let's say you have one CMake project per git repository, for a total of 3 projects. top_project is the main one, and it depends on libraries sub_1, sub_2. Project sub_1 also depend on sub_2.
|
||||||
|
|
||||||
|
CMakeLists.txt - everything is just the same as usual, except that you use `add_shared_git_project` instead of the regular `add_subdirectory`.
|
||||||
|
```cmake
|
||||||
|
cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
|
||||||
|
project(top_project CXX)
|
||||||
|
include(shared_git_project)
|
||||||
|
add_executable(top_project main.cpp)
|
||||||
|
add_shared_git_project(lib/sub_1)
|
||||||
|
add_shared_git_project(lib/sub_2)
|
||||||
|
```
|
||||||
|
|
||||||
|
lib/sub_1/CMakeLists.txt
|
||||||
|
```cmake
|
||||||
|
project(sub_1)
|
||||||
|
include(shared_git_project)
|
||||||
|
add_library(sub_1 lib1.cpp)
|
||||||
|
add_shared_git_pcoject(lib/sub_2)
|
||||||
|
```
|
||||||
|
|
||||||
|
lib/sub_2/CMakeLists.txt
|
||||||
|
```cmake
|
||||||
|
project(sub_2)
|
||||||
|
add_library(sub_2 lib2.cpp)
|
||||||
|
```
|
||||||
|
|
||||||
|
This will clone the main git repository and the sub_1 and sub_2 directories inside the shared/ directory. After doing this you are good to go!
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/dummy/top_project.git
|
||||||
|
mkdir shared
|
||||||
|
cd top_project.git
|
||||||
|
flat_git ../shared
|
||||||
|
```
|
Loading…
Add table
Add a link
Reference in a new issue