]> git.mxchange.org Git - simgear.git/blob - CMakeModules/SimGearComponent.cmake
Fix header installation for shared build
[simgear.git] / CMakeModules / SimGearComponent.cmake
1
2 macro(simgear_component_common name includePath sourcesList sources headers)
3     if (SIMGEAR_SHARED)
4
5         foreach(s ${sources})
6             set_property(GLOBAL
7                 APPEND PROPERTY ${sourcesList} "${CMAKE_CURRENT_SOURCE_DIR}/${s}")
8         endforeach()
9
10                 foreach(h ${headers})
11                         set_property(GLOBAL
12                                 APPEND PROPERTY PUBLIC_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/${h}")
13                 endforeach()
14         
15     else()
16         set(libName "sg${name}")
17         add_library(${libName} STATIC ${sources} ${headers})
18
19         install (TARGETS ${libName} ARCHIVE DESTINATION lib${LIB_SUFFIX})
20     endif()
21     
22     install (FILES ${headers}  DESTINATION include/simgear/${includePath})
23 endmacro()
24
25 function(simgear_component name includePath sources headers)
26     simgear_component_common(${name} ${includePath} CORE_SOURCES "${sources}" "${headers}")
27 endfunction()
28
29 function(simgear_scene_component name includePath sources headers)
30     simgear_component_common(${name} ${includePath} SCENE_SOURCES "${sources}" "${headers}")
31 endfunction()