[CMake] Use GLOB to generate filelist for install package

CHEVRIER, Marc marc.chevrier at sap.com
Thu Aug 11 05:22:35 EDT 2016


Remove the quotes around the variable MY_INCLUDES_H in the INSTALL command because this is a list. Using quotes, you pass it as a single string.

On 11/08/16 11:03, "CMake on behalf of Patrik Lehmann" <cmake-bounces at cmake.org on behalf of patrik.lehmann at tes-dst.com> wrote:

    Hello,
    
    I try to use GLOB to collect the files for my install package, but 
    unfortunately I got the message
    
    'file INSTALL cannot find "C:/Project/include/test1.h;C:/Project/include/test2.h;...'
    
    My code:
    
    FILE(GLOB MY_INCLUDES_H "${PROJECT_SOURCE_DIR}/include/*.h")
    
    INSTALL(FILES "${MY_INCLUDES_H}"
              DESTINATION "include"
              COMPONENT CPP_INCLUDES)
    
    
    Is there a way to collect the files this way or is it needed to add 
    every file manually?
    
    Kind Regards,
    Patrik Lehmann
    -- 
    
    Powered by www.kitware.com
    
    Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
    
    Kitware offers various services to support the CMake community. For more information on each offering, please visit:
    
    CMake Support: http://cmake.org/cmake/help/support.html
    CMake Consulting: http://cmake.org/cmake/help/consulting.html
    CMake Training Courses: http://cmake.org/cmake/help/training.html
    
    Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
    
    Follow this link to subscribe/unsubscribe:
    http://public.kitware.com/mailman/listinfo/cmake
    



More information about the CMake mailing list