From 208164898b40ebcc33a772d94971cd20b57bdada Mon Sep 17 00:00:00 2001 From: Dmitry Marakasov Date: Fri, 25 Apr 2014 17:45:49 +0400 Subject: [PATCH 1/3] Don't use udev on FreeBSD --- src/SFML/Window/CMakeLists.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/SFML/Window/CMakeLists.txt b/src/SFML/Window/CMakeLists.txt index e1bff7d77..c90639a79 100644 --- a/src/SFML/Window/CMakeLists.txt +++ b/src/SFML/Window/CMakeLists.txt @@ -196,6 +196,8 @@ if(NOT SFML_OPENGL_ES) message(FATAL_ERROR "Xrandr library not found") endif() include_directories(${X11_INCLUDE_DIR}) + endif() + if(SFML_OS_LINUX) find_package(UDev REQUIRED) if(NOT UDEV_FOUND) message(FATAL_ERROR "udev library not found") @@ -212,11 +214,10 @@ endif() # build the list of external libraries to link if(SFML_OS_WINDOWS) list(APPEND WINDOW_EXT_LIBS winmm gdi32) -elseif(SFML_OS_LINUX OR SFML_OS_FREEBSD) +elseif(SFML_OS_LINUX) list(APPEND WINDOW_EXT_LIBS ${X11_X11_LIB} ${X11_Xrandr_LIB} ${UDEV_LIBRARIES}) - if(SFML_OS_FREEBSD) - list(APPEND WINDOW_EXT_LIBS usbhid) - endif() +elseif(SFML_OS_FREEBSD) + list(APPEND WINDOW_EXT_LIBS ${X11_X11_LIB} ${X11_Xrandr_LIB} usbhid) elseif(SFML_OS_MACOSX) list(APPEND WINDOW_EXT_LIBS "-framework Foundation -framework AppKit -framework IOKit -framework Carbon") elseif(SFML_OS_IOS) From f1431e416cb7d0a8d3858f80ff12f0d8bb1225d4 Mon Sep 17 00:00:00 2001 From: Dmitry Marakasov Date: Fri, 25 Apr 2014 17:46:15 +0400 Subject: [PATCH 2/3] Use common unix sensor implementation on FreeBSD --- src/SFML/Window/SensorImpl.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SFML/Window/SensorImpl.hpp b/src/SFML/Window/SensorImpl.hpp index d111ad2b2..40f266fcc 100644 --- a/src/SFML/Window/SensorImpl.hpp +++ b/src/SFML/Window/SensorImpl.hpp @@ -35,7 +35,7 @@ #include -#elif defined(SFML_SYSTEM_LINUX) +#elif defined(SFML_SYSTEM_LINUX) || defined(SFML_SYSTEM_FREEBSD) #include From 27eadf2a7c8249f87b925f10ad8c73e32c437e9f Mon Sep 17 00:00:00 2001 From: Dmitry Marakasov Date: Fri, 25 Apr 2014 17:52:55 +0400 Subject: [PATCH 3/3] Properly handle pkgconfig files on FreeBSD --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 928b4be50..006a715a0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -165,6 +165,10 @@ if(SFML_OS_MACOSX) endif() if(SFML_OS_LINUX OR SFML_OS_FREEBSD) + set(PKGCONFIG_DIR lib${LIB_SUFFIX}/pkgconfig) + if(SFML_OS_FREEBSD) + set(PKGCONFIG_DIR libdata/pkgconfig) + endif() if(BUILD_SHARED_LIBS) sfml_set_option(SFML_INSTALL_PKGCONFIG_FILES FALSE BOOL "TRUE to automatically install pkg-config files so other projects can find SFML") if(SFML_INSTALL_PKGCONFIG_FILES) @@ -174,7 +178,7 @@ if(SFML_OS_LINUX OR SFML_OS_FREEBSD) "tools/pkg-config/sfml-${sfml_module}.pc" @ONLY) INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/tools/pkg-config/sfml-${sfml_module}.pc" - DESTINATION "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/pkgconfig") + DESTINATION "${CMAKE_INSTALL_PREFIX}/${PKGCONFIG_DIR}") endforeach() endif() else()