metaforce/Editor/icons/CMakeLists.txt

31 lines
1.2 KiB
CMake
Raw Normal View History

2016-01-18 02:12:01 +00:00
cmake_policy(SET CMP0053 OLD)
include_directories(${LIBPNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR})
2016-01-18 00:40:11 +00:00
add_executable(packicons packicons.c)
target_link_libraries(packicons ${PNG_LIB} ${ZLIB_LIBRARIES})
unset(INKSCAPE_BIN CACHE)
set(CMAKE_FIND_APPBUNDLE "NEVER")
2016-01-18 02:12:01 +00:00
if(WIN32)
find_program(INKSCAPE_BIN inkscape.exe PATHS
"$ENV{PROGRAMFILES}/Inkscape"
"$ENV{ProgramW6432}/Inkscape"
"$ENV{PROGRAMFILES(X86)}/Inkscape")
else()
2016-12-08 04:55:44 +00:00
set(CMAKE_FIND_APPBUNDLE FIRST)
2016-01-18 02:12:01 +00:00
find_program(INKSCAPE_BIN inkscape)
endif()
2016-12-11 01:54:08 +00:00
if(NOT INKSCAPE_BIN)
add_custom_command(OUTPUT icons.bin COMMAND ${CMAKE_COMMAND} ARGS -P
${CMAKE_CURRENT_SOURCE_DIR}/IconDownload.cmake)
2016-01-18 00:40:11 +00:00
else()
message(STATUS "Inkscape found; will render icons locally")
add_custom_command(OUTPUT icons.bin COMMAND $<TARGET_FILE:packicons>
ARGS ${INKSCAPE_BIN} ${CMAKE_CURRENT_SOURCE_DIR}/icons.svg
${CMAKE_CURRENT_BINARY_DIR}/icons.bin
MAIN_DEPENDENCY icons.svg COMMENT "Generating icons.bin")
endif()
bintoc(icons.c ${CMAKE_CURRENT_BINARY_DIR}/icons.bin URDE_ICONS)
add_library(UrdeIcons icons.cpp icons.hpp icons.bin icons.c)