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
|
|
|
|
2008-12-09 20:13:04 +00:00
|
|
|
message(STATUS "installing to ${CMAKE_INSTALL_PREFIX}, defined by CMAKE_INSTALL_PREFIX")
|
|
|
|
|
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)
|
|
|
|
set(_dir_list ${_parent_src_dir}/${_dir})
|
|
|
|
endif()
|
2009-01-11 20:52:14 +00:00
|
|
|
if(_glob_dir STREQUAL ".")
|
|
|
|
set(_dir_list ${_parent_src_dir}/${_dir}/.)
|
|
|
|
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})
|
|
|
|
foreach(_current_item ${_item_list})
|
|
|
|
if(IS_DIRECTORY ${_current_item})
|
|
|
|
#message(STATUS "removing ${_current_item}")
|
|
|
|
if(files_list)
|
|
|
|
list(REMOVE_ITEM files_list "${_current_item}")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endforeach(_current_item)
|
|
|
|
if(files_list)
|
|
|
|
list(REMOVE_ITEM files_list "${_current_dir}/.svn")
|
|
|
|
list(REMOVE_ITEM files_list "${_current_dir}/Makefile.in")
|
|
|
|
list(REMOVE_ITEM files_list "${_current_dir}/Makefile.am")
|
|
|
|
GET_FILENAME_COMPONENT(_base_dir ${_current_dir} NAME)
|
|
|
|
if(_glob_dir STREQUAL ".")
|
|
|
|
set(_base_dir .)
|
|
|
|
endif()
|
|
|
|
#message(STATUS "install ${_dir}/${_base_dir}: ${files_list} ")
|
2009-01-04 13:01:55 +00:00
|
|
|
#message(STATUS "install at ${CMAKE_INSTALL_PREFIX}/${_dir}/${_base_dir}")
|
2009-01-04 13:00:34 +00:00
|
|
|
install(FILES ${files_list} DESTINATION ${_dir}/${_base_dir})
|
|
|
|
endif()
|
|
|
|
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)
|
|
|
|
|
|
|
|
lyx_install(${TOP_SRC_DIR}/lib examples * . ${_all_languages})
|
2007-05-02 20:59:48 +00:00
|
|
|
lyx_install(${TOP_SRC_DIR}/lib fonts * .)
|
2008-12-14 17:09:06 +00:00
|
|
|
lyx_install(${TOP_SRC_DIR}/lib images * . math commands attic)
|
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 .)
|
2009-01-11 18:50:24 +00:00
|
|
|
lyx_install(${TOP_SRC_DIR}/lib scripts *.py .)
|
2007-05-02 20:59:48 +00:00
|
|
|
lyx_install(${TOP_SRC_DIR}/lib templates * .)
|
|
|
|
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 . * .)
|
2007-05-02 20:59:48 +00:00
|
|
|
|
2009-01-03 10:53:24 +00:00
|
|
|
install(PROGRAMS ${TOP_SRC_DIR}/lib/lyx2lyx/lyx2lyx DESTINATION lyx2lyx)
|
2009-01-04 13:00:34 +00:00
|
|
|
|