cmake: simplify all-in-one file naming

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17722 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Peter Kümmel 2007-04-04 19:21:16 +00:00
parent afd9d1b40a
commit 66aea64a21
12 changed files with 26 additions and 25 deletions

View File

@ -19,7 +19,7 @@ if(NOT MERGE_FILES)
add_library(boost_filesystem STATIC ${boost_filesystem_sources})
else(NOT MERGE_FILES)
add_definitions(-D_WIN32_WINNT=0x500)
lyx_const_touched_files(_allinone const_touched_files boost_filesystem_sources)
add_library(boost_filesystem STATIC ${const_touched_files})
lyx_const_touched_files(_allinone boost_filesystem_sources)
add_library(boost_filesystem STATIC ${_allinone_files})
endif(NOT MERGE_FILES)

View File

@ -19,8 +19,8 @@ include_directories(${ZLIB_INCLUDE_DIR})
if(NOT MERGE_FILES)
add_library(boost_iostreams STATIC ${boost_iostreams_sources})
else(NOT MERGE_FILES)
lyx_const_touched_files(_allinone const_touched_files boost_iostreams_sources)
add_library(boost_iostreams STATIC ${const_touched_files})
lyx_const_touched_files(_allinone boost_iostreams_sources)
add_library(boost_iostreams STATIC ${_allinone_files})
endif(NOT MERGE_FILES)

View File

@ -19,7 +19,7 @@ lyx_add_path(boost_signals_sources ${TOP_SRC_DIR}/boost/libs/signals/src)
if(NOT MERGE_FILES)
add_library(boost_signals STATIC ${boost_signals_sources})
else(NOT MERGE_FILES)
lyx_const_touched_files(_allinone const_touched_files boost_signals_sources)
add_library(boost_signals STATIC ${const_touched_files})
lyx_const_touched_files(_allinone boost_signals_sources)
add_library(boost_signals STATIC ${_allinone_files})
endif(NOT MERGE_FILES)

View File

@ -126,7 +126,8 @@ MACRO (LYX_AUTOMOC)
endmacro (LYX_AUTOMOC)
macro(lyx_const_touched_files _allinone_name _new_list _list)
macro(lyx_const_touched_files _allinone_name _list)
set(_file_list ${_allinone_name}_files)
set(_file_const ${CMAKE_CURRENT_BINARY_DIR}/${_allinone_name}_const.C)
set(_file_touched ${CMAKE_CURRENT_BINARY_DIR}/${_allinone_name}_touched.C)
@ -138,7 +139,7 @@ macro(lyx_const_touched_files _allinone_name _new_list _list)
file(APPEND ${_file_touched} "#define DONT_INCLUDE_CONST_FILES\n")
file(APPEND ${_file_touched} "#include \"${_file_const}\"\n\n\n")
set(${_new_list} ${_file_const} ${_file_touched})
set(${_file_list} ${_file_const} ${_file_touched})
foreach (_current_FILE ${${_list}})
get_filename_component(_abs_FILE ${_current_FILE} ABSOLUTE)
@ -146,7 +147,7 @@ macro(lyx_const_touched_files _allinone_name _new_list _list)
# because then cmake will not know the dependencies
get_source_file_property(_isGenerated ${_abs_FILE} GENERATED)
if (_isGenerated)
list(APPEND ${_new_list} ${_abs_FILE})
list(APPEND ${_file_list} ${_abs_FILE})
else (_isGenerated)
GET_FILENAME_COMPONENT(_file_name ${_abs_FILE} NAME_WE)
STRING(REGEX REPLACE "-" "_" _file_name "${_file_name}" )

View File

@ -43,8 +43,8 @@ lyx_add_msvc_pch(lyx)
if(NOT MERGE_FILES)
set(lyx_sources ${lyx_sources} ${CMAKE_CURRENT_BINARY_DIR}/version.C)
else(NOT MERGE_FILES)
lyx_const_touched_files(_allinone const_touched_files lyx_sources)
set(lyx_sources ${const_touched_files} ${CMAKE_CURRENT_BINARY_DIR}/version.C
lyx_const_touched_files(_allinone lyx_sources)
set(lyx_sources ${_allinone_files} ${CMAKE_CURRENT_BINARY_DIR}/version.C
)
endif(NOT MERGE_FILES)

View File

@ -21,8 +21,8 @@ lyx_add_msvc_pch(frontends)
if(NOT MERGE_FILES)
add_library(frontends ${library_type} ${frontends_sources} ${frontends_headers})
else(NOT MERGE_FILES)
lyx_const_touched_files(_allinone const_touched_files frontends_sources)
add_library(frontends ${library_type} ${const_touched_files})
lyx_const_touched_files(_allinone frontends_sources)
add_library(frontends ${library_type} ${_allinone_files})
endif(NOT MERGE_FILES)
project_source_group("${GROUP_CODE}" frontends_sources frontends_headers)

View File

@ -16,8 +16,8 @@ include_directories(${TOP_SRC_DIR}/src/frontends/controllers)
if(NOT MERGE_FILES)
add_library(controllers ${library_type} ${controllers_sources} ${controllers_headers})
else(NOT MERGE_FILES)
lyx_const_touched_files(_allinone const_touched_files controllers_sources)
add_library(controllers ${library_type} ${const_touched_files})
lyx_const_touched_files(_allinone controllers_sources)
add_library(controllers ${library_type} ${_allinone_files})
endif(NOT MERGE_FILES)
target_link_libraries(controllers boost_regex boost_filesystem)

View File

@ -37,12 +37,12 @@ if(MERGE_FILES)
list(REVERSE frontends_qt4_sources)
list(REMOVE_ITEM frontends_qt4_sources ${TOP_SRC_DIR}/src/frontends/qt4/GuiApplication.C)
list(APPEND frontends_qt4_sources ${TOP_SRC_DIR}/src/frontends/qt4/GuiApplication.C)
lyx_const_touched_files(_allinone const_touched_files frontends_qt4_sources)
lyx_const_touched_files(_allinone frontends_qt4_sources)
set(depends_moc_uic ${frontends_qt4_headers} ${ui_files})
SET_SOURCE_FILES_PROPERTIES(_allinone_const.C PROPERTIES OBJECT_DEPENDS "${depends_moc_uic}")
SET_SOURCE_FILES_PROPERTIES(_allinone_touched.C PROPERTIES OBJECT_DEPENDS "${depends_moc_uic}")
add_library(frontend_qt4 ${library_type}
${const_touched_files}
${_allinone_files}
${frontends_qt4_headers}
${ui_files}
)

View File

@ -17,8 +17,8 @@ include_directories(${TOP_SRC_DIR}/src/graphics)
if(NOT MERGE_FILES)
add_library(graphics ${library_type} ${graphics_sources} ${graphics_headers})
else(NOT MERGE_FILES)
lyx_const_touched_files(_allinone const_touched_files graphics_sources)
add_library(graphics ${library_type} ${const_touched_files})
lyx_const_touched_files(_allinone graphics_sources)
add_library(graphics ${library_type} ${_allinone_files})
endif(NOT MERGE_FILES)
project_source_group("${GROUP_CODE}" graphics_sources graphics_headers)

View File

@ -19,8 +19,8 @@ include_directories(${TOP_SRC_DIR}/src/insets)
if(NOT MERGE_FILES)
add_library(insets ${library_type} ${insets_sources} ${insets_headers})
else(NOT MERGE_FILES)
lyx_const_touched_files(_allinone const_touched_files insets_sources)
add_library(insets ${library_type} ${const_touched_files})
lyx_const_touched_files(_allinone insets_sources)
add_library(insets ${library_type} ${_allinone_files})
endif(NOT MERGE_FILES)

View File

@ -20,8 +20,8 @@ include_directories(${TOP_SRC_DIR}/src/mathed)
if(NOT MERGE_FILES)
add_library(mathed ${library_type} ${mathed_sources} ${mathed_headers})
else(NOT MERGE_FILES)
lyx_const_touched_files(_allinone const_touched_files mathed_sources)
add_library(mathed ${library_type} ${const_touched_files})
lyx_const_touched_files(_allinone mathed_sources)
add_library(mathed ${library_type} ${_allinone_files})
endif(NOT MERGE_FILES)

View File

@ -35,8 +35,8 @@ else(NOT MERGE_FILES)
list(REMOVE_ITEM support_sources ${TOP_SRC_DIR}/src/support/lstrings.C)
list(APPEND support_sources ${TOP_SRC_DIR}/src/support/lstrings.C)
list(REVERSE support_sources)
lyx_const_touched_files(_allinone const_touched_files support_sources)
add_library(support ${library_type} ${const_touched_files})
lyx_const_touched_files(_allinone support_sources)
add_library(support ${library_type} ${_allinone_files})
endif(NOT MERGE_FILES)