[CMake] add all files of a directory

Adrien Saladin adrien.saladin at gmail.com
Mon Jul 14 09:48:57 EDT 2008


On Mon, Jul 14, 2008 at 2:07 PM, Gerrick Bivins
<gbivins at objectreservoir.com> wrote:
> Hi Adrien,
> I think you can use Cmake's GLOB to get do this, something like:
> FILE (GLOB MYFILES RELATIVE Pybindings *.cxx )
>
> MYFILES should be a variable with all the *.cxx files in Pybindings.
> Gerrick
>

Hi Gerrick,

Thanks for your answer.
I probably missed something because I get an empty list after this command:

I have this in my CMakeLists.txt file:
------
FILE (GLOB MYFILES RELATIVE Pybindings/ *.cpp )
message("${MYFILES}")
-----

Here is the answer to the "message" command:

;;;;;;;;;;;;;;


If I simply add  MYFILES for building the library, none of the files
of Pybindings are compiled.


Thanks for any help.
Adrien


More information about the CMake mailing list