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
endif()
configure_file(${LYX_CMAKE_DIR}/config.h.cmake ${TOP_BINARY_DIR}/config.h)
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]+).*")
# Compute qt4-version from ${QTVERSION}
if(QTVERSION MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+).*")
--- /dev/null
+/*
+ * \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
+
${TOP_SRC_DIR}/src/lyxinsets.cpp
${TOP_SRC_DIR}/src/lyxmathed.cpp)
${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)
list(REMOVE_ITEM lyx_headers
${TOP_SRC_DIR}/src/Variables.h
${TOP_SRC_DIR}/src/Section.h)
list(APPEND LINKED_headers ${TOP_SRC_DIR}/src/${_src}.h)
endforeach(_src)
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})
file(GLOB tex2lyx_sources ${TOP_SRC_DIR}/src/tex2lyx/${LYX_CPP_FILES})
file(GLOB tex2lyx_headers ${TOP_SRC_DIR}/src/tex2lyx/${LYX_HPP_FILES})
+#if ! defined(LYX_DATE)
+ #include <lyx_date.h>
+#endif
///
extern char const * const lyx_version = PACKAGE_VERSION;
///
extern char const * const lyx_version = PACKAGE_VERSION;