Cmake build:

Creating LYX_DATE dynamically at configure-time caused unwanted recompilation
of the whole directories (src + src/tex2lyx) because all the relevant objects
were dependent of a common file (flags.make in case of "Unix makefiles") which changed
accordingly.
There is now a new include (lyx_date.h, with only one definition)

Nothing changes for automake, since in this case LYX_DATE is defined in config.h
This commit is contained in:
Kornel Benko 2012-10-15 22:50:39 +02:00
parent 4f20946258
commit 419f32df91
5 changed files with 22 additions and 4 deletions

View File

@ -673,6 +673,7 @@ else()
endif()
configure_file(${LYX_CMAKE_DIR}/config.h.cmake ${TOP_BINARY_DIR}/config.h)
configure_file(${LYX_CMAKE_DIR}/lyx_date.h.cmake ${TOP_BINARY_DIR}/lyx_date.h)
# Compute qt4-version from ${QTVERSION}
if(QTVERSION MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+).*")

View File

@ -0,0 +1,18 @@
/*
* \file config.h
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* This is the compilation configuration file for LyX.
* It was generated by cmake.
* You might want to change some of the defaults if something goes wrong
* during the compilation.
*/
#ifndef _LYX_DATE_H
#define _LYX_DATE_H
#cmakedefine LYX_DATE "${LYX_DATE}"
#endif

View File

@ -31,8 +31,6 @@ list(REMOVE_ITEM lyx_sources
${TOP_SRC_DIR}/src/lyxinsets.cpp
${TOP_SRC_DIR}/src/lyxmathed.cpp)
set_property(SOURCE "${TOP_SRC_DIR}/src/version.cpp" APPEND PROPERTY COMPILE_DEFINITIONS LYX_DATE="${LYX_DATE}")
list(REMOVE_ITEM lyx_headers
${TOP_SRC_DIR}/src/Variables.h
${TOP_SRC_DIR}/src/Section.h)

View File

@ -21,8 +21,6 @@ foreach(_src graphics/GraphicsParams insets/ExternalTemplate
list(APPEND LINKED_headers ${TOP_SRC_DIR}/src/${_src}.h)
endforeach(_src)
set_property(SOURCE "${TOP_SRC_DIR}/src/version.cpp" APPEND PROPERTY COMPILE_DEFINITIONS LYX_DATE="${LYX_DATE}")
file(GLOB tex2lyx_sources ${TOP_SRC_DIR}/src/tex2lyx/${LYX_CPP_FILES})
file(GLOB tex2lyx_headers ${TOP_SRC_DIR}/src/tex2lyx/${LYX_HPP_FILES})

View File

@ -10,6 +10,9 @@
*/
#include <config.h>
#if ! defined(LYX_DATE)
#include <lyx_date.h>
#endif
///
extern char const * const lyx_version = PACKAGE_VERSION;