]> git.lyx.org Git - features.git/commitdiff
Cmake build:
authorKornel Benko <kornel@lyx.org>
Mon, 15 Oct 2012 20:50:39 +0000 (22:50 +0200)
committerKornel Benko <kornel@lyx.org>
Mon, 15 Oct 2012 20:50:39 +0000 (22:50 +0200)
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

CMakeLists.txt
development/cmake/lyx_date.h.cmake [new file with mode: 0644]
src/CMakeLists.txt
src/tex2lyx/CMakeLists.txt
src/version.cpp

index 00fe87056a0198f7d484cdd705e95d8e8193f6eb..700ff0484537949113af8722e2c99820b5fb40fd 100644 (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]+).*")
diff --git a/development/cmake/lyx_date.h.cmake b/development/cmake/lyx_date.h.cmake
new file mode 100644 (file)
index 0000000..ddbffea
--- /dev/null
@@ -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
+
index 7f57845bf1bad13319eb6ef105b278ded0964cf9..5862136f017521e36c8bd68b13f6eab9e7a13300 100644 (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)
index 4fa809a395394d607322efce024abcdf5919559d..1952a81251ba7410e78e63759d652e844149ed99 100644 (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})
index 2ae59923a21244294827aadb8f963aa069d69f97..1e4aa324396b0a90fb026f3d3a92d495979f5d07 100644 (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;