|
@@ -142,6 +142,28 @@ ELSE(UNIX)
|
|
|
INSTALL(FILES "COPYING" DESTINATION "${ARTIS_SHARE_DIRS}" RENAME "CopyRight.txt")
|
|
|
ENDIF(UNIX)
|
|
|
|
|
|
+#
|
|
|
+# Add sources for a target
|
|
|
+# add_sources(<target> <source1> [<source2> ...])
|
|
|
+#
|
|
|
+function(add_sources target)
|
|
|
+ get_property(prop_defined GLOBAL PROPERTY ${target}_SRCS DEFINED)
|
|
|
+ if(NOT prop_defined)
|
|
|
+ define_property(GLOBAL PROPERTY ${target}_SRCS
|
|
|
+ BRIEF_DOCS "Sources for the ${target} target"
|
|
|
+ FULL_DOCS "List of source files for the ${target} target")
|
|
|
+ endif()
|
|
|
+
|
|
|
+ set(SRCS)
|
|
|
+ foreach(src ${ARGN})
|
|
|
+ if(NOT IS_ABSOLUTE "${src}")
|
|
|
+ get_filename_component(src "${src}" ABSOLUTE)
|
|
|
+ endif()
|
|
|
+ list(APPEND SRCS "${src}")
|
|
|
+ endforeach()
|
|
|
+ set_property(GLOBAL APPEND PROPERTY "${target}_SRCS" "${SRCS}")
|
|
|
+endfunction()
|
|
|
+
|
|
|
#
|
|
|
# Browse the src subdirectory
|
|
|
#
|