set(LYX_USERDIR_VER "LYX_USERDIR_20x")
set(PROGRAM_SUFFIX "\"\"")
+if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+ # see http://www.cmake.org/pipermail/cmake/2006-October/011559.html
+ if (UNIX)
+ # don't use the default "/usr/local"
+ # but respect the user-choice on the command-line
+ SET(CMAKE_INSTALL_PREFIX
+ "/usr/local/share/lyx2.0" CACHE PATH "LyX install prefix" FORCE)
+ endif()
+ if(WIN32)
+ SET(CMAKE_INSTALL_PREFIX
+ ${CMAKE_INSTALL_PREFIX}/2.0 CACHE PATH "LyX install prefix" FORCE)
+ endif()
+endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+
set(LYX_ABS_INSTALLED_DATADIR "${CMAKE_INSTALL_PREFIX}")
set(LYX_LOCALEDIR "locale")
set(LYX_ABS_INSTALLED_LOCALEDIR "${LYX_ABS_INSTALLED_DATADIR}/${LYX_LOCALEDIR}")
endif()
add_subdirectory(src)
-include_directories(man doc)
add_subdirectory(man)
add_subdirectory(doc)
+if (UNIX)
+ add_subdirectory(lyx2lyx)
+endif()
include(../Install)
lyx_install(${TOP_SRC_DIR}/lib images * . math commands attic)
lyx_install(${TOP_SRC_DIR}/lib kbd * .)
lyx_install(${TOP_SRC_DIR}/lib layouts * .)
-lyx_install(${TOP_SRC_DIR}/lib lyx2lyx * .)
+lyx_install(${TOP_SRC_DIR}/lib lyx2lyx *.py .)
lyx_install(${TOP_SRC_DIR}/lib scripts * .)
lyx_install(${TOP_SRC_DIR}/lib templates * .)
lyx_install(${TOP_SRC_DIR}/lib tex * .)
--- /dev/null
+# This file is part of LyX, the document processor.
+# Licence details can be found in the file COPYING.
+#
+# Copyright (c) 2009, Peter Kümmel, <syntheticpp@gmx.net>
+# , Kornel Benko, <Kornel.Benko@berlin.de>
+#
+
+project(lyx2lyx)
+
+include(FindPythonInterp)
+
+file(GLOB _lyx2lyx_py_files ${TOP_SRC_DIR}/lib/lyx2lyx/*.py)
+
+set(py_compile ${TOP_SRC_DIR}/config/py-compile)
+
+set(_generated)
+set(ENV{PYTHON} ${PYTHON_EXECUTABLE})
+
+foreach(_orig_py ${_lyx2lyx_py_files})
+ get_filename_component(_base_we_py ${_orig_py} NAME_WE)
+ set(_compiled_py_ "${CMAKE_CURRENT_BINARY_DIR}/${_base_we_py}.pyc" "${CMAKE_CURRENT_BINARY_DIR}/${_base_we_py}.pyo")
+ set(_copied_py "${CMAKE_CURRENT_BINARY_DIR}/${_base_we_py}.py")
+# we need that file really local first, due to the "py_compile"-script
+# because the creation will be in the directory of .py-file
+ add_custom_command(
+ OUTPUT ${_copied_py}
+ PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "${_orig_py}" ${_copied_py}
+ DEPENDS ${_orig_py}
+ )
+ add_custom_command(
+ OUTPUT ${_compiled_py_}
+ PRE_BUILD
+ COMMAND ${py_compile} ${_copied_py}
+ DEPENDS ${_copied_py}
+ )
+ SET_SOURCE_FILES_PROPERTIES(${_copied_py} ${_created_py_} GENERATED)
+ install(FILES ${_compiled_py_} DESTINATION lyx2lyx)
+ LIST(APPEND _generated ${_compiled_py_})
+endforeach(_orig_py)
+
+ADD_CUSTOM_TARGET(lyx2lyx ALL DEPENDS ${_generated})
include_directories(BEFORE "${TOP_SRC_DIR}/src/client"
"${TOP_SRC_DIR}/boost" ${ZLIB_INCLUDE_DIR})
-add_executable(lyxclient ${_lyxclient_sources}}
- ${_lyxclient_headers})
+add_executable(lyxclient ${_lyxclient_sources} ${_lyxclient_headers})
target_link_libraries(lyxclient