Changeset 2613
- Timestamp:
- Jan 29, 2009, 10:19:15 PM (16 years ago)
- Location:
- code/branches/buildsystem2/cmake
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/buildsystem2/cmake/DetermineVersion.cmake
r2583 r2613 17 17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 18 18 19 MACRO(DETERMINE_VERSION _name _file)20 FILE(READ ${_file} _file_content)21 IF(_file_content)19 FUNCTION(DETERMINE_VERSION _name _file) 20 IF(EXISTS ${_file}) 21 FILE(READ ${_file} _file_content) 22 22 SET(_parts ${ARGN}) 23 23 LIST(LENGTH _parts _parts_length) … … 29 29 STRING(REGEX MATCH "${_name}_VERSION_${_part} +([0-9]+)" _match ${_file_content}) 30 30 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) 32 33 ELSE(_match) 33 SET(${_name}_VERSION_${_part} "0" CACHE STRING "") 34 SET(${_name}_VERSION_${_part} "0") 35 SET(${_name}_VERSION_${_part} "0" PARENT_SCOPE) 34 36 ENDIF(_match) 35 MARK_AS_ADVANCED(${_name}_VERSION_${_part})36 37 IF("${_parts}" MATCHES "^${_part}") # First? 37 SET(${_name}_VERSION "${${_name}_VERSION_${_part}}" CACHE STRING "" FORCE)38 SET(${_name}_VERSION "${${_name}_VERSION_${_part}}") 38 39 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}}") 40 41 ENDIF("${_parts}" MATCHES "^${_part}") 41 42 ENDFOREACH(_part) 42 MARK_AS_ADVANCED(${_name}_VERSION)43 ENDIF( _file_content)44 END MACRO(DETERMINE_VERSION)43 SET(${_name}_VERSION "${${_name}_VERSION}" PARENT_SCOPE) 44 ENDIF(EXISTS ${_file}) 45 ENDFUNCTION(DETERMINE_VERSION) -
code/branches/buildsystem2/cmake/HandleLibraryTypes.cmake
r2583 r2613 26 26 # 27 27 28 MACRO(HandleLibraryTypes_name)28 FUNCTION(HANDLE_LIBRARY_TYPES _name) 29 29 # 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) 42 ENDFUNCTION(HANDLE_LIBRARY_TYPES)
Note: See TracChangeset
for help on using the changeset viewer.