Hi all,
Trying to build SFML using Cmake in WSL2 and having some success except that it can't find X11?
I've seen a lot of other posts about getting X11 apps to work, and it's not that. I can get X11 apps to run, but I can't build because it's apparently missing.
My CMakeLists.txt looks like
cmake_minimum_required(VERSION 3.28)
project(EvilPikmin LANGUAGES CXX VERSION 0.0.1)
set(CMAKE_EXPORT_COMPILE_COMMANDS true)
add_executable(EvilPikmin src/main.cpp)
include_directories(include)
add_subdirectory(src)
#SFML
set(SFML_USE_DRM false) # Disables need for X11
#set(EGL_CONTEXT_CLIENT_VERSION 2)
include(FetchContent)
FetchContent_Declare(SFML
GIT_REPOSITORY https://github.com/SFML/SFML.git
GIT_TAG 3.0.0
GIT_SHALLOW ON
EXCLUDE_FROM_ALL
SYSTEM)
FetchContent_MakeAvailable(SFML)
target_link_libraries(EvilPikmin PRIVATE SFML::Graphics)
I'm getting an error like
CMake Error at /snap/cmake/1435/share/cmake-3.31/Modules/FindPackageHandleStandardArgs.cmake:233 (message):
Could NOT find X11 (missing: Xi)
Call Stack (most recent call first):
/snap/cmake/1435/share/cmake-3.31/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE)
/snap/cmake/1435/share/cmake-3.31/Modules/FindX11.cmake:676 (find_package_handle_standard_args)
build/_deps/sfml-src/src/SFML/Window/CMakeLists.txt:279 (find_package)
Any ideas?
Thanks