logo
down
shadow

cmake3 external project add step loop


cmake3 external project add step loop

Content Index :

cmake3 external project add step loop
Tag : cmake , By : Tony Z
Date : November 24 2020, 05:44 AM

should help you out In CMake functions calls and other constructions cannot be nested one into another. So, using foreach() command inside ExternalProject_Add_Step parameters is wrong.
But you may use foreach() for generate arguments for ExternalProject_Add_Step:
# This variable will contain list of 'COMMAND' clauses:
#    COMMAND cmake -P copy <file-src> <file-dst>
set(COMMAND_COPY_FILES)
foreach(copy_file ${ALL_FILES})
    list(APPEND COMMAND_COPY_FILES
        COMMAND ${CMAKE_COMMAND} -E copy ${SRC_DIR}/${copy_file} ${TGT_DIR}/${copy_file}
    )
endforeach(copy_file)

ExternalProject_Add_Step(${EXTERNAL_TARGET} lib_step 
     COMMAND ${CMAKE_COMMAND} -E make_directory ${TGT_DIR}
     ${COMMAND_COPY_FILES}
     COMMENT "Copying lib from ${SRC_DIR} to  ${TGT_DIR}"
     DEPENDEES install)
# This variable will contain single 'COMMAND' clause but with many files:
#    COMMAND cmake -P copy <src-files> <dest-dir>
set(COMMAND_COPY_FILES COMMAND ${CMAKE_COMMAND} -E copy)
foreach(copy_file ${ALL_FILES})
    list(APPEND COMMAND_COPY_FILES ${SRC_DIR}/${copy_file})
endforeach(copy_file)
list(APPEND COMMAND_COPY_FILES ${TGT_DIR})

Comments
No Comments Right Now !

Boards Message :
You Must Login Or Sign Up to Add Your Comments .

Share : facebook icon twitter icon

Load an extern C-library into an existing C++-Project (f.e. ffmpeg/libavcodec - step by step)


Tag : cpp , By : Lunis Neko
Date : March 29 2020, 07:55 AM
I wish did fix the issue. To include a source code library into your existing project you have a number of options:

How to add multiple javascript functions to an external file step by step


Tag : javascript , By : Michael
Date : March 29 2020, 07:55 AM
I wish this helpful for you Simply cut and paste the contents between the
shadow
Privacy Policy - Terms - Contact Us © scrbit.com