X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=CMakeModules%2FSimGearComponent.cmake;h=1c11b855b9d61ccca8a86b813d5bbc568860459d;hb=098441f5fbbcff41508b9411ecf2904f84a7eb81;hp=c10e67645b1d588e68778aedcd969b5740547d83;hpb=f7cee2ed56ca62cd6768ab842811af13d1e25317;p=simgear.git diff --git a/CMakeModules/SimGearComponent.cmake b/CMakeModules/SimGearComponent.cmake index c10e6764..1c11b855 100644 --- a/CMakeModules/SimGearComponent.cmake +++ b/CMakeModules/SimGearComponent.cmake @@ -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,16 @@ macro(simgear_component name includePath sources headers) 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}) + install (TARGETS ${libName} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif() + 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()