Bonjour,
J'essaye d'installer SFML sur CLion en utilisant CMake mais je ne m'y connais pas trop.
J'ai essayé plusieurs tuto sur internet, mais ça ne marche toujours pas.
Voici le retour du terminal lorsque je charge la config CMake :
CMake Warning (dev) at CMakeLists.txt:21 (find_package):
Policy CMP0074 is not set: find_package uses <PackageName>_ROOT variables.
Run "cmake --help-policy CMP0074" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
CMake variable SFML_ROOT is set to:
[dir]/SFML
For compatibility, CMake is ignoring the variable.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Error at cmake_modules/FindSFML.cmake:355 (message):
SFML found but some of its dependencies are missing ( libjpeg)
Call Stack (most recent call first):
CMakeLists.txt:21 (find_package)
-- Configuring incomplete, errors occurred!
See also "[dir]/CLionSFML-master/cmake-build-debug/CMakeFiles/CMakeOutput.log".
[Finished]
([dir]/SFML => le dossier qui contient ma librairie SFML, téléchargé sur sfml-dev.org, la version MinGW 32 bit
[dir]/CLionSFML-master => mon projet CLion)
Voici le code de mon CMakeLists.txt :
cmake_minimum_required(VERSION 3.7)
set(PROJECT_NAME CLionSFML-master)
project(${PROJECT_NAME})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -static")
set(CMAKE_CXX_STANDARD 14)
set(SOURCE_FILES main.cpp)
if (CMAKE_BUILD_TYPE STREQUAL "Release")
add_executable(${PROJECT_NAME} WIN32 ${SOURCE_FILES})
else ()
add_executable(${PROJECT_NAME} ${SOURCE_FILES})
endif ()
set(SFML_ROOT [dir]/SFML)
set(SFML_STATIC_LIBRARIES TRUE)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake_modules")
find_package(SFML 2 REQUIRED COMPONENTS audio graphics window system)
if (SFML_FOUND)
include_directories(${SFML_INCLUDE_DIR})
target_link_libraries(${PROJECT_NAME} ${SFML_LIBRARIES} ${SFML_DEPENDENCIES})
endif ()
Pour info, j'utilise CLion 2019.2.3, avec MinGW en compilateur.
Merci par avance pour votre aide !