2010-11-26 18:04:54 +08:00
|
|
|
|
|
|
|
macro(simgear_component name includePath sources headers)
|
|
|
|
|
2010-12-30 01:12:44 +08:00
|
|
|
if (SIMGEAR_SHARED)
|
2010-11-26 18:04:54 +08:00
|
|
|
foreach(s ${sources})
|
|
|
|
set_property(GLOBAL
|
|
|
|
APPEND PROPERTY ALL_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/${s}")
|
|
|
|
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
|
|
|
|
2010-12-20 22:46:53 +08:00
|
|
|
install (TARGETS ${libName} ARCHIVE DESTINATION lib${LIB_SUFFIX})
|
2010-11-26 18:04:54 +08:00
|
|
|
install (FILES ${headers} DESTINATION include/simgear/${includePath})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
endmacro()
|