Build system tweaks to support SIMGEAR_SHARED building two libraries. Work in progress, does not link yet.

This commit is contained in:
James Turner
2011-11-28 22:43:57 +00:00
parent 7a52c2fa71
commit 4b02335637
12 changed files with 76 additions and 37 deletions

View File

@@ -1,10 +1,10 @@
macro(simgear_component name includePath sources headers)
macro(simgear_component_common name includePath sourcesList sources headers)
if (SIMGEAR_SHARED)
foreach(s ${sources})
set_property(GLOBAL
APPEND PROPERTY ALL_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/${s}")
APPEND PROPERTY ${sourcesList} "${CMAKE_CURRENT_SOURCE_DIR}/${s}")
endforeach()
foreach(h ${headers})
@@ -16,8 +16,15 @@ macro(simgear_component name includePath sources headers)
set(libName "sg${name}")
add_library(${libName} STATIC ${sources} ${headers})
install (TARGETS ${libName} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
install (TARGETS ${libName} ARCHIVE DESTINATION lib${LIB_SUFFIX})
install (FILES ${headers} DESTINATION include/simgear/${includePath})
endif()
endmacro()
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()