aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Ramos <juan@lunarg.com>2022-12-27 15:17:57 -0700
committerJuan Ramos <114601453+juan-lunarg@users.noreply.github.com>2022-12-27 16:20:32 -0700
commitcd0f8517cc6d0d3911917ec4e7f67c599ec66bcf (patch)
tree9acfc428502142a93da4fa30b8609378a8fa5b8c
parentbc40543f2c4658918498f1ef415650ccf8ccaa01 (diff)
downloadusermoji-cd0f8517cc6d0d3911917ec4e7f67c599ec66bcf.tar.xz
cmake: Use PkgConfig to find DirectFB
-rw-r--r--cmake/FindDirectFB.cmake28
-rw-r--r--cube/CMakeLists.txt6
-rw-r--r--vulkaninfo/CMakeLists.txt5
3 files changed, 4 insertions, 35 deletions
diff --git a/cmake/FindDirectFB.cmake b/cmake/FindDirectFB.cmake
deleted file mode 100644
index 2c98b2ac..00000000
--- a/cmake/FindDirectFB.cmake
+++ /dev/null
@@ -1,28 +0,0 @@
-# Try to find DirectFB
-#
-# This will define:
-#
-# DIRECTFB_FOUND - True if DirectFB is found
-# DIRECTFB_LIBRARIES - Link these to use DirectFB
-# DIRECTFB_INCLUDE_DIR - Include directory for DirectFB
-# DIRECTFB_DEFINITIONS - Compiler flags for using DirectFB
-#
-# Redistribution and use is allowed according to the terms of the BSD license.
-# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
-
-IF (NOT WIN32)
- FIND_PACKAGE(PkgConfig)
- PKG_CHECK_MODULES(PKG_DIRECTFB QUIET directfb)
-
- SET(DIRECTFB_DEFINITIONS ${PKG_DIRECTFB_CFLAGS})
-
- FIND_PATH(DIRECTFB_INCLUDE_DIR NAMES directfb.h HINTS ${PKG_DIRECTFB_INCLUDE_DIRS})
-
- FIND_LIBRARY(DIRECTFB_LIBRARIES NAMES directfb HINTS ${PKG_DIRECTFB_LIBRARY_DIRS})
-
- include(FindPackageHandleStandardArgs)
-
- FIND_PACKAGE_HANDLE_STANDARD_ARGS(DIRECTFB DEFAULT_MSG DIRECTFB_LIBRARIES DIRECTFB_INCLUDE_DIR)
-
- MARK_AS_ADVANCED(DIRECTFB_INCLUDE_DIR DIRECTFB_LIBRARIES)
-ENDIF ()
diff --git a/cube/CMakeLists.txt b/cube/CMakeLists.txt
index e96b359a..a2f026e7 100644
--- a/cube/CMakeLists.txt
+++ b/cube/CMakeLists.txt
@@ -108,8 +108,7 @@ if(UNIX AND NOT APPLE) # i.e. Linux
endif()
if(BUILD_WSI_DIRECTFB_SUPPORT)
- find_package(DirectFB REQUIRED)
- include_directories(${DIRECTFB_INCLUDE_DIR})
+ pkg_check_modules(DirectFB REQUIRED QUIET IMPORTED_TARGET directfb)
endif()
endif()
@@ -161,8 +160,7 @@ elseif(UNIX AND NOT APPLE) # i.e. Linux
if(NOT BUILD_WSI_DIRECTFB_SUPPORT)
message(FATAL_ERROR "Selected DIRECTFB for vkcube build but not building DirectFB support")
endif()
- set(CUBE_INCLUDE_DIRS ${DIRECTFB_INCLUDE_DIR} ${CUBE_INCLUDE_DIRS})
- link_libraries(${DIRECTFB_LIBRARIES})
+ link_libraries(PkgConfig::DirectFB)
set(CUBE_PLATFORM VK_USE_PLATFORM_DIRECTFB_EXT)
elseif(CUBE_WSI_SELECTION STREQUAL "DISPLAY")
set(CUBE_PLATFORM VK_USE_PLATFORM_DISPLAY_KHR)
diff --git a/vulkaninfo/CMakeLists.txt b/vulkaninfo/CMakeLists.txt
index 70e2da4e..88be7a19 100644
--- a/vulkaninfo/CMakeLists.txt
+++ b/vulkaninfo/CMakeLists.txt
@@ -88,9 +88,8 @@ if(UNIX AND NOT APPLE) # i.e. Linux
endif()
if(BUILD_WSI_DIRECTFB_SUPPORT)
- find_package(DirectFB REQUIRED)
- target_include_directories(vulkaninfo PRIVATE ${DIRECTFB_INCLUDE_DIR})
- target_link_libraries(vulkaninfo ${DIRECTFB_LIBRARIES})
+ pkg_check_modules(DirectFB REQUIRED QUIET IMPORTED_TARGET directfb)
+ target_link_libraries(vulkaninfo PkgConfig::DirectFB)
target_compile_definitions(vulkaninfo PRIVATE -DVK_USE_PLATFORM_DIRECTFB_EXT -DVK_NO_PROTOTYPES)
endif()
endif()