]> git.lyx.org Git - features.git/commitdiff
final compilation: wheel was already invented :(
authorPeter Kümmel <syntheticpp@gmx.net>
Fri, 23 Mar 2007 23:56:27 +0000 (23:56 +0000)
committerPeter Kümmel <syntheticpp@gmx.net>
Fri, 23 Mar 2007 23:56:27 +0000 (23:56 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17529 a592a061-630c-0410-9148-cb99ea01b6c8

boost/boost/spirit/utility/loops.hpp
boost/libs/filesystem/src/operations.cpp
development/cmake/modules/LyXMacros.cmake
development/cmake/src/frontends/qt4/CMakeLists.txt
development/cmake/src/tex2lyx/CMakeLists.txt
src/cursor.C
src/support/lstrings.C

index f42776a029f0f9a71c647692357a44caac4d9dcb..65cc4a306516df309653ce95b134dcdb71858b71 100644 (file)
@@ -208,7 +208,7 @@ namespace boost { namespace spirit {
             result_t hit = scan.empty_match();
             std::size_t n = m_min;
 
-            for (std::size_t i = 0; ; ++i)
+            for (std::size_t i = 0;; ++i)
             {
                 typename ScannerT::iterator_t save = scan.first;
                 result_t next = this->subject().parse(scan);
index c51f5246fca412819ee777299e85bed0fb66d408..e42e7a7f50406d10bbd225984c1559e7c86ca94e 100644 (file)
@@ -680,7 +680,7 @@ namespace boost
       {
         std::string narrow_short_form;
         std::wstring short_form;
-        for ( DWORD buf_sz( static_cast<DWORD>( ph.size()+1 )); ; )
+        for ( DWORD buf_sz( static_cast<DWORD>( ph.size()+1 ));; )
         {
           boost::scoped_array<wchar_t> buf( new wchar_t[buf_sz] );
           DWORD sz( ::GetShortPathNameW( ph.c_str(), buf.get(), buf_sz ) );
@@ -1040,7 +1040,7 @@ namespace boost
       BOOST_FILESYSTEM_DECL fs::system_error_type 
       get_current_path_api( std::string & ph )
       {
-        for ( long path_max = 32; ; path_max *=2 ) // loop 'til buffer large enough
+        for ( long path_max = 32;; path_max *=2 ) // loop 'til buffer large enough
         {
           boost::scoped_array<char>
             buf( new char[static_cast<std::size_t>(path_max)] );
index 7a946e3a145ee1f646673a2ab1cebb8583729bb8..3b157a322bff90423217c8b3a044f496e49df7f4 100644 (file)
@@ -126,16 +126,36 @@ MACRO (LYX_AUTOMOC)
 endmacro (LYX_AUTOMOC)
 
 
-macro(lyx_merge_files _filename _list)
-       message("----- Generating merged file ${_filename}\n")  
-       set(_tmp)
-       set(_content)
-       foreach(_current ${${_list}})
-               file(READ ${_current} _tmp)
-               set(_content ${_content} "\n\n\n\n//----------------------------------------\n/*\n file: ${_current} \n*/\n\n")
-               set(_content ${_content} ${_tmp})
-       endforeach(_current)
-       file(WRITE ${_filename} "${_content}")
-endmacro(lyx_merge_files _list _filename)
+# For all C++ sources a big source file which includes all the files
+# is created.
+# This is not done for the C sources, they are just gathered in a separate list
+# because they are usually not written by KDE and as such not intended to be
+# compiled all-in-one.
+macro (KDE4_CREATE_FINAL_FILES _filenameCPP _filesExcludedFromFinalFile )
+   set(${_filesExcludedFromFinalFile})
+   file(WRITE ${_filenameCPP} "//autogenerated file\n")
+   foreach (_current_FILE ${ARGN})
+      get_filename_component(_abs_FILE ${_current_FILE} ABSOLUTE)
+      # don't include any generated files in the final-file
+      # because then cmake will not know the dependencies
+      get_source_file_property(_isGenerated ${_abs_FILE} GENERATED)
+      if (_isGenerated)
+         list(APPEND ${_filesExcludedFromFinalFile} ${_abs_FILE})
+      else (_isGenerated)
+         # don't include c-files in the final-file, because they usually come
+         # from a 3rd party and as such are not intended to be compiled all-in-one
+         string(REGEX MATCH ".+\\.c$" _isCFile ${_abs_FILE})
+         if (_isCFile)
+            list(APPEND ${_filesExcludedFromFinalFile} ${_abs_FILE})
+         else (_isCFile)
+            file(APPEND ${_filenameCPP} "#include \"${_abs_FILE}\"\n")
+         endif (_isCFile)
+      endif (_isGenerated)
+   endforeach (_current_FILE)
+
+endmacro (KDE4_CREATE_FINAL_FILES)
 
 
+macro(lyx_merge_files _filename _list)
+       KDE4_CREATE_FINAL_FILES(${_filename} _nix_nothing ${${_list}})
+endmacro(lyx_merge_files _list _filename)
\ No newline at end of file
index 4d07fd83f5c696d392ea0e621800c17a9e24675c..dfc1e03009a8e0691c876e3e0188027b503b9e41 100644 (file)
@@ -31,6 +31,7 @@ include_directories(
                        ${TOP_SRC_DIR}/src/frontends/controllers
                        ${CMAKE_CURRENT_BINARY_DIR})
 
+#set(MERGE_FILES 0)
 if(MERGE_FILES AND MSVC)
        lyx_merge_files(${CMAKE_CURRENT_BINARY_DIR}/frontends_qt4_allinone.C frontends_qt4_sources)
        set(depends_moc_uic ${frontends_qt4_headers} ${ui_files})
index e206f44ecf035baad267f4d0abc12e10c1d89665..8c4cc874e748d88d2ed5ec9012b60bd990cd054d 100644 (file)
@@ -54,14 +54,14 @@ else(MSVC)
                "-include ${TOP_SRC_DIR}/src/tex2lyx/lyxfont.h -include ${TOP_SRC_DIR}/src/tex2lyx/Spacing.h")
 endif(MSVC)
 
-
-if(NOT MERGE_FILES)
+#TODO
+#if(NOT MERGE_FILES)
        add_executable(tex2lyx ${tex2lyx_sources} ${LINKED_FILES} ${tex2lyx_headers})
-else(NOT MERGE_FILES)
-       set(tex2lyx_sources_all ${tex2lyx_sources} ${LINKED_FILES})
-       lyx_merge_files(${CMAKE_CURRENT_BINARY_DIR}/tex2lyx_allinone.C tex2lyx_sources_all)
-       add_executable(tex2lyx ${CMAKE_CURRENT_BINARY_DIR}/tex2lyx_allinone.C)
-endif(NOT MERGE_FILES)
+#else(NOT MERGE_FILES)
+#      set(tex2lyx_sources_all ${tex2lyx_sources} ${LINKED_FILES})
+#      lyx_merge_files(${CMAKE_CURRENT_BINARY_DIR}/tex2lyx_allinone.C tex2lyx_sources_all)
+#      add_executable(tex2lyx ${CMAKE_CURRENT_BINARY_DIR}/tex2lyx_allinone.C)
+#endif(NOT MERGE_FILES)
 
 
 target_link_libraries(tex2lyx  
index 5d72bfff899f041ceae47652e21bfcecaca1b144..387fb087df072c30d9203883cffcb069491a37dd 100644 (file)
@@ -93,7 +93,7 @@ namespace {
                it.top().pos() = 0;
                DocIterator et = c;
                et.top().pos() = et.top().asInsetMath()->cell(et.top().idx()).size();
-               for (size_t i = 0; ; ++i) {
+               for (size_t i = 0;; ++i) {
                        int xo;
                        int yo;
                        InsetBase const * inset = &it.inset();
index 2ed7d93e4cd405aef1003ee50f06d7077e709781..fe161be9913257702d9375a4be697dae9de562db 100644 (file)
@@ -753,7 +753,7 @@ getVectorFromStringT(String const & str, String const & delim)
        if (str.empty())
                return vec;
        String keys = rtrim(str);
-       for(; ;) {
+       for(;;) {
                typename String::size_type const idx = keys.find(delim);
                if (idx == String::npos) {
                        vec.push_back(ltrim(keys));