Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 26, 2010, 9:16:53 PM (14 years ago)
Author:
rgrieder
Message:

Fixed problem with files directly supplied to ORXONOX_ADD_TARGET.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/forks/sandbox_qt/cmake/tools/TargetUtilities.cmake

    r7807 r7820  
    125125    ELSE()
    126126      # Default, add source file
    127       SET(_file ${CMAKE_SOURCE_DIR}/${_file})
     127
     128      # Prepare relative paths
     129      IF(NOT _file MATCHES "^(.\\:|\\/)")
     130        # Path can be relative to the current source directory if the file was
     131        # not added with the source file macros. Otherwise there is a "./" at
     132        # the beginning of each file and the filename is relative
     133        # to the CMAKE_SOURCE_DIR
     134        STRING(REGEX REPLACE "^\\.\\/(.+)$" "\\1" _temp ${_file})
     135        IF(NOT ${_temp} STREQUAL ${_file})
     136          SET(_file ${CMAKE_SOURCE_DIR}/${_temp})
     137        ELSE()
     138          SET(_file ${CMAKE_CURRENT_SOURCE_DIR}/${_file})
     139        ENDIF()
     140      ENDIF()
     141
    128142      LIST(APPEND _${_target_name}_source_files ${_file})
    129143
Note: See TracChangeset for help on using the changeset viewer.