58 lines
2.1 KiB
CMake
58 lines
2.1 KiB
CMake
# Copyright (C) 2013 Christian Dywan <christian@twotoasts.de>
|
|
|
|
include(FindConvert)
|
|
if (NOT CONVERT_FOUND)
|
|
message(FATAL_ERROR "rsvg-convert not found")
|
|
endif ()
|
|
|
|
include(FindIntltool)
|
|
if (NOT INTLTOOL_MERGE_FOUND)
|
|
message(FATAL_ERROR "intltool-merge not found")
|
|
elseif (NOT INTLTOOL_UPDATE_FOUND)
|
|
message(FATAL_ERROR "intltool-update not found")
|
|
endif ()
|
|
|
|
file(GLOB_RECURSE DATA_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *)
|
|
list(REMOVE_ITEM DATA_FILES "CMakeLists.txt")
|
|
|
|
foreach(FILE ${DATA_FILES})
|
|
if (${FILE} MATCHES "faq.")
|
|
install(FILES ${FILE} DESTINATION ${CMAKE_INSTALL_DOCDIR})
|
|
elseif (${FILE} MATCHES ".desktop")
|
|
if (NOT WIN32)
|
|
string(REPLACE ".desktop.in" "" DESKTOP_ID ${FILE})
|
|
INTLTOOL_MERGE_DESKTOP (${DESKTOP_ID} po)
|
|
endif ()
|
|
elseif (${FILE} MATCHES ".appdata.xml")
|
|
if (NOT WIN32)
|
|
string(REPLACE ".appdata.xml.in" "" DESKTOP_ID ${FILE})
|
|
INTLTOOL_MERGE_APPDATA (${DESKTOP_ID} po)
|
|
endif ()
|
|
elseif (${FILE} MATCHES "\\.svg$")
|
|
string(REPLACE ".svg" "" IMG_ID ${FILE})
|
|
string (FIND ${FILE} "/" IS_DIR)
|
|
if (IS_DIR GREATER -1)
|
|
string(REPLACE "/" ";" DIR_LIST ${FILE})
|
|
LIST(GET DIR_LIST 0 S_DIR)
|
|
SVG2PNG (${IMG_ID} "${CMAKE_INSTALL_DATADIR}/midori/res/${S_DIR}")
|
|
else ()
|
|
SVG2PNG (${IMG_ID} "${CMAKE_INSTALL_DATADIR}/midori/res/")
|
|
endif()
|
|
# These are being handled in add_executable for the "midori" binary
|
|
elseif (${FILE} MATCHES "\\.ico$")
|
|
elseif (${FILE} MATCHES "\\.rc$")
|
|
# This is only meant for testing, and not used in production
|
|
elseif (${FILE} MATCHES "\\.swf$")
|
|
else()
|
|
string(FIND ${FILE} "/" IS_DIR)
|
|
if (IS_DIR GREATER -1)
|
|
string(REPLACE "/" ";" DIR_LIST ${FILE})
|
|
LIST(GET DIR_LIST 0 S_DIR)
|
|
LIST(GET DIR_LIST 1 S_FILE)
|
|
install(FILES ${S_DIR}/${S_FILE} DESTINATION ${CMAKE_INSTALL_DATADIR}/midori/res/${S_DIR})
|
|
else ()
|
|
install(FILES ${FILE} DESTINATION ${CMAKE_INSTALL_DATADIR}/midori/res/)
|
|
endif()
|
|
endif()
|
|
|
|
endforeach()
|