]> git.lyx.org Git - features.git/commitdiff
more flexible msvc project folder generation, flat is default
authorPeter Kümmel <syntheticpp@gmx.net>
Sun, 3 Sep 2006 23:50:16 +0000 (23:50 +0000)
committerPeter Kümmel <syntheticpp@gmx.net>
Sun, 3 Sep 2006 23:50:16 +0000 (23:50 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14887 a592a061-630c-0410-9148-cb99ea01b6c8

14 files changed:
development/cmake/CMakeLists.txt
development/cmake/intl/CMakeLists.txt
development/cmake/modules/LyXMacros.cmake
development/cmake/modules/ProjectSourceGroup.cmake [new file with mode: 0755]
development/cmake/src/CMakeLists.txt
development/cmake/src/frontends/CMakeLists.txt
development/cmake/src/frontends/controllers/CMakeLists.txt
development/cmake/src/frontends/qt3/CMakeLists.txt
development/cmake/src/frontends/qt4/CMakeLists.txt
development/cmake/src/graphics/CMakeLists.txt
development/cmake/src/insets/CMakeLists.txt
development/cmake/src/mathed/CMakeLists.txt
development/cmake/src/support/CMakeLists.txt
development/cmake/src/tex2lyx/CMakeLists.txt

index c2708c95b7db81d24250eb710adcff2fdc24a435..bfa27f8307859c7e8fc0622d0c44e45cf89e61b3 100644 (file)
@@ -1,12 +1,14 @@
 # where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
 set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/modules")
 
-if(NOT CODE_GROUP_NAME)
-set(CODE_GROUP_NAME "The Golden Code")
-endif(NOT CODE_GROUP_NAME)
+if(NOT GROUP_CODE)
+       #set(GROUP_CODE "The Golden Code")
+       set(GROUP_CODE flat)
+endif(NOT GROUP_CODE)
 
 include(LyXPaths)
 include(LyXMacros)
+include(ProjectSourceGroup)
 
 if(release)
        set(CMAKE_BUILD_TYPE Release)
index 8dd321eb58df45bfc5864987dbb354247c124d39..6ccbc96fe62dbb23ee33fb87ed3e7311ce36b293 100644 (file)
@@ -78,5 +78,5 @@ if(ICONV_FOUND)
        target_link_libraries(intl ${ICONV_LIBRARY})
 endif(ICONV_FOUND)
 
-source_group("${CODE_GROUP_NAME}" FILES ${intl_sources} ${intl_headers})
+project_source_group("${GROUP_CODE}" intl_sources intl_headers)
 
index de5b3c62d40480e1444df9a0fbef61f4d2ac1c50..e17339d5b03d75a3a17590705e9bbb2badc275dd 100644 (file)
@@ -99,3 +99,22 @@ MACRO (LYX_AUTOMOC)
    endforeach (_current_FILE)
 endmacro (LYX_AUTOMOC)
 
+
+
+# folders in the project
+# mode==flat  : no folders
+# mode==split : standart behavior of cmake, split heders and sources
+# mode== <other values" : code is in this folder
+macro(project_source_group mode sources headers)
+       #message(STATUS ${mode})
+       #message(STATUS ${sources} ${headers})
+       if(${mode} MATCHES "flat")
+               source_group("Source Files" Files)
+               source_group("Header Files" Files)
+       else(${mode} MATCHES "flat")
+               if(NOT ${mode} MATCHES "split")
+                       source_group("${mode}" FILES ${${sources}} ${${headers}})
+                       source_group("cmake" FILES CMakeLists.txt)
+               endif(NOT ${mode} MATCHES "split")
+       endif(${mode} MATCHES "flat")
+endmacro(project_source_group mode sources headers)
\ No newline at end of file
diff --git a/development/cmake/modules/ProjectSourceGroup.cmake b/development/cmake/modules/ProjectSourceGroup.cmake
new file mode 100755 (executable)
index 0000000..713a67a
--- /dev/null
@@ -0,0 +1,18 @@
+# folders in the msvc projects
+# mode==flat  : headers and ourses in no folders
+# mode==split : standard behavior of cmake, split headers and sources
+# mode== <other values" : code is in this folder
+macro(project_source_group mode sources headers)
+       #message(STATUS ${mode})
+       #message(STATUS ${sources} ${headers})
+       if(${mode} MATCHES "flat")
+               source_group("Source Files" Files)
+               source_group("Header Files" Files)
+               source_group("cmake" FILES CMakeLists.txt)
+       else(${mode} MATCHES "flat")
+               if(NOT ${mode} MATCHES "split")
+                       source_group("${mode}" FILES ${${sources}} ${${headers}})
+               endif(NOT ${mode} MATCHES "split")
+       endif(${mode} MATCHES "flat")
+endmacro(project_source_group mode sources headers)
+
index da017e44dc14bba02cf9d12deb30a6b66baa1e1a..cd3f4c5b7fc6a40db11966cabd63295154914a76 100644 (file)
@@ -55,6 +55,6 @@ if(ASPELL_FOUND)
        target_link_libraries(lyx-${qt_postfix} ${ASPELL_LIBRARY})
 endif(ASPELL_FOUND)
 
-source_group("${CODE_GROUP_NAME}" FILES ${lyx_sources} ${lyx_headers})
+project_source_group("${GROUP_CODE}" lyx_sources lyx_headers)
 
 
index b5e28f57b0d46c10a968cdd8481d176594f0f43a..190363f5c21454aa22516ca716bdd2ea5126b8d2 100644 (file)
@@ -12,5 +12,5 @@ file(GLOB frontends_headers ${TOP_SRC_DIR}/src/frontends/*.h)
 
 add_library(frontends STATIC ${frontends_sources} ${frontends_headers})
 
-source_group("${CODE_GROUP_NAME}" FILES ${frontends_sources} ${frontends_headers})
+project_source_group("${GROUP_CODE}" frontends_sources frontends_headers)
 
index fb3481f550b6f31fa4e223aafe0da3910da4233a..f186b10eb8ad748c0cdacb1ab9b5d95e1ee09a0e 100644 (file)
@@ -9,5 +9,5 @@ add_library(controllers STATIC ${controllers_sources} ${controllers_headers})
 
 target_link_libraries(controllers boost_regex boost_filesystem)
 
-source_group("${CODE_GROUP_NAME}" FILES ${controllers_sources} ${controllers_headers})
+project_source_group("${GROUP_CODE}" controllers_sources controllers_headers)
 
index 177e50e9c6cb831df2531e26850d9549b180f248..71469c027a019bfba60be49454b02314bf9d7172 100644 (file)
@@ -35,6 +35,6 @@ if(WIN32)
        target_link_libraries(frontend_qt3 Gdi32)
 endif(WIN32)
 
-source_group("${CODE_GROUP_NAME}" FILES ${frontends_qt3_sources} ${frontends_qt3_headers})
+project_source_group("${GROUP_CODE}" frontends_qt3_sources frontends_qt3_headers)
 source_group("Uic files" FILES ${frontend_qt3_UI})
 
index 643a498808c334aaccbecbcbd42630419f9ffb7b..edb37a9d91c60980b4289f0ee7de739a03474c36 100644 (file)
@@ -29,6 +29,6 @@ if(WIN32)
        target_link_libraries(frontend_qt4 Gdi32)
 endif(WIN32)
 
-source_group("${CODE_GROUP_NAME}" FILES ${frontends_qt4_sources} ${frontends_qt4_headers})
+project_source_group("${GROUP_CODE}" frontends_qt4_sources frontends_qt4_headers)
 source_group("Uic files" FILES ${frontend_qt4_UI})
 
index 18ce3aca0f7a6be3929596ffd0304433502409ea..ceec79683af87cd72c01b35c3db2254025042b94 100644 (file)
@@ -7,5 +7,5 @@ include_directories(${TOP_SRC_DIR}/src/graphics)
 
 add_library(graphics STATIC ${graphics_sources} ${graphics_headers})
 
-source_group("${CODE_GROUP_NAME}" FILES ${graphics_sources} ${graphics_headers})
+project_source_group("${GROUP_CODE}" graphics_sources graphics_headers)
 
index 34bb500cff2a55ce1b558ad532af3ecca4952b53..4f7fbb746bd7c27ff338924f38d89e5589afffb3 100644 (file)
@@ -9,5 +9,5 @@ include_directories(${TOP_SRC_DIR}/src/insets)
 
 add_library(insets STATIC ${insets_sources} ${insets_headers})
 
-source_group("${CODE_GROUP_NAME}" FILES ${insets_sources} ${insets_headers})
+project_source_group("${GROUP_CODE}" insets_sources insets_headers)
 
index 92adc4188fe8e2c17d7b608ba25d238ea4eb8b55..635dbdcd7a27b938167dfc5d4bf5a651a6e5b2c5 100644 (file)
@@ -12,5 +12,5 @@ include_directories(${TOP_SRC_DIR}/src/mathed)
 
 add_library(mathed STATIC ${mathed_sources} ${mathed_headers})
 
-source_group("${CODE_GROUP_NAME}" FILES ${mathed_sources} ${mathed_headers})
+project_source_group("${GROUP_CODE}" mathed_sources mathed_headers)
 
index b083f3a46fe097559c9d0d255b91bf6233d859fd..c25b06a88e69775209a8e5a5082a55ea3c3af4e0 100644 (file)
@@ -27,5 +27,5 @@ if(WIN32)
        target_link_libraries(support shlwapi)
 endif(WIN32)
 
-source_group("${CODE_GROUP_NAME}" FILES ${support_sources} ${support_headers})
+project_source_group("${GROUP_CODE}" support_sources support_headers)
 
index 8af96a6fb3864f3ce7094d1ebbed2c02f14d6ede..8872adebb14e25f28dc560eacdca43ce17488ee4 100644 (file)
@@ -13,30 +13,33 @@ set(LINKED_FILES
        ../lyxlex_pimpl.C
 )
 
-set(tex2lyx_SRCS 
+set(tex2lyx_sources
        ${LINKED_FILES}
-       Spacing.h 
        boost.C 
        context.C 
-       context.h 
        gettext.C 
-       gettext.h 
        lengthcommon.C 
        lyxfont.C 
-       lyxfont.h 
        texparser.C 
-       texparser.h 
        tex2lyx.C 
-       tex2lyx.h 
        preamble.C 
        math.C 
        table.C 
        text.C 
 )
 
+set(tex2lyx_headers
+       Spacing.h 
+       context.h 
+       gettext.h 
+       lyxfont.h 
+       texparser.h 
+       tex2lyx.h 
+)
+
 add_executable(tex2lyx ${tex2lyx_SRCS})
 
 target_link_libraries(tex2lyx  support )
 
-source_group("${CODE_GROUP_NAME}" FILES ${tex2lyx_SRCS})
+project_source_group("${GROUP_CODE}" tex2lyx_sources tex2lyx_headers)