2 # TODO: set correct path in call to cmake
3 # e.g. cmake /usr/src/lyx/lyx-devel/development/cmake -DCMAKE_INSTALL_PREFIX=/usr/local/share/lyx2.0 -Dnls=1
5 message(STATUS "installing to ${CMAKE_INSTALL_PREFIX}, defined by CMAKE_INSTALL_PREFIX")
7 # the macro scans the directories "_parent_src_dir/_dir/_current_dir" for *._file_type files
8 # and installs the files in CMAKE_INSTALL_PREFIX/_current_dir
9 # dir_item is on item of the remaining arguments
10 macro(lyx_install _parent_src_dir _gl_dir _file_type)
11 #message("checking parents ${_parent_src_dir}")
12 file(GLOB _dirs RELATIVE "${_parent_src_dir}" ${_parent_src_dir}/${_gl_dir})
13 #cmake bug on Windows: if _gl_dir==. _dirs is empty but on linux _dirs==.
17 foreach(_dir ${_dirs})
18 foreach(_glob_dir ${ARGN})
19 file(GLOB _dir_list ${_parent_src_dir}/${_dir}/${_glob_dir})
21 if(_glob_dir STREQUAL ".")
22 set(_dir_list ${_parent_src_dir}/${_dir}/.)
25 if(_glob_dir STREQUAL ".")
26 set(_dir_list ${_parent_src_dir}/${_dir}/.)
28 #message(STATUS "${_dir}/${_glob_dir} -> ${_dir_list} ")
29 foreach(_current_dir ${_dir_list})
30 file(GLOB _item_list ${_current_dir}/${_file_type})
31 #cmake bug: globbing with * also returns directories on Windows
32 set(files_list ${_item_list})
33 foreach(_current_item ${_item_list})
34 if(IS_DIRECTORY ${_current_item})
35 #message(STATUS "removing ${_current_item}")
37 list(REMOVE_ITEM files_list "${_current_item}")
40 endforeach(_current_item)
42 list(REMOVE_ITEM files_list "${_current_dir}/.svn")
43 list(REMOVE_ITEM files_list "${_current_dir}/Makefile.in")
44 list(REMOVE_ITEM files_list "${_current_dir}/Makefile.am")
45 GET_FILENAME_COMPONENT(_base_dir ${_current_dir} NAME)
46 if(_glob_dir STREQUAL ".")
49 #message(STATUS "install ${_dir}/${_base_dir}: ${files_list} ")
50 #message(STATUS "install at ${CMAKE_INSTALL_PREFIX}/${_dir}/${_base_dir}")
51 install(FILES ${files_list} DESTINATION ${_dir}/${_base_dir})
53 endforeach(_current_dir)
59 # language-specific-directories (like ca, de, es ...) are now globbed as "[a-z][a-z]"
60 set(_all_languages "[a-z][a-z]")
62 lyx_install(${TOP_SRC_DIR}/lib bind *.bind . ${_all_languages})
63 lyx_install(${TOP_SRC_DIR}/lib commands *.def .)
65 # this is handled in doc/CMakeLists.txt
66 #lyx_install(${TOP_SRC_DIR}/lib doc *.lyx . ${_all_languages})
67 #lyx_install(${TOP_SRC_DIR}/lib doc *.txt . ${_all_languages})
68 lyx_install(${TOP_SRC_DIR}/lib doc * biblio clipart)
70 lyx_install(${TOP_SRC_DIR}/lib doc/${_all_languages} * clipart)
72 lyx_install(${TOP_SRC_DIR}/lib examples * . ${_all_languages})
73 lyx_install(${TOP_SRC_DIR}/lib fonts * .)
74 lyx_install(${TOP_SRC_DIR}/lib images * . math commands attic)
75 lyx_install(${TOP_SRC_DIR}/lib kbd * .)
76 lyx_install(${TOP_SRC_DIR}/lib layouts * .)
77 lyx_install(${TOP_SRC_DIR}/lib lyx2lyx *.py .)
78 lyx_install(${TOP_SRC_DIR}/lib scripts *.py .)
79 lyx_install(${TOP_SRC_DIR}/lib templates * .)
80 lyx_install(${TOP_SRC_DIR}/lib tex * .)
81 lyx_install(${TOP_SRC_DIR}/lib ui * .)
82 lyx_install(${TOP_SRC_DIR}/lib . * .)
84 install(PROGRAMS ${TOP_SRC_DIR}/lib/lyx2lyx/lyx2lyx DESTINATION lyx2lyx)