2010-11-26 18:04:54 +08:00
|
|
|
|
2011-11-29 06:43:57 +08:00
|
|
|
macro(simgear_component_common name includePath sourcesList sources headers)
|
2010-12-30 01:12:44 +08:00
|
|
|
if (SIMGEAR_SHARED)
|
2011-11-29 06:43:57 +08:00
|
|
|
|
2010-11-26 18:04:54 +08:00
|
|
|
foreach(s ${sources})
|
|
|
|
set_property(GLOBAL
|
2011-11-29 06:43:57 +08:00
|
|
|
APPEND PROPERTY ${sourcesList} "${CMAKE_CURRENT_SOURCE_DIR}/${s}")
|
2010-11-26 18:04:54 +08:00
|
|
|
endforeach()
|
|
|
|
|
|
|
|
foreach(h ${headers})
|
|
|
|
set_property(GLOBAL
|
|
|
|
APPEND PROPERTY PUBLIC_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/${h}")
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
else()
|
|
|
|
set(libName "sg${name}")
|
2011-09-11 18:18:03 +08:00
|
|
|
add_library(${libName} STATIC ${sources} ${headers})
|
2010-11-26 18:04:54 +08:00
|
|
|
|
2011-12-01 02:50:09 +08:00
|
|
|
install (TARGETS ${libName} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
2010-11-26 18:04:54 +08:00
|
|
|
endif()
|
2011-11-30 17:45:32 +08:00
|
|
|
|
|
|
|
install (FILES ${headers} DESTINATION include/simgear/${includePath})
|
2010-11-26 18:04:54 +08:00
|
|
|
endmacro()
|
2011-11-29 06:43:57 +08:00
|
|
|
|
|
|
|
function(simgear_component name includePath sources headers)
|
|
|
|
simgear_component_common(${name} ${includePath} CORE_SOURCES "${sources}" "${headers}")
|
|
|
|
endfunction()
|
|
|
|
|
|
|
|
function(simgear_scene_component name includePath sources headers)
|
|
|
|
simgear_component_common(${name} ${includePath} SCENE_SOURCES "${sources}" "${headers}")
|
|
|
|
endfunction()
|