I have got SDL2_image library installed on /usr/include/SDL2 (in this directory I can find SDL_image.h).
When I compile with CLion all works fine but, in the editor, either include and functions of SDL2_image librarie appear with error (this library is found by the compiler but It is not found by the editor).
This is my CMake:
cmake_minimum_required(VERSION 3.2)
project(sdl)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(SOURCE_FILES main.cpp)
add_executable(sdl ${SOURCE_FILES} Game.cpp Game.h)
INCLUDE(FindPkgConfig)
PKG_SEARCH_MODULE(SDL2 REQUIRED sdl2)
PKG_SEARCH_MODULE(SDL2IMAGE REQUIRED SDL2_image>=2.0.0)
INCLUDE_DIRECTORIES(${SDL2_INCLUDE_DIRS} ${SDL2IMAGE_INCLUDE_DIRS})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${SDL2_LIBRARIES} ${SDL2IMAGE_LIBRARIES})
add_custom_command(TARGET sdl POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/assets
$<TARGET_FILE_DIR:sdl>/assets)
What is the problem?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire