]> git.mxchange.org Git - simgear.git/blob - CMakeModules/SimGearComponent.cmake
use safer stl functions instead of pointer operations
[simgear.git] / CMakeModules / SimGearComponent.cmake
1
2 macro(simgear_component_common name includePath sourcesList sources headers)
3     set(fc${sourcesList} ${name})
4     set(fh${sourcesList} ${name})
5     foreach(s ${sources})
6         set_property(GLOBAL
7             APPEND PROPERTY ${sourcesList} "${CMAKE_CURRENT_SOURCE_DIR}/${s}")
8         set(fc${sourcesList} "${fc${sourcesList}}#${CMAKE_CURRENT_SOURCE_DIR}/${s}")
9     endforeach()
10
11         foreach(h ${headers})
12                 set_property(GLOBAL
13                         APPEND PROPERTY PUBLIC_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/${h}")
14         set(fh${sourcesList} "${fh${sourcesList}}#${CMAKE_CURRENT_SOURCE_DIR}/${h}")
15         endforeach()
16
17     set_property(GLOBAL APPEND PROPERTY FG_GROUPS_${sourcesList}_C "${fc${sourcesList}}@")
18     set_property(GLOBAL APPEND PROPERTY FG_GROUPS_${sourcesList}_H "${fh${sourcesList}}@")
19     
20     install (FILES ${headers}  DESTINATION include/simgear/${includePath})
21 endmacro()
22
23 function(simgear_component name includePath sources headers)
24     simgear_component_common(${name} ${includePath} CORE_SOURCES "${sources}" "${headers}")
25 endfunction()
26
27 function(simgear_scene_component name includePath sources headers)
28     simgear_component_common(${name} ${includePath} SCENE_SOURCES "${sources}" "${headers}")
29 endfunction()