From db53e4c0b860c7242a20c704982a20ab4c356594 Mon Sep 17 00:00:00 2001 From: Frederic Bouvier Date: Sun, 16 Sep 2012 19:26:12 +0200 Subject: [PATCH] Sort fgfs source files in IDE folders --- CMakeModules/FlightGearComponent.cmake | 15 +++++++++++---- src/Main/CMakeLists.txt | 20 ++++++++++++++++++++ 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/CMakeModules/FlightGearComponent.cmake b/CMakeModules/FlightGearComponent.cmake index 2274047c8..0136e447c 100644 --- a/CMakeModules/FlightGearComponent.cmake +++ b/CMakeModules/FlightGearComponent.cmake @@ -1,12 +1,19 @@ macro(flightgear_component name sources) + set(fc ${name}) + set(fh ${name}) foreach(s ${sources}) set_property(GLOBAL APPEND PROPERTY FG_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/${s}") + set(fc "${fc}#${CMAKE_CURRENT_SOURCE_DIR}/${s}") endforeach() - foreach(h ${ARGV2}) - set_property(GLOBAL - APPEND PROPERTY FG_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/${h}") - endforeach() + foreach(h ${ARGV2}) + set_property(GLOBAL + APPEND PROPERTY FG_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/${h}") + set(fh "${fh}#${CMAKE_CURRENT_SOURCE_DIR}/${h}") + endforeach() + + set_property(GLOBAL APPEND PROPERTY FG_GROUPS_C "${fc}@") + set_property(GLOBAL APPEND PROPERTY FG_GROUPS_H "${fh}@") endmacro() diff --git a/src/Main/CMakeLists.txt b/src/Main/CMakeLists.txt index 2a541e304..fe27f2db2 100644 --- a/src/Main/CMakeLists.txt +++ b/src/Main/CMakeLists.txt @@ -41,6 +41,26 @@ get_property(FG_HEADERS GLOBAL PROPERTY FG_HEADERS) link_directories ( ${Boost_LIBRARY_DIRS} ) +get_property(FG_GROUPS_C GLOBAL PROPERTY FG_GROUPS_C) +string(REPLACE "@" ";" groups ${FG_GROUPS_C} ) +foreach(g ${groups}) + string(REPLACE "#" ";" g2 ${g}) + list(GET g2 0 name) + list(REMOVE_AT g2 0) + source_group("${name}\\Sources" FILES ${g2}) +endforeach() + +get_property(FG_GROUPS_H GLOBAL PROPERTY FG_GROUPS_H) +string(REPLACE "@" ";" groups ${FG_GROUPS_H} ) +foreach(g ${groups}) + string(REPLACE "#" ";" g2 ${g}) + list(GET g2 0 name) + list(REMOVE_AT g2 0) + source_group("${name}\\Headers" FILES ${g2}) +endforeach() + +source_group("Main\\Headers" FILES ${HEADERS}) +source_group("Main\\Sources" FILES ${SOURCES}) add_executable(fgfs ${SOURCES} ${FG_SOURCES} ${FG_HEADERS} ${HEADERS}) get_property(FG_LIBS GLOBAL PROPERTY FG_LIBS)