Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2613 for code


Ignore:
Timestamp:
Jan 29, 2009, 10:19:15 PM (16 years ago)
Author:
rgrieder
Message:
  • Added FindPackageHandleAdvancedArgs.cmake module that invokes FindPackageHandleStandardArgs and then checks the version requirements. Usage: FIND_PACKAGE_HANDLE_ADVANCED_ARGS(NAME MSG VERSION VARS) (like the orginal CMake module, but with the additional version argument)
  • Updated DetermineVersion.cmake and HandleLibraryTypes.cmake to use FUNCTION instead of MACRO and also removed CACHE setting of the veriables (unnecessary).
Location:
code/branches/buildsystem2/cmake
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/buildsystem2/cmake/DetermineVersion.cmake

    r2583 r2613  
    1717#    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
    1818
    19 MACRO(DETERMINE_VERSION _name _file)
    20   FILE(READ ${_file} _file_content)
    21   IF(_file_content)
     19FUNCTION(DETERMINE_VERSION _name _file)
     20  IF(EXISTS ${_file})
     21    FILE(READ ${_file} _file_content)
    2222    SET(_parts ${ARGN})
    2323    LIST(LENGTH _parts _parts_length)
     
    2929      STRING(REGEX MATCH "${_name}_VERSION_${_part} +([0-9]+)" _match ${_file_content})
    3030      IF(_match)
    31         SET(${_name}_VERSION_${_part} ${CMAKE_MATCH_1} CACHE STRING "")
     31        SET(${_name}_VERSION_${_part} ${CMAKE_MATCH_1})
     32        SET(${_name}_VERSION_${_part} ${CMAKE_MATCH_1} PARENT_SCOPE)
    3233      ELSE(_match)
    33         SET(${_name}_VERSION_${_part} "0" CACHE STRING "")
     34        SET(${_name}_VERSION_${_part} "0")
     35        SET(${_name}_VERSION_${_part} "0" PARENT_SCOPE)
    3436      ENDIF(_match)
    35       MARK_AS_ADVANCED(${_name}_VERSION_${_part})
    3637      IF("${_parts}" MATCHES "^${_part}") # First?
    37         SET(${_name}_VERSION "${${_name}_VERSION_${_part}}" CACHE STRING "" FORCE)
     38        SET(${_name}_VERSION "${${_name}_VERSION_${_part}}")
    3839      ELSE("${_parts}" MATCHES "^${_part}")
    39         SET(${_name}_VERSION "${${_name}_VERSION}.${${_name}_VERSION_${_part}}" CACHE STRING "" FORCE)
     40        SET(${_name}_VERSION "${${_name}_VERSION}.${${_name}_VERSION_${_part}}")
    4041      ENDIF("${_parts}" MATCHES "^${_part}")
    4142    ENDFOREACH(_part)
    42     MARK_AS_ADVANCED(${_name}_VERSION)
    43   ENDIF(_file_content)
    44 ENDMACRO(DETERMINE_VERSION)
     43    SET(${_name}_VERSION "${${_name}_VERSION}" PARENT_SCOPE)
     44  ENDIF(EXISTS ${_file})
     45ENDFUNCTION(DETERMINE_VERSION)
  • code/branches/buildsystem2/cmake/HandleLibraryTypes.cmake

    r2583 r2613  
    2626 #
    2727
    28 MACRO(HandleLibraryTypes _name)
     28FUNCTION(HANDLE_LIBRARY_TYPES _name)
    2929  # Additional libraries can be added as additional arguments
    30   IF(${_name}_FOUND)
    31     IF(${_name}_LIBRARY_DEBUG)
    32       SET(${_name}_LIBRARY
    33           optimized ${${_name}_LIBRARY_OPTIMIZED} ${ARGN}
    34           debug     ${${_name}_LIBRARY_DEBUG}     ${ARGN}
    35           CACHE STRING "${_name} library file(s)" FORCE
    36       )
    37     ELSE(${_name}_LIBRARY_DEBUG)
    38       SET(${_name}_LIBRARY
    39           ${${_name}_LIBRARY_OPTIMIZED} ${ARGN}
    40           CACHE STRING "${_name} library file(s)" FORCE
    41       )
    42     ENDIF(${_name}_LIBRARY_DEBUG)
    43   ENDIF(${_name}_FOUND)
    44 ENDMACRO(HandleLibraryTypes)
     30  IF(${_name}_LIBRARY_DEBUG AND ${_name}_LIBRARY_OPTIMIZED)
     31    SET(${_name}_LIBRARY
     32      optimized ${${_name}_LIBRARY_OPTIMIZED} ${ARGN}
     33      debug     ${${_name}_LIBRARY_DEBUG}     ${ARGN}
     34      PARENT_SCOPE
     35    )
     36  ELSE(${_name}_LIBRARY_DEBUG AND ${_name}_LIBRARY_OPTIMIZED)
     37    SET(${_name}_LIBRARY
     38      ${${_name}_LIBRARY_OPTIMIZED} ${ARGN}
     39      PARENT_SCOPE
     40     )
     41  ENDIF(${_name}_LIBRARY_DEBUG AND ${_name}_LIBRARY_OPTIMIZED)
     42ENDFUNCTION(HANDLE_LIBRARY_TYPES)
Note: See TracChangeset for help on using the changeset viewer.