mirror of
https://github.com/bkaradzic/bgfx.cmake.git
synced 2026-02-17 21:12:35 +01:00
42 lines
1.2 KiB
CMake
42 lines
1.2 KiB
CMake
# bgfx.cmake - bgfx building in cmake
|
|
# Written in 2017 by Joshua Brookover <joshua.al.brookover@gmail.com>
|
|
#
|
|
# To the extent possible under law, the author(s) have dedicated all copyright
|
|
# and related and neighboring rights to this software to the public domain
|
|
# worldwide. This software is distributed without any warranty.
|
|
#
|
|
# You should have received a copy of the CC0 Public Domain Dedication along with
|
|
# this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
|
|
|
|
# Ensure the directory exists
|
|
if(NOT IS_DIRECTORY ${BIMG_DIR})
|
|
message(SEND_ERROR "Could not load bimg_decode, directory does not exist. ${BIMG_DIR}")
|
|
return()
|
|
endif()
|
|
|
|
add_library(bimg_decode STATIC)
|
|
|
|
# Put in a "bgfx" folder in Visual Studio
|
|
set_target_properties(bimg_decode PROPERTIES FOLDER "bgfx")
|
|
target_include_directories(
|
|
bimg_decode PUBLIC $<BUILD_INTERFACE:${BIMG_DIR}/include> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
|
PRIVATE ${BIMG_DIR}/3rdparty #
|
|
${MINIZ_INCLUDE_DIR} #
|
|
)
|
|
|
|
file(
|
|
GLOB_RECURSE
|
|
BIMG_DECODE_SOURCES #
|
|
${BIMG_DIR}/include/* #
|
|
${BIMG_DIR}/src/image_decode.* #
|
|
#
|
|
${MINIZ_SOURCES} #
|
|
)
|
|
|
|
target_sources(bimg_decode PRIVATE ${BIMG_DECODE_SOURCES})
|
|
|
|
target_link_libraries(
|
|
bimg_decode PUBLIC bx #
|
|
${MINIZ_LIBRARIES} #
|
|
)
|