File diff r26253:da15255c652b → r26254:4dd185cf8a2d
cmake/scripts/SquirrelIncludes.cmake
Show inline comments
 
@@ -12,32 +12,11 @@ endif()
 
if(NOT APIUC)
 
    message(FATAL_ERROR "Script needs APIUC defined")
 
endif()
 

	
 
set(ARGC 1)
 
set(ARG_READ NO)
 

	
 
# For MSVC CMake runs this script from a batch file using || to detect errors,
 
# depending on source path it may quote args, and cause cmd to not understand ||
 
# and pass it as argument to ourself.
 
# Read all the arguments given to CMake; we are looking for -- and everything
 
# that follows, until ||. Those are our api files.
 
while(ARGC LESS CMAKE_ARGC)
 
    set(ARG ${CMAKE_ARGV${ARGC}})
 
if(NOT API_FILES)
 
    message(FATAL_ERROR "Script needs API_FILES defined")
 
endif()
 

	
 
    if(ARG STREQUAL "||")
 
        set(ARG_READ NO)
 
    endif()
 

	
 
    if(ARG_READ)
 
        list(APPEND SCRIPT_API_BINARY_FILES "${ARG}")
 
    endif()
 

	
 
    if(ARG STREQUAL "--")
 
        set(ARG_READ YES)
 
    endif()
 

	
 
    math(EXPR ARGC "${ARGC} + 1")
 
endwhile()
 
file(READ "${API_FILES}" SCRIPT_API_BINARY_FILES)
 

	
 
foreach(FILE IN LISTS SCRIPT_API_BINARY_FILES)
 
    file(STRINGS "${FILE}" LINES REGEX "^void SQ${APIUC}.*_Register\\(Squirrel \\*engine\\)$")