From 715b9e92bd09b6aca58463f7ef2d1556975cafb8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Peter=20K=C3=BCmmel?= Date: Mon, 10 Jan 2011 22:47:58 +0000 Subject: [PATCH] cmake: make the merged build much more usable by adding all the source files to the IDE git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37169 a592a061-630c-0410-9148-cb99ea01b6c8 --- development/cmake/modules/LyXMacros.cmake | 34 +++++++++++++++++++++-- development/cmake/src/CMakeLists.txt | 30 +++----------------- 2 files changed, 36 insertions(+), 28 deletions(-) diff --git a/development/cmake/modules/LyXMacros.cmake b/development/cmake/modules/LyXMacros.cmake index b1898fb40e..eec6ff7ee4 100644 --- a/development/cmake/modules/LyXMacros.cmake +++ b/development/cmake/modules/LyXMacros.cmake @@ -1,5 +1,5 @@ # -# Copyright (c) 2006, Peter Kümmel, +# Copyright (c) 2006-2011 Peter Kümmel, # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -171,7 +171,13 @@ macro(lyx_const_touched_files _allinone_name _list) file(APPEND ${_file_touched} "#include \"${_file_const}\"\n\n\n") endif() - set(${_file_list} ${_file_const} ${_file_touched}) + #add merged files also to the project so they become editable + if(${GROUP_CODE} MATCHES "flat") + lyx_add_info_files_no_group(${${_list}}) + else() + lyx_add_info_files(MergedFiles ${${_list}}) + endif() + set(${_file_list} ${_file_const} ${_file_touched} ${lyx_${groupname}_info_files}) foreach (_current_FILE ${${_list}}) get_filename_component(_abs_FILE ${_current_FILE} ABSOLUTE) @@ -252,3 +258,27 @@ macro(LYX_OPTION _name _description _default _sys) endif() endmacro() +macro(lyx_add_info_files group) + foreach(_it ${ARGN}) + if(NOT IS_DIRECTORY ${_it}) + get_filename_component(name ${_it} NAME) + if(NOT ${_it} MATCHES "^/\\\\..*$;~$") + set_source_files_properties(${_it} PROPERTIES HEADER_FILE_ONLY TRUE) + set(lyx_${group}_info_files ${lyx_${group}_info_files} ${_it}) + endif() + endif() + endforeach() + if(group) + source_group(${group} FILES ${lyx_${group}_info_files}) + endif() + set(lyx_info_files ${lyx_info_files} ${lyx_${group}_info_files}) +endmacro() + +macro(lyx_add_info_files_no_group) + lyx_add_info_files( "" ${ARGN}) +endmacro() + +macro(lyx_find_info_files group files) + file(GLOB _filelist ${files}) + lyx_add_info_files(${group} ${_filelist}) +endmacro() diff --git a/development/cmake/src/CMakeLists.txt b/development/cmake/src/CMakeLists.txt index c75cf8033f..773bfb2bcf 100644 --- a/development/cmake/src/CMakeLists.txt +++ b/development/cmake/src/CMakeLists.txt @@ -1,7 +1,7 @@ # This file is part of LyX, the document processor. # Licence details can be found in the file COPYING. # -# Copyright (c) 2006, Peter Kümmel, +# Copyright (c) 2006-2011 Peter Kümmel, # set(_lyx ${PACKAGE_BASE}${PROGRAM_SUFFIX}) @@ -95,31 +95,9 @@ if(WIN32) message(STATUS "Using icon defined in resource file: ${FILE_RC}") endif() -if(MSVC_IDE) - file(GLOB info_files ${TOP_SRC_DIR}/*) - set(lyx_info_files) - foreach(_it ${info_files}) - if(NOT IS_DIRECTORY ${_it}) - set_source_files_properties(${_it} PROPERTIES HEADER_FILE_ONLY TRUE) - set(lyx_info_files ${lyx_info_files} ${_it}) - endif() - endforeach() - source_group(LyXInfoFiles FILES ${lyx_info_files}) - - file(GLOB cmake_files1 ${TOP_SRC_DIR}/development/cmake/*) - file(GLOB cmake_files2 ${TOP_SRC_DIR}/development/cmake/modules/*) - set(lyx_cmake_files) - foreach(_it ${cmake_files1} ${cmake_files2}) - if(NOT IS_DIRECTORY ${_it}) - get_filename_component(name ${_it} NAME) - if(NOT name STREQUAL CMakeLists.txt AND NOT ${_it} MATCHES "^/\\\\..*$;~$") - set_source_files_properties(${_it} PROPERTIES HEADER_FILE_ONLY TRUE) - set(lyx_cmake_files ${lyx_cmake_files} ${_it}) - endif() - endif() - endforeach() - source_group(LyXCMakeFiles FILES ${lyx_cmake_files}) -endif() +lyx_find_info_files(LyXInfoFiles ${TOP_SRC_DIR}/*) +lyx_find_info_files(LyXCMakeFiles ${TOP_SRC_DIR}/development/cmake/*) +lyx_find_info_files(LyXCMakeFiles ${TOP_SRC_DIR}/development/cmake/modules/*) add_executable(${_lyx} ${WIN32_CONSOLE} -- 2.39.2