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.

Location:
code/forks/sandbox_qt/cmake/tools
Files:
2 edited

Legend:

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

    r7805 r7820  
    4242      # Store file with path relative to the root source directory
    4343      FILE(RELATIVE_PATH _file_rel ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/${_file})
    44       LIST(APPEND _source_files ${_file_rel})
     44      LIST(APPEND _source_files ./${_file_rel})
    4545    ENDIF()
    4646  ENDFOREACH(_file)
  • 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.