mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-29 17:28:42 +00:00
main features:
- No more sdl-build-options/sdl-shared-build-options/sdl-global-options
- Dependency information is stored on SDL3-collector for sdl3.pc
- Use helper functions to modify the SDL targets;
- sdl_sources to add sources
- sdl_glob_sources to add glob soruces
- sdl_link_dependency to add a link dependency that might also
appear in sdl3.pc/SDL3Config.cmake
- sdl_compile_definitions to add macro's
- sdl_compile_options for compile options
- sdl_include_directories for include directories
They avoid repeated checks for existence of the SDL targets
- A nice feature of the previous is the ability to generate
a sdl3.pc or SDL3Config.cmake that describes its dependencies
accurately.
various:
- remove duplicate libc symbol list
- add CheckVulkan
- remove unused HAVE_MPROTECT
- add checks for getpagesize
75 lines
2.5 KiB
CMake
75 lines
2.5 KiB
CMake
include(FeatureSummary)
|
|
set_package_properties(RPi_BcmHost PROPERTIES
|
|
URL "https://github.com/raspberrypi/firmware"
|
|
DESCRIPTION "Broadcom VideoCore host API library"
|
|
)
|
|
|
|
set(RPi_BcmHost_PKG_CONFIG_SPEC bcm_host)
|
|
|
|
find_package(PkgConfig QUIET)
|
|
pkg_check_modules(PC_RPi_BcmHost QUIET ${RPi_BcmHost_PKG_CONFIG_SPEC})
|
|
|
|
find_library(RPi_BcmHost_bcm_host_LIBRARY
|
|
NAMES bcm_host
|
|
HINTS
|
|
${PC_RPi_BcmHost_LIBRARY_DIRS}
|
|
/opt/vc/lib
|
|
)
|
|
|
|
find_path(RPi_BcmHost_bcm_host_h_PATH
|
|
NAMES bcm_host.h
|
|
HINTS
|
|
${PC_RPi_BcmHost_INCLUDE_DIRS}
|
|
/opt/vc/include
|
|
)
|
|
|
|
if(PC_RPi_BcmHost_FOUND)
|
|
include("${CMAKE_CURRENT_LIST_DIR}/PkgConfigHelper.cmake")
|
|
get_flags_from_pkg_config("${RPi_BcmHost_bcm_host_LIBRARY}" "PC_RPi_BcmHost" "_RPi_BcmHost")
|
|
else()
|
|
set(_RPi_BcmHost_include_dirs
|
|
/opt/vc/include
|
|
/opt/vc/include/interface/vcos/pthreads
|
|
/opt/vc/include/interface/vmcs_host/linux
|
|
)
|
|
set(_RPi_BcmHost_compile_options
|
|
-DUSE_VCHIQ_ARM
|
|
)
|
|
set(_RPi_BcmHost_link_libraries
|
|
-lvcos -lvchiq_arm
|
|
)
|
|
set(_RPi_BcmHost_link_options
|
|
-pthread
|
|
)
|
|
set(_RPi_BcmHost_link_directories
|
|
/opt/vc/lib
|
|
)
|
|
endif()
|
|
|
|
set(RPi_BcmHost_INCLUDE_DIRS "${_RPi_BcmHost_include_dirs}" CACHE STRING "Extra include dirs of bcm_host")
|
|
|
|
set(RPi_BcmHost_COMPILE_OPTIONS "${_RPi_BcmHost_compile_options}" CACHE STRING "Extra compile options of bcm_host")
|
|
|
|
set(RPi_BcmHost_LINK_LIBRARIES "${_RPi_BcmHost_link_libraries}" CACHE STRING "Extra link libraries of bcm_host")
|
|
|
|
set(RPi_BcmHost_LINK_OPTIONS "${_RPi_BcmHost_link_options}" CACHE STRING "Extra link flags of bcm_host")
|
|
|
|
set(RPi_BcmHost_LINK_DIRECTORIES "${_RPi_BcmHost_link_directories}" CACHE PATH "Extra link directories of bcm_host")
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
find_package_handle_standard_args(RPi_BcmHost
|
|
REQUIRED_VARS RPi_BcmHost_bcm_host_LIBRARY RPi_BcmHost_bcm_host_h_PATH
|
|
)
|
|
|
|
if(RPi_BcmHost_FOUND)
|
|
if(NOT TARGET RPi_BcmHost::RPi_BcmHost)
|
|
add_library(RPi_BcmHost::RPi_BcmHost INTERFACE IMPORTED)
|
|
set_target_properties(RPi_BcmHost::RPi_BcmHost PROPERTIES
|
|
INTERFACE_INCLUDE_DIRECTORIES "${RPi_BcmHost_INCLUDE_DIRS}"
|
|
INTERFACE_COMPILE_OPTIONS "${RPi_BcmHost_COMPILE_OPTIONS}"
|
|
INTERFACE_LINK_LIBRARIES "${RPi_BcmHost_LINK_LIBRARIES}"
|
|
INTERFACE_LINK_OPTIONS "${RPi_BcmHost_LINK_OPTIONS}"
|
|
INTERFACE_LINK_DIRECTORIES "${RPi_BcmHost_LINK_DIRECTORIES}"
|
|
)
|
|
endif()
|
|
endif()
|