# 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)
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)
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
--- /dev/null
+# 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)
+
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)
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)
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)
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})
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})
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)
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)
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)
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)
../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)