Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Aidymouse

Pages: [1]
1
General / Re: Cmake building SFML 3.0 with WSL2
« on: Today at 10:51:03 am »
Alright, the problem is that I'm really dumb. I had to install the package it said was missing
Code: [Select]
sudo apt get libxi-dev
and set display to 0
Code: [Select]
export DISPLAY=:0
and then it worked.

2
General / Cmake building SFML 3.0 with WSL2
« on: December 22, 2024, 12:54:33 pm »
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

Code: [Select]
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
Code: [Select]
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



Pages: [1]
anything