Changeset 2130 for code/trunk/cmake
- Timestamp:
- Nov 4, 2008, 1:40:54 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/cmake/AddSourceFiles.cmake
r2129 r2130 1 MACRO(ADD_SOURCE_ FILES _directory _source_list _target_list)1 MACRO(ADD_SOURCE_DIRECTORY _target_list _directory) 2 2 3 # Set the variable (_source_list) first 4 INCLUDE(${_directory}/CMakeLists.txt) 5 #MESSAGE(STATUS ${_directory}) 6 #MESSAGE(STATUS "${_source_list}") 7 #MESSAGE(STATUS "${${_source_list}}") 3 # Subfolder puts source files into CMake Cache variable _CACHED_SOURCE_FILES 4 ADD_SUBDIRECTORY(${_directory}) 8 5 9 FOREACH(_source_file ${${_source_list}}) 10 LIST(APPEND ${_target_list} "${_directory}/${_source_file}") 11 #MESSAGE(STATUS ${${_target_list}}) 6 # Put the directory name in front of each source file from the subfolder 7 # and add it to the source list in the current directory 8 FOREACH(_source_file ${_CACHED_SOURCE_FILES}) 9 LIST(APPEND ${_target_list} "${_directory}/${_source_file}") 12 10 ENDFOREACH(_source_file) 11 12 ENDMACRO(ADD_SOURCE_DIRECTORY) 13 14 15 MACRO(ADD_SOURCE_FILES _source_list) 16 17 # Put the source file into a variable that still exists in this_folder/../ 18 # Use FORCE to always overwrite the cache variable 19 SET(_CACHED_SOURCE_FILES ${${_source_list}} CACHE STRING "" FORCE) 20 MARK_AS_ADVANCED(_CACHED_SOURCE_FILES FORCE) 21 13 22 ENDMACRO(ADD_SOURCE_FILES)
Note: See TracChangeset
for help on using the changeset viewer.