mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Kornel
New files: development/cmake/doc/ReplaceValues.pl perl-script to substitute words (defined in the cmd-line) with their actual values development/cmake/doc/CMakefiles.txt convert and install files .lyx and .txt-files from the lib/doc-directory development/cmake/src/client/CMakeLists.txt create and install lyxclient Changed: development/cmake/Install.cmake include the new doc-directory remove installation of .lyx from the doc-directory. Will be installed in development/cmake/doc/CMakefiles.txt development/cmake/Install.cmake changed macro lyx_install() to not insert '.' into the globbing-expression automatically. We need sometimes also dotless files. development/cmake/src/CMakefiles.txt Added subdirectory client to create and install lyxclient on unix-like systems git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27978 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
965fdcb46a
commit
afe522b1f6
@ -336,8 +336,9 @@ if(NOT use_external_libintl)
|
||||
endif()
|
||||
add_subdirectory(src)
|
||||
|
||||
include_directories(man)
|
||||
include_directories(man doc)
|
||||
add_subdirectory(man)
|
||||
add_subdirectory(doc)
|
||||
|
||||
include(../Install)
|
||||
|
||||
|
@ -9,7 +9,7 @@ macro(lyx_install _parent_src_dir _dir _file_type)
|
||||
foreach(_glob_dir ${ARGN})
|
||||
file(GLOB _dir_list ${_parent_src_dir}/${_dir}/${_glob_dir})
|
||||
foreach(_current_dir ${_dir_list})
|
||||
file(GLOB files_list ${_current_dir}/*.${_file_type})
|
||||
file(GLOB files_list ${_current_dir}/${_file_type})
|
||||
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")
|
||||
@ -22,10 +22,12 @@ macro(lyx_install _parent_src_dir _dir _file_type)
|
||||
endmacro(lyx_install)
|
||||
|
||||
|
||||
lyx_install(${TOP_SRC_DIR}/lib bind bind . [a-z][a-z])
|
||||
lyx_install(${TOP_SRC_DIR}/lib commands def .)
|
||||
lyx_install(${TOP_SRC_DIR}/lib doc lyx . [a-z][a-z])
|
||||
lyx_install(${TOP_SRC_DIR}/lib doc * clipart)
|
||||
lyx_install(${TOP_SRC_DIR}/lib bind *.bind . [a-z][a-z])
|
||||
lyx_install(${TOP_SRC_DIR}/lib commands *.def .)
|
||||
# this is handled in doc/CMakefile.txt
|
||||
#lyx_install(${TOP_SRC_DIR}/lib doc *.lyx . [a-z][a-z])
|
||||
#lyx_install(${TOP_SRC_DIR}/lib doc *.txt . [a-z][a-z])
|
||||
lyx_install(${TOP_SRC_DIR}/lib doc * biblio clipart)
|
||||
lyx_install(${TOP_SRC_DIR}/lib doc/de * clipart)
|
||||
lyx_install(${TOP_SRC_DIR}/lib doc/es * clipart)
|
||||
lyx_install(${TOP_SRC_DIR}/lib doc/fr * clipart)
|
||||
@ -44,11 +46,4 @@ lyx_install(${TOP_SRC_DIR}/lib tex * .)
|
||||
lyx_install(${TOP_SRC_DIR}/lib ui * .)
|
||||
lyx_install(${TOP_SRC_DIR}/lib . * .)
|
||||
|
||||
# TODO also get dot-less filenames in lyx_install
|
||||
install(FILES ${TOP_SRC_DIR}/lib/lyx2lyx/lyx2lyx DESTINATION lyx2lyx PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ)
|
||||
foreach(_file unicodesymbols encodings languages)
|
||||
install(FILES ${TOP_SRC_DIR}/lib/${_file} DESTINATION .)
|
||||
endforeach(_file)
|
||||
|
||||
# TODO
|
||||
|
||||
install(PROGRAMS ${TOP_SRC_DIR}/lib/lyx2lyx/lyx2lyx DESTINATION lyx2lyx)
|
||||
|
39
development/cmake/doc/CMakeLists.txt
Normal file
39
development/cmake/doc/CMakeLists.txt
Normal file
@ -0,0 +1,39 @@
|
||||
# This file is part of LyX, the document processor.
|
||||
# Licence details can be found in the file COPYING.
|
||||
#
|
||||
# Copyright (c) 2008, Peter Kümmel, <syntheticpp@gmx.net>
|
||||
# , Kornel Benko, <Kornel.Benko@berlin.de>
|
||||
#
|
||||
|
||||
project(lyx)
|
||||
|
||||
SET(_docs)
|
||||
file(GLOB_RECURSE _rel_lyx_docs RELATIVE "${TOP_SRC_DIR}/lib/doc" "${TOP_SRC_DIR}/lib/doc/*.lyx" "${TOP_SRC_DIR}/lib/doc/*.txt")
|
||||
|
||||
foreach(_rel_doc ${_rel_lyx_docs})
|
||||
if ("${_rel_doc}" MATCHES "/" )
|
||||
string(REGEX REPLACE "/[^/]*$" "" _rel_dir_part ${_rel_doc})
|
||||
else("${_rel_doc}" MATCHES "/")
|
||||
set(_rel_dir_part ".")
|
||||
endif("${_rel_doc}" MATCHES "/")
|
||||
set(_created_doc "${CMAKE_CURRENT_BINARY_DIR}/${_rel_doc}")
|
||||
get_filename_component(_doc_dir ${_created_doc} PATH)
|
||||
file(MAKE_DIRECTORY ${_doc_dir})
|
||||
#message("found relative file " ${_rel_doc})
|
||||
#message("input ${TOP_SRC_DIR}/lib/doc/${_rel_doc}")
|
||||
#message("output ${_created_doc}")
|
||||
#message("rel_dir_part ${_rel_dir_part}")
|
||||
SET_SOURCE_FILES_PROPERTIES(${_created_doc} GENERATED)
|
||||
add_custom_command(
|
||||
OUTPUT "${_created_doc}"
|
||||
COMMAND perl "${CMAKE_SOURCE_DIR}/doc/ReplaceValues.pl" "LYX_USERDIR_VER=${LYX_USERDIR_VER}" "LYX_DIR_VER=${LYX_DIR_VER}" "${TOP_SRC_DIR}/lib/doc/${_rel_doc}" > "${_created_doc}"
|
||||
DEPENDS "${TOP_SRC_DIR}/lib/doc/${_rel_doc}"
|
||||
)
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${_rel_doc}" DESTINATION "doc/${_rel_dir_part}")
|
||||
LIST(APPEND _docs "${_created_doc}")
|
||||
endforeach(_rel_doc)
|
||||
|
||||
ADD_CUSTOM_TARGET(doc ALL DEPENDS ${_docs})
|
||||
|
||||
|
||||
|
42
development/cmake/doc/ReplaceValues.pl
Normal file
42
development/cmake/doc/ReplaceValues.pl
Normal file
@ -0,0 +1,42 @@
|
||||
#! /usr/bin/env perl
|
||||
|
||||
use strict;
|
||||
|
||||
# Syntax: ReplaceValues.pl [<var1>=<Subst1> [<var2>=<Subst> ...]] <Inputfile> [<Inputfile> ...]
|
||||
|
||||
|
||||
# Parse Arguments for strings to substitute
|
||||
|
||||
my %Subst = ();
|
||||
|
||||
for my $arg (@ARGV) {
|
||||
if ($arg =~ /^([^=]+)=(.*)$/) {
|
||||
$Subst{$1} = $2;
|
||||
}
|
||||
else {
|
||||
# $arg should be filename here
|
||||
&SubstituteDataInFile($arg);
|
||||
}
|
||||
}
|
||||
|
||||
exit(0);
|
||||
|
||||
#################################################################
|
||||
sub SubstituteDataInFile($)
|
||||
{ my ($InFile) = @_;
|
||||
open(FI, '<', $InFile) || die("Could not read \"$InFile\"");
|
||||
while (my $l = <FI>) {
|
||||
print &SubstituteDataInLine($l);
|
||||
}
|
||||
close(FI);
|
||||
}
|
||||
|
||||
sub SubstituteDataInLine($)
|
||||
{my ($line) = @_;
|
||||
my $result = $line;
|
||||
for my $k (keys %Subst) {
|
||||
while ($result =~ s/\b$k\b/$Subst{$k}/) {
|
||||
}
|
||||
}
|
||||
return($result);
|
||||
}
|
@ -8,13 +8,15 @@ project(lyx)
|
||||
|
||||
include_directories(${TOP_SRC_DIR}/src)
|
||||
|
||||
add_subdirectory(frontends)
|
||||
add_subdirectory(graphics)
|
||||
add_subdirectory(insets)
|
||||
add_subdirectory(mathed)
|
||||
add_subdirectory(support)
|
||||
add_subdirectory(tex2lyx)
|
||||
|
||||
add_subdirectory(frontends)
|
||||
add_subdirectory(graphics)
|
||||
add_subdirectory(insets)
|
||||
add_subdirectory(mathed)
|
||||
add_subdirectory(support)
|
||||
add_subdirectory(tex2lyx)
|
||||
if (UNIX)
|
||||
add_subdirectory(client)
|
||||
endif()
|
||||
|
||||
file(GLOB lyx_sources ${TOP_SRC_DIR}/src/${LYX_CPP_FILES})
|
||||
file(GLOB lyx_headers ${TOP_SRC_DIR}/src/${LYX_HPP_FILES})
|
||||
@ -25,8 +27,8 @@ list(REMOVE_ITEM lyx_sources
|
||||
${TOP_SRC_DIR}/src/ISpell.cpp
|
||||
${TOP_SRC_DIR}/src/Variables.cpp
|
||||
${TOP_SRC_DIR}/src/Section.cpp)
|
||||
|
||||
if(ASPELL_FOUND)
|
||||
|
||||
if (ASPELL_FOUND)
|
||||
include_directories(${ASPELL_INCLUDE_DIR})
|
||||
set(lyx_sources ${lyx_sources} ${TOP_SRC_DIR}/src/ASpell.cpp)
|
||||
endif()
|
||||
@ -37,14 +39,14 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}
|
||||
lyx_add_msvc_pch(lyx)
|
||||
|
||||
|
||||
if(NOT MERGE_FILES)
|
||||
if (NOT MERGE_FILES)
|
||||
set(lyx_sources ${lyx_sources})
|
||||
else()
|
||||
lyx_const_touched_files(_allinone lyx_sources)
|
||||
set(lyx_sources ${_allinone_files})
|
||||
endif()
|
||||
|
||||
if(LYX_LEAK_DETECTION)
|
||||
if (LYX_LEAK_DETECTION)
|
||||
configure_file(${vld_path}/vld.ini ${CMAKE_CURRENT_BINARY_DIR}/vld.ini COPYONLY)
|
||||
configure_file(${vld_path}/vld.ini ${CMAKE_CURRENT_BINARY_DIR}/memory_leak_report.txt COPYONLY)
|
||||
set(vld_files ${CMAKE_CURRENT_BINARY_DIR}/vld.ini ${CMAKE_CURRENT_BINARY_DIR}/memory_leak_report.txt)
|
||||
@ -52,10 +54,10 @@ endif()
|
||||
|
||||
add_executable(lyx
|
||||
${WIN32_CONSOLE}
|
||||
${lyx_sources}
|
||||
${lyx_sources}
|
||||
${lyx_headers}
|
||||
${vld_files}
|
||||
)
|
||||
)
|
||||
|
||||
target_link_libraries(lyx
|
||||
mathed
|
||||
@ -69,16 +71,16 @@ target_link_libraries(lyx
|
||||
${QT_QTMAIN_LIBRARY}
|
||||
${vld_dll})
|
||||
|
||||
if(ASPELL_FOUND)
|
||||
if (ASPELL_FOUND)
|
||||
target_link_libraries(lyx ${ASPELL_LIBRARY})
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
target_link_libraries(lyx "-bind_at_load" )
|
||||
target_link_libraries(lyx "-framework Carbon" )
|
||||
if (APPLE)
|
||||
target_link_libraries(lyx "-bind_at_load")
|
||||
target_link_libraries(lyx "-framework Carbon")
|
||||
endif()
|
||||
|
||||
if(MINGW)
|
||||
if (MINGW)
|
||||
target_link_libraries(lyx ole32)
|
||||
endif()
|
||||
|
||||
|
39
development/cmake/src/client/CMakeLists.txt
Normal file
39
development/cmake/src/client/CMakeLists.txt
Normal file
@ -0,0 +1,39 @@
|
||||
# This file is part of LyX, the document processor.
|
||||
# Licence details can be found in the file COPYING.
|
||||
#
|
||||
# Copyright (c) 2008, Peter Kümmel, <syntheticpp@gmx.net>
|
||||
# , Kornel Benko, <Kornel.Benko@berlin.de>
|
||||
#
|
||||
|
||||
project(lyxclient)
|
||||
|
||||
file(GLOB _lyxclient_sources ${TOP_SRC_DIR}/src/client/*.cpp)
|
||||
file(GLOB _lyxclient_headers ${TOP_SRC_DIR}/src/client/*.h)
|
||||
list(REMOVE_ITEM _lyxclient_headers "${TOP_SRC_DIR}/src/client/pch.h")
|
||||
|
||||
include_directories(BEFORE "${TOP_SRC_DIR}/src/client"
|
||||
"${TOP_SRC_DIR}/boost" ${ZLIB_INCLUDE_DIR})
|
||||
|
||||
add_executable(lyxclient ${_lyxclient_sources}}
|
||||
${_lyxclient_headers})
|
||||
|
||||
|
||||
target_link_libraries(lyxclient
|
||||
support
|
||||
boost_regex
|
||||
${LIBINTL_LIBRARIES}
|
||||
${ICONV_LIBRARY}
|
||||
${QT_QTCORE_LIBRARY}
|
||||
${QT_QTGUI_LIBRARY}
|
||||
)
|
||||
|
||||
if (ASPELL_FOUND)
|
||||
target_link_libraries(lyxclient ${ASPELL_LIBRARY})
|
||||
endif()
|
||||
|
||||
if (APPLE)
|
||||
target_link_libraries(lyxclient "-framework Carbon")
|
||||
endif()
|
||||
|
||||
install(TARGETS lyxclient DESTINATION bin)
|
||||
|
Loading…
Reference in New Issue
Block a user