kroyee / SpeedBlocks

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

Updated CMakeLists.txt for MinGW #54

Closed rmcat closed 7 years ago

rmcat commented 7 years ago

Got MinGW Makefiles generator for CMake to work with MinGW-w64 6.1.0. I added a Windows condition

if (WIN32)
    include_directories(${SFML_INCLUDE_DIR} ${TGUI_INCLUDE_DIR} ${BOOST_ROOT})
endif()

to allow the Boost directory to be specified. Would be great if someone could test on Linux to verify nothing has been broken.

kroyee commented 7 years ago

Tested and confirmed working on my system.

kroyee commented 7 years ago

boost, is actually needed on linux systems also. not the lexical_cast but boost/random is used, so I think you could even remove the if (WIN32) and keep the boost for all systems.

rmcat commented 7 years ago

I wasn't sure how this was built on Linux since Boost was not in the CMakeLists file. How did you and @Noir- specify boost before?

kroyee commented 7 years ago

It was probably just missed. Since I have boost installed from the package manager I'm guessing it ($BOOST_ROOT) is already set on my system. Same might go for @Noir- When I saw it in your update I realized it should probably be specified in the linux version aswell.

kroyee commented 7 years ago

Or maybe I'm missing something.

kroyee commented 7 years ago

Sorry, getting a bit confused by myself here. More correctly $BOOST_ROOT is not set, but since it's installed in my standard system include dir things compile and run as they should anyway.

kroyee commented 7 years ago

I'll just merge this in for now. We can keep updating it as we go. While reading around I also found that there is a FindBoost.cmake that's installed with Cmake as default. So

find_package( Boost 1.58.0 )
if(Boost_FOUND)
   include_directories(${Boost_INCLUDE_DIRS})
endif()

or something along those lines should also be an option.