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

Author Topic: SFML CMake Windows  (Read 2325 times)

0 Members and 1 Guest are viewing this topic.

Zeus-Ammon

  • Newbie
  • *
  • Posts: 3
    • View Profile
SFML CMake Windows
« on: March 14, 2020, 05:29:22 pm »
Hi,

Im using SFML as a base to build another library on top. Until now I have been working on Linux with cmake (SFML from repositories) and i've been able to build my library with this simple CMakeLists.txt:

cmake_minimum_required(VERSION 3.5)
project(my-lib)

find_library(SYS sfml-system)
find_library(GRAPHICS sfml-graphics)
find_library(WINDOW sfml-window)

add_library(
    my-lib
    SHARED
    source files .....
)

target_include_directories(my-lib PUBLIC ${PROJECT_SOURCE_DIR})
target_link_libraries(my-lib "${SYS}" "${GRAPHICS}" "${WINDOW}")
 

This generates my-lib.so which is exactly what I need to use elsewhere.

On Windows "find_library()" does not seem to find the libraries even after I have compiled SFML from source with nmake and running nmake install which installed SFML on Program Files.

Any help would be immensly appreciated.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: SFML CMake Windows
« Reply #1 on: March 15, 2020, 09:23:50 am »
That's not how you're supposed to find SFML. Please read this: https://en.sfml-dev.org/forums/index.php?topic=24070.0
Laurent Gomila - SFML developer