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()
|
2020-06-12 12:44:33 +00:00
|
|
|
target_link_libraries(packbadge ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} ${M_LIB})
|
2020-06-13 21:24:09 +00:00
|
|
|
target_include_directories(packbadge PRIVATE ${PNG_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
|
2021-04-10 08:42:06 +00:00
|
|
|
export(TARGETS packbadge FILE "${CMAKE_CURRENT_BINARY_DIR}/metaforce-packbadgeTargets.cmake")
|
2017-12-07 04:13:12 +00:00
|
|
|
|
|
|
|
# Export the package for use from the build-tree
|
|
|
|
# (this registers the build-tree with a global CMake-registry)
|
2021-04-10 08:42:06 +00:00
|
|
|
export(PACKAGE metaforce-packbadge)
|
2017-12-07 04:13:12 +00:00
|
|
|
|
|
|
|
# Create the atdnaConfig.cmake
|
|
|
|
# ... for the build tree
|
2021-04-10 08:42:06 +00:00
|
|
|
configure_file(metaforce-packbadgeConfig.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/metaforce-packbadgeConfig.cmake" @ONLY)
|
2017-12-07 04:13:12 +00:00
|
|
|
# ... for the install tree
|
2021-04-10 08:42:06 +00:00
|
|
|
configure_file(metaforce-packbadgeConfig.cmake.in "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/metaforce-packbadgeConfig.cmake" @ONLY)
|
2017-12-07 04:13:12 +00:00
|
|
|
# ... for both
|
2021-04-10 08:42:06 +00:00
|
|
|
configure_file(metaforce-packbadgeConfigVersion.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/metaforce-packbadgeConfigVersion.cmake" @ONLY)
|
2017-12-07 04:13:12 +00:00
|
|
|
|
|
|
|
else()
|
2021-04-10 08:42:06 +00:00
|
|
|
find_package(metaforce-packbadge REQUIRED)
|
2017-12-07 04:13:12 +00:00
|
|
|
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)
|
2021-04-10 08:42:06 +00:00
|
|
|
add_library(MetaforceBadging
|
2017-12-29 08:08:12 +00:00
|
|
|
badge.cpp badge.bin
|
2016-07-16 19:21:12 +00:00
|
|
|
Badging.hpp Badging.cpp)
|
2021-04-10 08:42:06 +00:00
|
|
|
target_link_libraries(MetaforceBadging PUBLIC specter)
|