2023-01-01 19:49:48 +00:00
|
|
|
add_library(${TR_NAME}-mac-ql MODULE)
|
2016-09-10 17:08:58 +00:00
|
|
|
|
2023-01-01 19:49:48 +00:00
|
|
|
target_sources(${TR_NAME}-mac-ql
|
|
|
|
PRIVATE
|
|
|
|
../NSDataAdditions.mm
|
|
|
|
../NSStringAdditions.mm
|
|
|
|
GeneratePreviewForURL.mm
|
|
|
|
GenerateThumbnailForURL.mm
|
|
|
|
main.cc)
|
2016-09-10 17:08:58 +00:00
|
|
|
|
2023-01-01 19:49:48 +00:00
|
|
|
set(LINGUAS
|
2016-09-10 17:08:58 +00:00
|
|
|
da
|
|
|
|
de
|
|
|
|
en
|
|
|
|
es
|
|
|
|
fr
|
|
|
|
it
|
|
|
|
nl
|
|
|
|
pt_PT
|
|
|
|
ru
|
2023-01-01 19:49:48 +00:00
|
|
|
tr)
|
2016-09-10 17:08:58 +00:00
|
|
|
|
|
|
|
if(ENABLE_NLS)
|
2023-01-01 19:49:48 +00:00
|
|
|
set(ENABLED_LINGUAS ${LINGUAS})
|
2016-09-10 17:08:58 +00:00
|
|
|
else()
|
2023-01-01 19:49:48 +00:00
|
|
|
set(ENABLED_LINGUAS en)
|
2016-09-10 17:08:58 +00:00
|
|
|
endif()
|
|
|
|
|
2023-01-01 19:49:48 +00:00
|
|
|
set(LANG_STRINGS_FILES
|
|
|
|
Localizable.strings)
|
2016-09-10 17:08:58 +00:00
|
|
|
|
2023-01-01 19:49:48 +00:00
|
|
|
set(RESOURCES
|
|
|
|
style.css)
|
|
|
|
source_group(Resources
|
|
|
|
FILES ${RESOURCES})
|
2016-09-10 17:08:58 +00:00
|
|
|
|
2023-01-01 19:49:48 +00:00
|
|
|
set_source_files_properties(
|
|
|
|
${RESOURCES}
|
|
|
|
PROPERTIES
|
|
|
|
MACOSX_PACKAGE_LOCATION Resources)
|
2016-09-10 17:08:58 +00:00
|
|
|
|
2023-01-01 19:49:48 +00:00
|
|
|
foreach(LANG ${ENABLED_LINGUAS})
|
|
|
|
set(${LANG}_STRINGS_FILES)
|
2022-11-12 20:01:57 +00:00
|
|
|
set(STRINGS_FILES_RESOURCES_DIR Resources)
|
|
|
|
if(NOT CMAKE_GENERATOR STREQUAL Xcode)
|
|
|
|
string(APPEND STRINGS_FILES_RESOURCES_DIR /${LANG}.lproj)
|
|
|
|
endif()
|
2023-01-01 19:49:48 +00:00
|
|
|
foreach(F ${LANG_STRINGS_FILES})
|
|
|
|
list(APPEND ${LANG}_STRINGS_FILES ${LANG}.lproj/${F})
|
|
|
|
list(APPEND RESOURCES ${${LANG}_STRINGS_FILES})
|
|
|
|
set_source_files_properties(
|
|
|
|
${${LANG}_STRINGS_FILES}
|
|
|
|
PROPERTIES
|
|
|
|
MACOSX_PACKAGE_LOCATION ${STRINGS_FILES_RESOURCES_DIR})
|
2016-09-10 17:08:58 +00:00
|
|
|
endforeach()
|
2023-01-01 19:49:48 +00:00
|
|
|
source_group(Resources/${LANG}.lproj
|
|
|
|
FILES ${${LANG}_STRINGS_FILES})
|
2016-09-10 17:08:58 +00:00
|
|
|
endforeach()
|
|
|
|
|
2023-01-01 19:49:48 +00:00
|
|
|
target_sources(${TR_NAME}-mac-ql
|
|
|
|
PRIVATE
|
|
|
|
${RESOURCES})
|
2016-09-10 17:08:58 +00:00
|
|
|
|
|
|
|
set(MAC_QL_BUNDLE_NAME QuickLookPlugin)
|
|
|
|
|
2023-01-01 19:49:48 +00:00
|
|
|
set_target_properties(
|
|
|
|
${TR_NAME}-mac-ql
|
|
|
|
PROPERTIES
|
|
|
|
OUTPUT_NAME ${MAC_QL_BUNDLE_NAME}
|
|
|
|
MACOSX_BUNDLE ON
|
|
|
|
BUNDLE ON
|
|
|
|
BUNDLE_EXTENSION qlgenerator
|
|
|
|
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in"
|
|
|
|
INSTALL_RPATH "@loader_path/../../../../../MacOS;@loader_path/../../../../../Frameworks")
|
2016-09-10 17:08:58 +00:00
|
|
|
|
2023-01-01 19:49:48 +00:00
|
|
|
target_include_directories(${TR_NAME}-mac-ql
|
|
|
|
PRIVATE
|
|
|
|
..)
|
2016-09-10 17:08:58 +00:00
|
|
|
|
|
|
|
target_link_libraries(${TR_NAME}-mac-ql
|
2023-01-01 19:49:48 +00:00
|
|
|
PRIVATE
|
|
|
|
${TR_NAME}
|
|
|
|
"-framework Foundation"
|
|
|
|
"-framework CoreFoundation"
|
|
|
|
"-framework CoreServices"
|
|
|
|
"-framework AppKit"
|
|
|
|
"-framework QuickLook")
|
2016-09-10 17:08:58 +00:00
|
|
|
|
2023-01-01 19:49:48 +00:00
|
|
|
install(
|
|
|
|
TARGETS ${TR_NAME}-mac-ql
|
|
|
|
DESTINATION Applications/${MAC_BUNDLE_NAME}.app/Contents/Library/QuickLook)
|
2016-09-10 17:08:58 +00:00
|
|
|
|
2023-01-01 19:49:48 +00:00
|
|
|
install(CODE
|
|
|
|
"list(APPEND CMAKE_MODULE_PATH \"${CMAKE_SOURCE_DIR}/cmake\")
|
2016-09-10 17:08:58 +00:00
|
|
|
include(TrMacros)
|
|
|
|
include(GetPrerequisites)
|
2023-01-01 19:49:48 +00:00
|
|
|
tr_fixup_bundle_item(
|
|
|
|
\"\$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/Applications/${MAC_BUNDLE_NAME}.app\"
|
|
|
|
\"Contents/Library/QuickLook/${MAC_QL_BUNDLE_NAME}.qlgenerator/Contents/MacOS/${MAC_QL_BUNDLE_NAME}\" \"\")")
|