]> git.mxchange.org Git - simgear.git/blobdiff - CMakeModules/SimGearComponent.cmake
HTTP: Always use absolute paths for hashes
[simgear.git] / CMakeModules / SimGearComponent.cmake
index afa02a96709464a10f1811f2cff198eecaffccb4..00944de39f958943711aa0261260cc0aeb24b39f 100644 (file)
@@ -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)
-        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()