metaforce/Editor/badging/CMakeLists.txt

44 lines
1.6 KiB
CMake
Raw Normal View History

2017-12-07 04:13:12 +00:00
if(NOT CMAKE_CROSSCOMPILING)
2016-07-16 19:21:12 +00:00
add_executable(packbadge packbadge.c)
2017-12-31 00:56:46 +00:00
find_library(M_LIB m)
2017-12-31 02:44:18 +00:00
if(NOT M_LIB)
unset(M_LIB CACHE)
endif()
2017-12-31 00:56:46 +00:00
target_link_libraries(packbadge ${PNG_LIB} ${ZLIB_LIBRARIES} ${M_LIB})
target_include_directories(packbadge PRIVATE ${LIBPNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR})
2016-07-16 19:21:12 +00:00
2017-12-07 04:13:12 +00:00
##################
# Package Export #
##################
# Add all targets to the build-tree export set
export(TARGETS packbadge FILE "${CMAKE_CURRENT_BINARY_DIR}/urde-packbadgeTargets.cmake")
# Export the package for use from the build-tree
# (this registers the build-tree with a global CMake-registry)
export(PACKAGE urde-packbadge)
# Create the atdnaConfig.cmake
# ... for the build tree
configure_file(urde-packbadgeConfig.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/urde-packbadgeConfig.cmake" @ONLY)
# ... for the install tree
configure_file(urde-packbadgeConfig.cmake.in "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/urde-packbadgeConfig.cmake" @ONLY)
# ... for both
configure_file(urde-packbadgeConfigVersion.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/urde-packbadgeConfigVersion.cmake" @ONLY)
else()
find_package(urde-packbadge REQUIRED)
endif()
2016-07-16 19:21:12 +00:00
add_custom_command(OUTPUT badge.bin COMMAND $<TARGET_FILE:packbadge>
ARGS ${CMAKE_CURRENT_SOURCE_DIR}/badge.png
${CMAKE_CURRENT_BINARY_DIR}/badge.bin
MAIN_DEPENDENCY badge.png COMMENT "Generating badge.bin")
2017-12-29 08:08:12 +00:00
bintoc(badge.cpp ${CMAKE_CURRENT_BINARY_DIR}/badge.bin URDE_BADGE)
2016-07-16 19:21:12 +00:00
add_library(UrdeBadging
2017-12-29 08:08:12 +00:00
badge.cpp badge.bin
2016-07-16 19:21:12 +00:00
Badging.hpp Badging.cpp)
target_link_libraries(UrdeBadging PUBLIC specter)