Cmake build: Install subscript.sty only for WIN32 (using MikTeX)

This commit is contained in:
Kornel Benko 2017-11-05 17:06:38 +01:00
parent 1391e3189a
commit 6011d6cdca

View File

@ -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)