Standardise SimGear libraries, for static vs shared.

Always create only two SimGear libraries: SimGearCore and SimGearStatic, regardless of whether we're building static or shared. This requires an updated to FindSimGear.cmake module, for the static configuration.
This commit is contained in:
James Turner
2012-09-16 16:04:08 +01:00
parent e4dacaf0d2
commit 47d88bcfa7
12 changed files with 42 additions and 87 deletions

View File

@@ -1,23 +1,14 @@
macro(simgear_component_common name includePath sourcesList sources headers)
if (SIMGEAR_SHARED)
foreach(s ${sources})
set_property(GLOBAL
APPEND PROPERTY ${sourcesList} "${CMAKE_CURRENT_SOURCE_DIR}/${s}")
endforeach()
foreach(s ${sources})
set_property(GLOBAL
APPEND PROPERTY ${sourcesList} "${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}")
add_library(${libName} STATIC ${sources} ${headers})
install (TARGETS ${libName} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
foreach(h ${headers})
set_property(GLOBAL
APPEND PROPERTY PUBLIC_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/${h}")
endforeach()
install (FILES ${headers} DESTINATION include/simgear/${includePath})
endmacro()