X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=CMakeModules%2FSimGearComponent.cmake;h=00944de39f958943711aa0261260cc0aeb24b39f;hb=2bb24f43fbacaa198a2dafbe2ed5acb298231b4e;hp=3eb5740acc5937d4b2ab1600e08a3419d817bc9e;hpb=73c0ce628bd85f556440a4a4cfe42bb2f8c1b90e;p=simgear.git diff --git a/CMakeModules/SimGearComponent.cmake b/CMakeModules/SimGearComponent.cmake index 3eb5740a..00944de3 100644 --- a/CMakeModules/SimGearComponent.cmake +++ b/CMakeModules/SimGearComponent.cmake @@ -1,23 +1,29 @@ -macro(simgear_component name includePath sources headers) +macro(simgear_component_common name includePath sourcesList sources headers) + set(fc${sourcesList} ${name}) + set(fh${sourcesList} ${name}) + foreach(s ${sources}) + set_property(GLOBAL + APPEND PROPERTY ${sourcesList} "${CMAKE_CURRENT_SOURCE_DIR}/${s}") + set(fc${sourcesList} "${fc${sourcesList}}#${CMAKE_CURRENT_SOURCE_DIR}/${s}") + endforeach() - 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}") + set(fh${sourcesList} "${fh${sourcesList}}#${CMAKE_CURRENT_SOURCE_DIR}/${h}") + 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} ) - - install (TARGETS ${libName} ARCHIVE DESTINATION lib${LIB_SUFFIX}) - install (FILES ${headers} DESTINATION include/simgear/${includePath}) - endif() + set_property(GLOBAL APPEND PROPERTY FG_GROUPS_${sourcesList}_C "${fc${sourcesList}}@") + set_property(GLOBAL APPEND PROPERTY FG_GROUPS_${sourcesList}_H "${fh${sourcesList}}@") + install (FILES ${headers} DESTINATION include/simgear/${includePath}) 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()