kroyee / SpeedBlocks

Fast paced tetris game cloned from Cultris II
GNU Lesser General Public License v3.0
11 stars 7 forks source link

[Discussion] Configuration files in the repo #26

Closed kroyee closed 7 years ago

kroyee commented 7 years ago

Would like some feedback on my comment in #23. I would like to move the makefile and and this to the wiki instead of in the repository.

kb1900 commented 7 years ago

yes a new branch or just a new instruction guide in the wiki sounds appropriate for it

kroyee commented 7 years ago

A new branch is not really an option. Then it's much better and cleaner to keep it in a separate repository. Branches are only useful if they intend to merge back together at some point.

texus commented 7 years ago

Ideally you would use a cross-platform build system like cmake or scons instead of a makefile and a visual studio project. Otherwise you would have to keep both the makefile and the VS project up to date when e.g. adding new files. It would also allow you to have a define like SFML_NO_DEPRECATED_WARNINGS across the entire project instead of having to define it in multiple places in the code or having to implement the define in every different type of project (makefile and VS project).

Of course the ideal solution is not necessarily the best as it adds extra work to implement and test it. If you are only going to need a makefile and a VS project and don't care about other types (e.g. xcode on mac) then it is probably less work to just maintain these two types. Instead of putting it in a different repo I would suggest just putting it in a build folder (which either contains the VS project directly or it has a subdirectory for the makefile and a subdirectory for VS).

Putting it on the wiki is also an option but it would probably be nicer if the files are already in the repo and the wiki just explains how to use these files.

kroyee commented 7 years ago

Hopefully some people using Mac will join in. I will look into making a Cmake setup.

rmcat commented 7 years ago

Agree with using a cross-platform build system. Cmake sounds good.

kroyee commented 7 years ago

Will take a bit of reading and testing before I can get a Cmake setup in place. I'll merge in #26 and put Cmake on the TODO list. If anyone feels inspired, please have a a go at it.

texus commented 7 years ago

If it helps, here is a minimal cmake example that you will need for a project using SFML and TGUI (you will probably have to add a couple of lines, but this can be a good starting point for CMakeLists.txt)

cmake_minimum_required(VERSION 2.8)

project(Game)

set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/Modules")
set(CMAKE_CXX_FLAGS "-std=c++11 -Wall -Wextra -pedantic")
set(CMAKE_BUILD_TYPE "Release")

file(GLOB SRC "*.cpp")

find_package(SFML 2 COMPONENTS audio network graphics window system REQUIRED)
find_package(TGUI 0.7 REQUIRED)

add_executable(Game ${SRC})
target_link_libraries(Game ${SFML_LIBRARIES} ${TGUI_LIBRARY})

install(TARGETS Game DESTINATION ${PROJECT_SOURCE_DIR})

You need the SFML/cmake/Modules/FindSFML.cmake and TGUI/cmake/Modules/FindTGUI.cmake inside your own project. The CMAKE_MODULE_PATH refers to this folder where these files can be found.

Noir- commented 7 years ago

I just startet using JetBrains CLion. (I used some other JetBrains products in the past and were very satisfied.) It seems that they have good cmake support which kind of helps getting started. I'll try to assemble a working cmake script.

Noir- commented 7 years ago

I created a pull request #43 for basic cmake functionality.