Skip to content

Commit

Permalink
Merge pull request #7 from danlangford/file-organization
Browse files Browse the repository at this point in the history
new dir structure idea
  • Loading branch information
pappde committed Feb 21, 2021
2 parents 2b98384 + b33ad19 commit 15aba3c
Show file tree
Hide file tree
Showing 17 changed files with 27 additions and 2 deletions.
25 changes: 25 additions & 0 deletions BUILDING.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
The project leverages CMake, a cross-platform build management tool.
Most popular IDEs, like CLion and Visual Studio, understand and support CMake based projects.

The C++ project structure I have chosen to follow is detailed on [Project Heuristics](https://medium.com/heuristics/c-application-development-part-1-project-structure-454b00f9eddc).
The C++ convention for CMake builds is what is called an "out of source" build, meaning you give room for your build to generate artifacts that dont clutter your source directories.
The `.gitignore` has been tuned for out of source builds to happen in the `./build/` dir.

Consider using a pattern like the one below for your builds should you want to build the project in a non-IDE, command line way.

*nix environments
```sh
mkdir -p build
cd build
cmake ..
make
```

windows ms visual studio environments
```sh
\path\to\VsDevCmd.bat
mkdir build
cd build
cmake ..
devenv bmai.sln /build
```
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ project(bmai)
set(CMAKE_CXX_STANDARD 14)

# to be able to reference header files
include_directories(.)
include_directories(./src)

# to collect only needed source files
set(SOURCE bmai.cpp bmai_ai.cpp bmai_player.cpp)
set(SOURCE ./src/bmai.cpp ./src/bmai_ai.cpp ./src/bmai_player.cpp)

add_executable(${PROJECT_NAME} ${SOURCE})
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 15aba3c

Please sign in to comment.