2009-01-04 13:00:34 +00:00
|
|
|
|
|
|
|
# TODO: set correct path in call to cmake
|
|
|
|
# e.g. cmake /usr/src/lyx/lyx-devel/development/cmake -DCMAKE_INSTALL_PREFIX=/usr/local/share/lyx2.0 -Dnls=1
|
2007-05-02 20:59:48 +00:00
|
|
|
|
2012-10-13 07:53:20 +00:00
|
|
|
if(NOT(LYX_BUNDLE) AND APPLE)
|
|
|
|
message(STATUS "Installing to ${CMAKE_INSTALL_PREFIX}, defined by CMAKE_INSTALL_PREFIX")
|
|
|
|
endif()
|
|
|
|
set(OSX_BUNDLE_FILES "")
|
|
|
|
|
|
|
|
# Install files into OS X bundle
|
|
|
|
macro(lyx_install_osx basedir files)
|
|
|
|
if(LYX_BUNDLE_PROPERTY_MODE STREQUAL "ON")
|
|
|
|
foreach(file ${files})
|
|
|
|
set_source_files_properties("${file}" PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/${basedir}")
|
|
|
|
endforeach()
|
|
|
|
else()
|
|
|
|
list(APPEND OSX_BUNDLE_FILES "${files}")
|
|
|
|
endif()
|
|
|
|
endmacro(lyx_install_osx)
|
2008-12-09 20:13:04 +00:00
|
|
|
|
2008-12-28 13:35:29 +00:00
|
|
|
# the macro scans the directories "_parent_src_dir/_dir/_current_dir" for *._file_type files
|
2008-12-09 20:13:04 +00:00
|
|
|
# and installs the files in CMAKE_INSTALL_PREFIX/_current_dir
|
2007-05-02 20:59:48 +00:00
|
|
|
# dir_item is on item of the remaining arguments
|
2009-01-04 13:00:34 +00:00
|
|
|
macro(lyx_install _parent_src_dir _gl_dir _file_type)
|
2009-01-11 20:56:40 +00:00
|
|
|
#message("checking parents ${_parent_src_dir}")
|
2009-01-04 13:00:34 +00:00
|
|
|
file(GLOB _dirs RELATIVE "${_parent_src_dir}" ${_parent_src_dir}/${_gl_dir})
|
2009-01-04 13:33:23 +00:00
|
|
|
#cmake bug on Windows: if _gl_dir==. _dirs is empty but on linux _dirs==.
|
2009-01-04 13:00:34 +00:00
|
|
|
if(NOT _dirs)
|
|
|
|
set(_dirs .)
|
|
|
|
endif()
|
|
|
|
foreach(_dir ${_dirs})
|
|
|
|
foreach(_glob_dir ${ARGN})
|
|
|
|
file(GLOB _dir_list ${_parent_src_dir}/${_dir}/${_glob_dir})
|
|
|
|
if(NOT _dir_list)
|
2009-01-18 14:45:57 +00:00
|
|
|
if(_glob_dir STREQUAL ".")
|
2009-01-17 19:17:51 +00:00
|
|
|
set(_dir_list ${_parent_src_dir}/${_dir}/.)
|
2009-01-18 14:45:57 +00:00
|
|
|
endif()
|
|
|
|
endif()
|
2009-01-04 13:00:34 +00:00
|
|
|
#message(STATUS "${_dir}/${_glob_dir} -> ${_dir_list} ")
|
|
|
|
foreach(_current_dir ${_dir_list})
|
|
|
|
file(GLOB _item_list ${_current_dir}/${_file_type})
|
2009-01-04 13:33:23 +00:00
|
|
|
#cmake bug: globbing with * also returns directories on Windows
|
2009-01-04 13:00:34 +00:00
|
|
|
set(files_list ${_item_list})
|
2012-03-10 14:23:33 +00:00
|
|
|
set(program_list)
|
2009-01-04 13:00:34 +00:00
|
|
|
foreach(_current_item ${_item_list})
|
2011-12-18 12:56:38 +00:00
|
|
|
if(files_list)
|
|
|
|
if(IS_DIRECTORY ${_current_item})
|
|
|
|
#message(STATUS "removing dir ${_current_item}")
|
2009-01-04 13:00:34 +00:00
|
|
|
list(REMOVE_ITEM files_list "${_current_item}")
|
2011-12-18 12:56:38 +00:00
|
|
|
else()
|
|
|
|
if(_current_item MATCHES "/\\.[^/]+$")
|
|
|
|
#message(STATUS "removing hidden ${_current_item}")
|
|
|
|
list(REMOVE_ITEM files_list "${_current_item}")
|
|
|
|
endif()
|
2011-12-20 13:49:55 +00:00
|
|
|
if(_current_item MATCHES "\\.in$")
|
|
|
|
#message(STATUS "removing .in file ${_current_item}")
|
|
|
|
list(REMOVE_ITEM files_list "${_current_item}")
|
|
|
|
endif()
|
2012-03-10 14:23:33 +00:00
|
|
|
if(_current_item MATCHES "\\.py$")
|
|
|
|
list(REMOVE_ITEM files_list "${_current_item}")
|
|
|
|
list(APPEND program_list "${_current_item}")
|
|
|
|
endif()
|
2011-12-18 12:56:38 +00:00
|
|
|
endif()
|
2009-01-04 13:00:34 +00:00
|
|
|
endif()
|
|
|
|
endforeach(_current_item)
|
|
|
|
if(files_list)
|
2011-12-20 13:49:55 +00:00
|
|
|
list(REMOVE_ITEM files_list "${_current_dir}/lyx.svg")
|
2009-01-04 13:00:34 +00:00
|
|
|
list(REMOVE_ITEM files_list "${_current_dir}/Makefile.am")
|
2011-03-31 07:59:33 +00:00
|
|
|
list(REMOVE_ITEM files_list "${_current_dir}/layouttranslations")
|
2009-01-04 13:00:34 +00:00
|
|
|
GET_FILENAME_COMPONENT(_base_dir ${_current_dir} NAME)
|
|
|
|
if(_glob_dir STREQUAL ".")
|
|
|
|
set(_base_dir .)
|
|
|
|
endif()
|
2010-07-14 15:30:31 +00:00
|
|
|
#message(STATUS "install ${LYX_DATA_SUBDIR}${_dir}/${_base_dir}: ${files_list} ")
|
|
|
|
#message(STATUS "install at ${CMAKE_INSTALL_PREFIX}/${LYX_DATA_SUBDIR}${_dir}/${_base_dir}")
|
2012-10-13 07:53:20 +00:00
|
|
|
if(APPLE)
|
|
|
|
lyx_install_osx("${_dir}/${_based_dir}" "${files_list}")
|
|
|
|
else()
|
|
|
|
install(FILES ${files_list} DESTINATION ${LYX_DATA_SUBDIR}${_dir}/${_base_dir})
|
|
|
|
endif(APPLE)
|
2009-01-04 13:00:34 +00:00
|
|
|
endif()
|
2012-03-10 14:23:33 +00:00
|
|
|
if(program_list)
|
|
|
|
if(_glob_dir STREQUAL ".")
|
|
|
|
set(_base_dir .)
|
|
|
|
endif()
|
2012-10-13 07:53:20 +00:00
|
|
|
if(APPLE)
|
|
|
|
lyx_install_osx("${_dir}/${_based_dir}" "${program_list}")
|
|
|
|
else()
|
|
|
|
install(PROGRAMS ${program_list} DESTINATION ${LYX_DATA_SUBDIR}${_dir}/${_base_dir})
|
|
|
|
endif(APPLE)
|
2012-03-10 14:23:33 +00:00
|
|
|
endif()
|
2009-01-04 13:00:34 +00:00
|
|
|
endforeach(_current_dir)
|
|
|
|
endforeach(_glob_dir)
|
|
|
|
endforeach(_dir)
|
2007-05-02 20:59:48 +00:00
|
|
|
endmacro(lyx_install)
|
|
|
|
|
2009-01-11 18:50:24 +00:00
|
|
|
|
2009-01-04 13:00:34 +00:00
|
|
|
# language-specific-directories (like ca, de, es ...) are now globbed as "[a-z][a-z]"
|
|
|
|
set(_all_languages "[a-z][a-z]")
|
2007-05-02 20:59:48 +00:00
|
|
|
|
2009-01-04 13:00:34 +00:00
|
|
|
lyx_install(${TOP_SRC_DIR}/lib bind *.bind . ${_all_languages})
|
2009-01-03 10:53:24 +00:00
|
|
|
lyx_install(${TOP_SRC_DIR}/lib commands *.def .)
|
2009-01-04 13:00:34 +00:00
|
|
|
|
2009-01-11 18:50:24 +00:00
|
|
|
# this is handled in doc/CMakeLists.txt
|
2009-01-04 13:00:34 +00:00
|
|
|
#lyx_install(${TOP_SRC_DIR}/lib doc *.lyx . ${_all_languages})
|
|
|
|
#lyx_install(${TOP_SRC_DIR}/lib doc *.txt . ${_all_languages})
|
2009-01-03 10:53:24 +00:00
|
|
|
lyx_install(${TOP_SRC_DIR}/lib doc * biblio clipart)
|
2009-01-04 13:00:34 +00:00
|
|
|
|
|
|
|
lyx_install(${TOP_SRC_DIR}/lib doc/${_all_languages} * clipart)
|
|
|
|
|
2013-11-25 02:39:54 +00:00
|
|
|
lyx_install(${TOP_SRC_DIR}/lib examples * . ${_all_languages} springer thesis)
|
2007-05-02 20:59:48 +00:00
|
|
|
lyx_install(${TOP_SRC_DIR}/lib fonts * .)
|
2012-08-21 12:56:34 +00:00
|
|
|
lyx_install(${TOP_SRC_DIR}/lib images * . math ipa commands attic classic oxygen)
|
2007-05-02 20:59:48 +00:00
|
|
|
lyx_install(${TOP_SRC_DIR}/lib kbd * .)
|
|
|
|
lyx_install(${TOP_SRC_DIR}/lib layouts * .)
|
2009-01-05 19:13:20 +00:00
|
|
|
lyx_install(${TOP_SRC_DIR}/lib lyx2lyx *.py .)
|
2011-03-25 13:51:59 +00:00
|
|
|
lyx_install(${TOP_SRC_DIR}/lib scripts *.py .)
|
|
|
|
lyx_install(${TOP_SRC_DIR}/lib scripts *.R .)
|
2013-11-25 02:39:54 +00:00
|
|
|
lyx_install(${TOP_SRC_DIR}/lib templates * . attic)
|
2014-09-24 22:23:23 +00:00
|
|
|
lyx_install(${TOP_SRC_DIR}/lib templates * . springer)
|
2007-05-02 20:59:48 +00:00
|
|
|
lyx_install(${TOP_SRC_DIR}/lib tex * .)
|
|
|
|
lyx_install(${TOP_SRC_DIR}/lib ui * .)
|
2008-12-09 20:13:04 +00:00
|
|
|
lyx_install(${TOP_SRC_DIR}/lib . * .)
|
2011-12-06 11:48:33 +00:00
|
|
|
|
2012-10-13 07:53:20 +00:00
|
|
|
# Install
|
|
|
|
if(APPLE)
|
|
|
|
lyx_install(${TOP_SRC_DIR}/development/MacOSX . *.sdef .)
|
|
|
|
lyx_install(${TOP_SRC_DIR}/development/MacOSX . *.icns .)
|
|
|
|
lyx_install(${TOP_SRC_DIR}/development/MacOSX . qt.conf .)
|
|
|
|
endif()
|
|
|
|
|
2012-03-10 14:23:33 +00:00
|
|
|
install(PROGRAMS ${TOP_SRC_DIR}/lib/scripts/listerrors DESTINATION scripts)
|
|
|
|
|
2011-12-06 11:48:33 +00:00
|
|
|
if(UNIX)
|
2011-12-20 13:49:55 +00:00
|
|
|
set(program_suffix ${PROGRAM_SUFFIX})
|
|
|
|
configure_file(${TOP_SRC_DIR}/lib/lyx.desktop.in lyx${PROGRAM_SUFFIX}.desktop)
|
|
|
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/lyx${PROGRAM_SUFFIX}.desktop DESTINATION applications)
|
|
|
|
install(FILES ${TOP_SRC_DIR}/lib/images/lyx.svg RENAME lyx${PROGRAM_SUFFIX}.svg DESTINATION images)
|
2011-12-06 11:48:33 +00:00
|
|
|
endif()
|