Skip to content

Commit e9c956a

Browse files
Documentation updated
1 parent ba15c0a commit e9c956a

File tree

2 files changed

+108
-0
lines changed

2 files changed

+108
-0
lines changed

README.md

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,111 @@ int main(void)
5353
return -1;
5454
}
5555
```
56+
57+
# Build and connect to your project
58+
59+
Typical commands to build **SimpleFileDialog** library:
60+
61+
```bash
62+
git clone https://github.com/ConstantRobotics-Ltd/SimpleFileDialog.git
63+
cd SimpleFileDialog
64+
mkdir build
65+
cd build
66+
cmake ..
67+
make
68+
```
69+
70+
If you want connect **SimpleFileDialog** library to your CMake project as source code you can make follow. For example, if your repository has structure:
71+
72+
```bash
73+
CMakeLists.txt
74+
src
75+
CMakeList.txt
76+
yourLib.h
77+
yourLib.cpp
78+
```
79+
80+
You can add repository **SimpleFileDialog** as submodule by commands:
81+
82+
```bash
83+
cd <your respository folder>
84+
git submodule add https://github.com/ConstantRobotics-Ltd/SimpleFileDialog.git 3rdparty/SimpleFileDialog
85+
```
86+
87+
In you repository folder will be created folder **3rdparty/SimpleFileDialog** which contains all library files. New structure of your repository:
88+
89+
```bash
90+
CMakeLists.txt
91+
src
92+
CMakeList.txt
93+
yourLib.h
94+
yourLib.cpp
95+
3rdparty
96+
SimpleFileDialog
97+
```
98+
99+
Create CMakeLists.txt file in **3rdparty** folder. CMakeLists.txt should contain:
100+
101+
```cmake
102+
cmake_minimum_required(VERSION 3.13)
103+
104+
################################################################################
105+
## 3RD-PARTY
106+
## dependencies for the project
107+
################################################################################
108+
project(3rdparty LANGUAGES CXX)
109+
110+
################################################################################
111+
## SETTINGS
112+
## basic 3rd-party settings before use
113+
################################################################################
114+
# To inherit the top-level architecture when the project is used as a submodule.
115+
SET(PARENT ${PARENT}_YOUR_PROJECT_3RDPARTY)
116+
# Disable self-overwriting of parameters inside included subdirectories.
117+
SET(${PARENT}_SUBMODULE_CACHE_OVERWRITE OFF CACHE BOOL "" FORCE)
118+
119+
################################################################################
120+
## CONFIGURATION
121+
## 3rd-party submodules configuration
122+
################################################################################
123+
SET(${PARENT}_SUBMODULE_SIMPLE_FILE_DIALOG ON CACHE BOOL "" FORCE)
124+
if (${PARENT}_SUBMODULE_SIMPLE_FILE_DIALOG)
125+
SET(${PARENT}_SIMPLE_FILE_DIALOG ON CACHE BOOL "" FORCE)
126+
SET(${PARENT}_SIMPLE_FILE_DIALOG_TEST OFF CACHE BOOL "" FORCE)
127+
endif()
128+
129+
################################################################################
130+
## INCLUDING SUBDIRECTORIES
131+
## Adding subdirectories according to the 3rd-party configuration
132+
################################################################################
133+
if (${PARENT}_SUBMODULE_SIMPLE_FILE_DIALOG)
134+
add_subdirectory(SimpleFileDialog)
135+
endif()
136+
```
137+
138+
File **3rdparty/CMakeLists.txt** adds folder **SimpleFileDialog** to your project and excludes test application (SimpleFileDialog class test applications) from compiling. Your repository new structure will be:
139+
140+
```bash
141+
CMakeLists.txt
142+
src
143+
CMakeList.txt
144+
yourLib.h
145+
yourLib.cpp
146+
3rdparty
147+
CMakeLists.txt
148+
SimpleFileDialog
149+
```
150+
151+
Next you need include folder 3rdparty in main **CMakeLists.txt** file of your repository. Add string at the end of your main **CMakeLists.txt**:
152+
153+
```cmake
154+
add_subdirectory(3rdparty)
155+
```
156+
157+
Next you have to include SimpleFileDialog library in your **src/CMakeLists.txt** file:
158+
159+
```cmake
160+
target_link_libraries(${PROJECT_NAME} SimpleFileDialog)
161+
```
162+
163+
Done!

SimpleFileDialog_library.pdf

104 KB
Binary file not shown.

0 commit comments

Comments
 (0)