1
Window / Re: SFML Bad Window on Raspberry PI with CMake
« on: August 25, 2015, 11:10:27 am »
I used the FindSFML module to detect SFML (I took the module from the TGUI repo). It was the source of the bug. I solved the problem by doing the library linking directly :
But you need to have SFML installed system wide.
I am running SFML on RPI 2 with Raspbian
I builded SFML from source and installed it.
cmake_minimum_required(VERSION 2.6)
project(Brain C CXX)
# Fichier de sortie
set(EXECUTABLE_OUTPUT_PATH build/${CMAKE_BUILD_TYPE})
set(LIBRARY_OUTPUT_PATH lib/${CMAKE_BUILD_TYPE})
# Compiling in C++11. Settings compiler flags.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -g")
# Detect Libs
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMake/Modules" ${CMAKE_MODULE_PATH})
set(SOURCES
main.cpp
)
add_executable(sfml-app ${SOURCES})
target_link_libraries(sfml-app
sfml-system
sfml-window
sfml-graphics)
project(Brain C CXX)
# Fichier de sortie
set(EXECUTABLE_OUTPUT_PATH build/${CMAKE_BUILD_TYPE})
set(LIBRARY_OUTPUT_PATH lib/${CMAKE_BUILD_TYPE})
# Compiling in C++11. Settings compiler flags.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -g")
# Detect Libs
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMake/Modules" ${CMAKE_MODULE_PATH})
set(SOURCES
main.cpp
)
add_executable(sfml-app ${SOURCES})
target_link_libraries(sfml-app
sfml-system
sfml-window
sfml-graphics)
But you need to have SFML installed system wide.
I am running SFML on RPI 2 with Raspbian
I builded SFML from source and installed it.