Oh! My bad, sorry!
find_package(SFML 2 COMPONENTS system window graphics network audio)
Hm... But my problem still actual:
18:56:56: Выполняются этапы для проекта ECS_GameEngine...
18:56:56: Запускается: «/usr/bin/cmake» --build . --target all
Linking CXX executable /home/saitei/Projects/ECS_GameEngine/bin/ECS_GameEngine
CMakeFiles/ECS_GameEngine.dir/main.cpp.o: In function `main':
main.cpp:(.text.startup+0x4b): undefined reference to `sf::String::String(char const*, std::locale const&)'
main.cpp:(.text.startup+0x64): undefined reference to `sf::VideoMode::VideoMode(unsigned int, unsigned int, unsigned int)'
main.cpp:(.text.startup+0x87): undefined reference to `sf::Window::Window(sf::VideoMode, sf::String const&, unsigned int, sf::ContextSettings const&)'
main.cpp:(.text.startup+0xae): undefined reference to `sf::Window::isOpen() const'
main.cpp:(.text.startup+0xd3): undefined reference to `sf::Window::pollEvent(sf::Event&)'
main.cpp:(.text.startup+0xe1): undefined reference to `sf::Window::display()'
main.cpp:(.text.startup+0xf6): undefined reference to `sf::Window::close()'
main.cpp:(.text.startup+0x102): undefined reference to `sf::Window::~Window()'
main.cpp:(.text.startup+0x13d): undefined reference to `sf::Window::~Window()'
collect2: error: ld returned 1 exit status
make[2]: *** [/home/saitei/Projects/ECS_GameEngine/bin/ECS_GameEngine] Error 1
make[1]: *** [CMakeFiles/ECS_GameEngine.dir/all] Error 2
make: *** [all] Error 2
18:56:56: Процесс «/usr/bin/cmake» завершился с кодом 2.
Ошибка при сборке/установке проекта ECS_GameEngine (комплект: Desktop Qt 5.6.0 GCC 64bit)
Во время выполнения этапа «Сборка»
18:56:56: Прошло времени: 00:00.
#include <SFML/Graphics.hpp>
int main(int argc, char* argv[])
{
sf::Window App(sf::VideoMode(800, 600), "myproject");
while (App.isOpen())
{
sf::Event Event;
while (App.pollEvent(Event))
{
if (Event.type == sf::Event::Closed)
App.close();
}
App.display();
}
cmake_minimum_required(VERSION 2.8)
project(ECS_GameEngine)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
set(SRC_LIST ${SRC_LIST} main.cpp entity.h component.cpp system.cpp channel.cpp
gamestate.h engine.h)
set(CMAKE_BINARY_DIR ${CMAKE_SOURCE_DIR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(SFML_ROOT "${CMAKE_BINARY_DIR}/deps/SFML-2.3.2")
set(SFML_STATIC_LIBRARIES TRUE)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_BINARY_DIR}/deps/SFML-2.3.2/cmake/Modules")
find_package(SFML 2 COMPONENTS system window graphics network audio)
include_directories(${SFML_INCLUDE_DIR})
add_executable(${PROJECT_NAME} ${SRC_LIST})
target_link_libraries(${PROJECT_NAME} ${SFML_LIBRARIES} ${SFML_DEPENDENCIES})