cartha
cartha

Reputation: 21

CMake macro to include all module source files?

Modules I've seen use AC_ADD_SCRIPT to add individual .cpp files. I am porting playerbot which has many source files, and I am wondering if there is a way to tell AC to add all files underneath?

The playerbot CMakeLists.txt file uses Cmake globbing to do this, but I think it doesn't set the same variables that AC_ADD_SCRIPT does to make things Just Work.

Any advice is appreciated!

Upvotes: 2

Views: 294

Answers (1)

Joseph
Joseph

Reputation: 1091

You can use directly:

AC_ADD_SCRIPTS(your_directory_path)  

(note the plural form)

this macro will search recursively inside defined path for both *.cpp and *.h files including them in core scripts

Upvotes: 1

Related Questions