Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 4, 2008, 1:40:54 PM (15 years ago)
Author:
rgrieder
Message:

Trunk should be functional again with these changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/cmake/AddSourceFiles.cmake

    r2129 r2130  
    1 MACRO(ADD_SOURCE_FILES _directory _source_list _target_list)
     1MACRO(ADD_SOURCE_DIRECTORY _target_list _directory)
    22
    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})
    85
    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}")
    1210  ENDFOREACH(_source_file)
     11
     12ENDMACRO(ADD_SOURCE_DIRECTORY)
     13
     14
     15MACRO(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
    1322ENDMACRO(ADD_SOURCE_FILES)
Note: See TracChangeset for help on using the changeset viewer.