

(7 intermediate revisions by 4 users not shown) 
Line 1: 
Line 1: 
 [[CMake_User_Contributed_MacrosBack]]
  {{CMake/Template/Moved}} 

 

 # This macro merges elements in sorted lists ALIST and BLIST and stored the result in OUTPUT
  This page has moved [https://gitlab.kitware.com/cmake/community/wikis/contrib/macros/Merge here]. 
 MACRO(MERGE ALIST BLIST OUTPUT)
 
 SET(BTEMP ${BLIST})
 
 FOREACH(A ${ALIST})
 
 SET(SORTED)
 
 SET(UNINSERTED 1)
 
 FOREACH(B ${BTEMP})
 
 IF(${UNINSERTED})
 
 IF(${A} STRLESS ${B})
 
 SET(SORTED ${SORTED} ${A})
 
 SET(UNINSERTED 0)
 
 ENDIF(${A} STRLESS ${B})
 
 ENDIF(${UNINSERTED})
 
 SET(SORTED ${SORTED} ${B})
 
 ENDFOREACH(B ${BLIST})
 
 IF(${UNINSERTED})
 
 SET(SORTED ${SORTED} ${A})
 
 ENDIF(${UNINSERTED})
 
 SET(BTEMP ${SORTED})
 
 ENDFOREACH(A ${ALIST})
 
 SET(${OUTPUT} ${BTEMP})
 
 ENDMACRO(MERGE ALIST BLIST OUTPUT)
 

 
 # Here is an example that merges *.cpp files and *.h files into a single sorted list
 
 # This would be easier if FILE(GLOB...) properly matches "*.{cpp,h}"
 
 FILE(GLOB ALGEBRAIC_SRCS Implicit/Algebraic/*.cpp)
 
 FILE(GLOB ALGEBRAIC_H Implicit/Algebraic/*.h)
 
 MERGE("${ALGEBRAIC_H}" "${ALGEBRAIC_SRCS}" ALGEBRAIC_SRCS)
 
  
 [[CMake_User_Contributed_MacrosBack]]
 
  
 {{CMake/Template/Footer}}
 
 <div style="overflow: auto; height: 1px;">
 
  
 [_pw9_]
 
  
 [http://nvnv2006.com/ nvnv]
 
  
  
 </div>
 
Latest revision as of 10:41, 30 April 2018