SLikeSoft / SLikeNet

SLikeNet™ is an Open Source/Free Software cross-platform network engine written in C++ and specifially designed for games (and applications which have comparable requirements on a network engine like games) building upon the discontinued RakNet network engine which had more than 13 years of active development.
https://www.slikenet.com/
Other
395 stars 62 forks source link

Added gitignore for top-level 'build' directory since this is fairly … #50

Closed BrodyHiggerson closed 5 years ago

BrodyHiggerson commented 5 years ago

…common practice in CMake

This allows a new user to simply

mkdir build
cd build
cmake .. -G "Visual Studio Win64"

and not have any files tracked by git.

Luke1410 commented 5 years ago

As far as I'm aware, best practice suggestions to use cmake with projects is to keep the cmake directory outside the source directory. I.e. assume you put the SLikeNet source under [userpath]/slikenet/src. In this case you would put the cmake directory in [userpath]/slikenet/cmake and run cmake from within [userpath]/slikenet/cmake with: cmake ../src As an example, see the example given in the official documentation here: https://cmake.org/cmake/help/v3.15/manual/cmake.1.html

Unfortunately, there are a lot of webpages and cmake tutorials out there which don't follow this suggested practice. Whether this started because people got the documentation wrong or whether it was an intended approach, I certainly don't know. Personally, I'm having difficulties seeing any advantage of putting the cmake build files into the source directory path of a project. As you stated this practice is quite widespread, so I don't see much harm to support this approach by adding the build directory to the Git and SVN ignore lists as per your suggestion.

The changes are expected to be deployed with SLikeNet 0.2.0. (internal case number: SLNET-130)