simgear/CMakeModules/SimGearComponent.cmake
Andreas Gaeb f7cee2ed56 cmake: Add headers to library components
Add headers to library components so that they get
included into the IDE project files.
2011-09-14 08:56:17 +02:00

24 lines
677 B
CMake

macro(simgear_component name includePath sources headers)
if (SIMGEAR_SHARED)
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}")
add_library(${libName} STATIC ${sources} ${headers})
install (TARGETS ${libName} ARCHIVE DESTINATION lib${LIB_SUFFIX})
install (FILES ${headers} DESTINATION include/simgear/${includePath})
endif()
endmacro()