more flexible msvc project folder generation, flat is default

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14887 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Peter Kümmel 2006-09-03 23:50:16 +00:00
parent 2d8f06d61e
commit 1fbce8c2b6
14 changed files with 63 additions and 21 deletions

View 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)

View 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)

View 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)

View File

@ -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)

View 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)

View 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)

View 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)

View 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})

View 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})

View 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)

View 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)

View 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)

View 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)

View 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)