Author: kuemmel Date: Mon Jan 10 23:47:58 2011 New Revision: 37169 URL: http://www.lyx.org/trac/changeset/37169
Log: cmake: make the merged build much more usable by adding all the source files to the IDE Modified: lyx-devel/trunk/development/cmake/modules/LyXMacros.cmake lyx-devel/trunk/development/cmake/src/CMakeLists.txt Modified: lyx-devel/trunk/development/cmake/modules/LyXMacros.cmake ============================================================================== --- lyx-devel/trunk/development/cmake/modules/LyXMacros.cmake Mon Jan 10 23:44:22 2011 (r37168) +++ lyx-devel/trunk/development/cmake/modules/LyXMacros.cmake Mon Jan 10 23:47:58 2011 (r37169) @@ -1,5 +1,5 @@ # -# Copyright (c) 2006, Peter K�mmel, <[email protected]> +# Copyright (c) 2006-2011 Peter K�mmel, <[email protected]> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -171,7 +171,13 @@ 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 @@ 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() Modified: lyx-devel/trunk/development/cmake/src/CMakeLists.txt ============================================================================== --- lyx-devel/trunk/development/cmake/src/CMakeLists.txt Mon Jan 10 23:44:22 2011 (r37168) +++ lyx-devel/trunk/development/cmake/src/CMakeLists.txt Mon Jan 10 23:47:58 2011 (r37169) @@ -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, <[email protected]> +# Copyright (c) 2006-2011 Peter K�mmel, <[email protected]> # set(_lyx ${PACKAGE_BASE}${PROGRAM_SUFFIX}) @@ -95,31 +95,9 @@ 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}
