From 4993a5c6c04c32f62af801e03315ef481a6a1d47 Mon Sep 17 00:00:00 2001 From: Frederic Bouvier Date: Sun, 16 Sep 2012 21:19:11 +0200 Subject: [PATCH] Sort fgfs source files in IDE folders - Don't work for headers though --- CMakeModules/SimGearComponent.cmake | 7 ++++++ simgear/CMakeLists.txt | 38 ++++++++++++++++++++++++++++- 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/CMakeModules/SimGearComponent.cmake b/CMakeModules/SimGearComponent.cmake index 294a53a2..00944de3 100644 --- a/CMakeModules/SimGearComponent.cmake +++ b/CMakeModules/SimGearComponent.cmake @@ -1,14 +1,21 @@ macro(simgear_component_common name includePath sourcesList sources headers) + set(fc${sourcesList} ${name}) + set(fh${sourcesList} ${name}) foreach(s ${sources}) set_property(GLOBAL APPEND PROPERTY ${sourcesList} "${CMAKE_CURRENT_SOURCE_DIR}/${s}") + set(fc${sourcesList} "${fc${sourcesList}}#${CMAKE_CURRENT_SOURCE_DIR}/${s}") endforeach() foreach(h ${headers}) set_property(GLOBAL APPEND PROPERTY PUBLIC_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/${h}") + set(fh${sourcesList} "${fh${sourcesList}}#${CMAKE_CURRENT_SOURCE_DIR}/${h}") endforeach() + + set_property(GLOBAL APPEND PROPERTY FG_GROUPS_${sourcesList}_C "${fc${sourcesList}}@") + set_property(GLOBAL APPEND PROPERTY FG_GROUPS_${sourcesList}_H "${fh${sourcesList}}@") install (FILES ${headers} DESTINATION include/simgear/${includePath}) endmacro() diff --git a/simgear/CMakeLists.txt b/simgear/CMakeLists.txt index 62f4a405..38856434 100644 --- a/simgear/CMakeLists.txt +++ b/simgear/CMakeLists.txt @@ -90,11 +90,47 @@ if(SIMGEAR_SHARED) install(TARGETS SimGearCore LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) else() message(STATUS "Library building mode: STATIC LIBRARIES") - + + get_property(FG_GROUPS_CORE_SOURCES_C GLOBAL PROPERTY FG_GROUPS_CORE_SOURCES_C) + string(REPLACE "@" ";" groups ${FG_GROUPS_CORE_SOURCES_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_CORE_SOURCES_H GLOBAL PROPERTY FG_GROUPS_CORE_SOURCES_H) + string(REPLACE "@" ";" groups ${FG_GROUPS_CORE_SOURCES_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() + add_library(SimGearCore STATIC ${coreSources}) install(TARGETS SimGearCore ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) if(NOT SIMGEAR_HEADLESS) + get_property(FG_GROUPS_SCENE_SOURCES_C GLOBAL PROPERTY FG_GROUPS_SCENE_SOURCES_C) + string(REPLACE "@" ";" groups ${FG_GROUPS_SCENE_SOURCES_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_SCENE_SOURCES_H GLOBAL PROPERTY FG_GROUPS_SCENE_SOURCES_H) + string(REPLACE "@" ";" groups ${FG_GROUPS_SCENE_SOURCES_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() + add_library(SimGearScene STATIC ${sceneSources}) install(TARGETS SimGearScene ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif(NOT SIMGEAR_HEADLESS) -- 2.39.5