Re: [CMake] Use GLOB to generate filelist for install package

2016-08-11 Thread Patrik Lehmann

Thank You both. Now it works!


Am 11.08.2016 um 11:29 schrieb Stuermer, Michael SP/HZA-ZSEP:



-Original Message-
From: CMake [mailto:cmake-boun...@cmake.org] On Behalf Of Patrik
Lehmann
Sent: Thursday, August 11, 2016 11:04 AM
To: cmake@cmake.org
Subject: [CMake] Use GLOB to generate filelist for install package

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)


Remove the '"' around the list of headers in your install command:

INSTALL(FILES ${MY_INCLUDES_H} ...

instead of

INSTALL(FILES "${MY_INCLUDES_H}" ...

The quotes result in the list to be expanded in only one long string instead of 
a list of strings. CMake thinks you are only installing one file with a vry 
long name.
  


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




-- 

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

Re: [CMake] Use GLOB to generate filelist for install package

2016-08-11 Thread Stuermer, Michael SP/HZA-ZSEP


> -Original Message-
> From: CMake [mailto:cmake-boun...@cmake.org] On Behalf Of Patrik
> Lehmann
> Sent: Thursday, August 11, 2016 11:04 AM
> To: cmake@cmake.org
> Subject: [CMake] Use GLOB to generate filelist for install package
> 
> 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)
> 

Remove the '"' around the list of headers in your install command:

INSTALL(FILES ${MY_INCLUDES_H} ...

instead of 

INSTALL(FILES "${MY_INCLUDES_H}" ...

The quotes result in the list to be expanded in only one long string instead of 
a list of strings. CMake thinks you are only installing one file with a vry 
long name.
 

> 
> 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
-- 

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


Re: [CMake] Use GLOB to generate filelist for install package

2016-08-11 Thread CHEVRIER, Marc

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"  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


-- 

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