Created
September 20, 2024 18:53
-
-
Save loopj/80b4aabc452197ecf889437e3ee21651 to your computer and use it in GitHub Desktop.
Reusable interface library target for GRRLIB which includes dependencies and compile flags
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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