Hi, I'm new to CMake and Make and want to cross compile between Linux and Windows all in one CMakeLists.txt.
I've looked up online on a few tutorials, got some basics down but there's only one problem, on my windows computer I don't have environment path variables setup and that MinGW is on a USB drive. This is how my current CMakeLists.txt looks like.
cmake_minimum_required(VERSION 2.8)
set(PROJECTNAME "Pong")
project(${PROJECTNAME})
aux_source_directory(src/ Sources)
add_executable(bin/${PROJECTNAME} ${Sources})
target_link_libraries(bin/${PROJECTNAME} sfml-graphics sfml-window sfml-system sfml-audio)
include_directories(D:/SFML/include)
So basically what happens is, is that I have to specify my C and CPP compiler which I've already done by doing "cmake -G "MinGW Makefiles" -DCMAKE_C_COMPILER=D:/MinGW/bin/gcc.exe -DCMAKE_CXX_COMPILER=D:/MinGW/bin/g++.exe" But now I have to somehow specify the lib folder too, which I don't know how. I looked at add_library but it was confusing.
Also, this is geared towards the Windows platform. How can I make it so that it has an if statement and sees whether the system is Linux or Windows?
Thanks.
TL:DR: How do you add SFML lib folder to CMakeLists.txt file? How do you check whether the system is Linux or Windows?