1
0
Fork 0

Sort fgfs source files in IDE folders

This commit is contained in:
Frederic Bouvier 2012-09-16 19:26:12 +02:00
parent 6f5afd9be7
commit db53e4c0b8
2 changed files with 31 additions and 4 deletions

View file

@ -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}")
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()

View file

@ -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)