Skip to content

Instantly share code, notes, and snippets.

@loopj
Created September 20, 2024 18:53
Show Gist options
  • Save loopj/80b4aabc452197ecf889437e3ee21651 to your computer and use it in GitHub Desktop.
Save loopj/80b4aabc452197ecf889437e3ee21651 to your computer and use it in GitHub Desktop.
Reusable interface library target for GRRLIB which includes dependencies and compile flags
# Reusable interface library target for GRRLIB which includes dependencies and compile flags
set(GRRLIB_TARGET grrlib_interface)
# Include the pkg-config module
find_package(PkgConfig REQUIRED)
pkg_check_modules(GRRLIB REQUIRED freetype2 libpng libjpeg)
# Define the library target
add_library(${GRRLIB_TARGET} INTERFACE)
# Define include directories
target_include_directories(
${GRRLIB_TARGET}
INTERFACE ${GRRLIB_INCLUDE_DIRS} ${DEVKITPRO}/portlibs/${OGC_CONSOLE}/include
)
# Include compile flags from pkg-config
target_compile_options(${GRRLIB_TARGET} INTERFACE ${GRRLIB_CFLAGS_OTHER})
# Define the GRRLIB dependencies
target_link_libraries(${GRRLIB_TARGET} INTERFACE grrlib pngu ${GRRLIB_LIBRARIES})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment