From a56c3d26218684ec4bead80ba9b90927a0b120e4 Mon Sep 17 00:00:00 2001 From: Kornel Benko Date: Fri, 5 Jun 2020 14:10:04 +0200 Subject: [PATCH] Cmake installs: Clean up some installs --- development/cmake/Install.cmake | 82 ++++++++++++++++++--------------- 1 file changed, 46 insertions(+), 36 deletions(-) mode change 100755 => 100644 development/cmake/Install.cmake diff --git a/development/cmake/Install.cmake b/development/cmake/Install.cmake old mode 100755 new mode 100644 index cbad766bf8..0aa8ae0848 --- 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~$" "attic") + 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) @@ -90,8 +94,7 @@ endmacro(lyx_install) # language-specific-directories (like ca, de, es ...) are now globbed as "[a-z][a-z]" -set(_all_languages "[a-z][a-z]") -set(_all_combined_langs "[a-z][a-z]_[A-Z][A-Z]") +set(_all_languages "[a-z][a-z]" "[a-z][a-z]_[A-Z][A-Z]") lyx_install("data" ${TOP_SRC_DIR}/lib bind *.bind . ${_all_languages}) lyx_install("data" ${TOP_SRC_DIR}/lib commands *.def .) @@ -101,26 +104,33 @@ lyx_install("data" ${TOP_SRC_DIR}/lib commands *.def .) #lyx_install("data" ${TOP_SRC_DIR}/lib doc *.txt . ${_all_languages}) lyx_install("data" ${TOP_SRC_DIR}/lib doc * biblio clipart) -lyx_install("data" ${TOP_SRC_DIR}/lib doc/${_all_languages} * clipart) +foreach(_lang ${_all_languages}) + lyx_install("data" ${TOP_SRC_DIR}/lib doc/${_lang} * clipart) +endforeach() + +foreach(_sd "examples" "templates") + lyx_install("data" ${TOP_SRC_DIR}/lib ${_sd} * . *) + lyx_install("data" ${TOP_SRC_DIR}/lib ${_sd}/* * . *) +endforeach() + +foreach(_sd "kbd" "layouts" "ui" ".") + lyx_install("data" ${TOP_SRC_DIR}/lib ${_sd} * . ) +endforeach() + +foreach(_sd "lyx2lyx" "scripts" ".") + lyx_install("data" ${TOP_SRC_DIR}/lib ${_sd} *.py . ) +endforeach() -lyx_install("data" ${TOP_SRC_DIR}/lib examples * . ${_all_languages} ${_all_combined_langs} springer thesis) -lyx_install("font" ${TOP_SRC_DIR}/lib/fonts . * .) foreach(_imgext "png" "svgz" "gif" "xpm") - lyx_install("data" ${TOP_SRC_DIR}/lib images "*.${_imgext}" . ipa commands attic classic oxygen) + lyx_install("data" ${TOP_SRC_DIR}/lib images "*.${_imgext}" . ipa attic classic oxygen) lyx_install("data" ${TOP_SRC_DIR}/lib images/math "*.${_imgext}" . oxygen) endforeach() -lyx_install("data" ${TOP_SRC_DIR}/lib kbd * .) -lyx_install("data" ${TOP_SRC_DIR}/lib layouts * .) -lyx_install("data" ${TOP_SRC_DIR}/lib lyx2lyx *.py .) -lyx_install("data" ${TOP_SRC_DIR}/lib scripts *.py .) -lyx_install("data" ${TOP_SRC_DIR}/lib citeengines *.citeengine .) -lyx_install("data" ${TOP_SRC_DIR}/lib . *.py .) -lyx_install("data" ${TOP_SRC_DIR}/lib scripts *.R .) -lyx_install("data" ${TOP_SRC_DIR}/lib templates * . springer) -lyx_install("data" ${TOP_SRC_DIR}/lib xtemplates *.xtemplate .) -lyx_install("tex" ${TOP_SRC_DIR}/lib/tex . * .) -lyx_install("data" ${TOP_SRC_DIR}/lib ui * .) -lyx_install("data" ${TOP_SRC_DIR}/lib . * .) +lyx_install("data" ${TOP_SRC_DIR}/lib citeengines *.citeengine .) +lyx_install("data" ${TOP_SRC_DIR}/lib scripts *.R .) +lyx_install("data" ${TOP_SRC_DIR}/lib xtemplates *.xtemplate .) +lyx_install("data" ${TOP_SRC_DIR}/3rdparty scripts/evince_sync * .) +lyx_install("font" ${TOP_SRC_DIR}/lib/fonts . * .) +lyx_install("tex" ${TOP_SRC_DIR}/lib/tex . * .) # Install if(APPLE) -- 2.39.5