From 6011d6cdca6f99b25dd8be9dbbbae8d34e2adfa2 Mon Sep 17 00:00:00 2001 From: Kornel Benko Date: Sun, 5 Nov 2017 17:06:38 +0100 Subject: [PATCH] Cmake build: Install subscript.sty only for WIN32 (using MikTeX) --- development/cmake/Install.cmake | 40 ++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/development/cmake/Install.cmake b/development/cmake/Install.cmake index 59893449fe..0cd0dcfdb0 100755 --- a/development/cmake/Install.cmake +++ b/development/cmake/Install.cmake @@ -47,28 +47,32 @@ macro(lyx_install _what _parent_src_dir _gl_dir _file_type) file(GLOB _item_list ${_current_dir}/${_file_type}) #cmake bug: globbing with * also returns directories on Windows set(files_list ${_item_list}) - set(program_list) + set(program_list) foreach(_current_item ${_item_list}) - if(files_list) - if(IS_DIRECTORY ${_current_item}) - #message(STATUS "removing dir ${_current_item}") + if(files_list) + if(IS_DIRECTORY ${_current_item}) + #message(STATUS "removing dir ${_current_item}") list(REMOVE_ITEM files_list "${_current_item}") else() - if ("${_file_type}" STREQUAL "*") - foreach(_mask "/\\.[^/]+$" "\\.in$" "\\.py$" "\\.patch$" "CMakeLists\\.txt$" "\\.lyx~$") - if(_current_item MATCHES ${_mask}) - #message(STATUS "removing item ${_current_item}") - list(REMOVE_ITEM files_list "${_current_item}") - endif() - endforeach() - endif() - endif() + if ("${_file_type}" STREQUAL "*") + foreach(_mask "/\\.[^/]+$" "\\.in$" "\\.py$" "\\.patch$" "CMakeLists\\.txt$" "\\.lyx~$") + if(_current_item MATCHES ${_mask}) + #message(STATUS "removing item ${_current_item}") + list(REMOVE_ITEM files_list "${_current_item}") + endif() + endforeach() + endif() + endif() endif() endforeach(_current_item) if(files_list) list(REMOVE_ITEM files_list "${_current_dir}/lyx.svg") list(REMOVE_ITEM files_list "${_current_dir}/Makefile.am") list(REMOVE_ITEM files_list "${_current_dir}/layouttranslations") + if (NOT WIN32) + # subscript.sty is installed only for MikTeX since it is part of texlive + list(REMOVE_ITEM files_list "${_current_dir}/subscript.sty") + endif() GET_FILENAME_COMPONENT(_base_dir ${_current_dir} NAME) if(_glob_dir STREQUAL ".") set(_base_dir .) @@ -77,12 +81,12 @@ macro(lyx_install _what _parent_src_dir _gl_dir _file_type) install(FILES ${files_list} DESTINATION "${_dest_subdir}${_dir}/${_base_dir}") #message(STATUS "Installing ${files_list} to ${_dest_subdir}${_dir}/${_base_dir}") endif() - if(program_list) - if(_glob_dir STREQUAL ".") - set(_base_dir .) - endif() + if(program_list) + if(_glob_dir STREQUAL ".") + set(_base_dir .) + endif() install(FILES ${program_list} DESTINATION "${_dest_subdir}${_dir}/${_base_dir}") - endif() + endif() endforeach(_current_dir) endforeach(_glob_dir) endforeach(_dir)