diff --git a/include/actiondep.h b/include/actiondep.h index 4f2a8cc..eb3978b 100644 --- a/include/actiondep.h +++ b/include/actiondep.h @@ -9,10 +9,10 @@ using michlib::MDateTime; #if defined GENACTIONLIST -#define ADD_ACTION(actclass, actname, suptest) ADD ACTION CLASS: actclass +#define ADD_ACTION(actclass, actname, suptest, ...) ADD ACTION CLASS: actclass #else -#define ADD_ACTION(actclass, actname, suptest) \ - class Action##actclass \ +#define ADD_ACTION(actclass, actname, suptest, ...) \ + class Action##actclass __VA_OPT__( : public) __VA_ARGS__ \ { \ public: \ static constexpr const char* name = #actname; \ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 367813b..79fec9a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -37,6 +37,10 @@ string(REPLACE ";" "," actclist "${actlist}") file(WRITE ${ACTIONLISTINC} "#define ACTLIST ${actclist}\n") foreach(actfile ${actfilelist}) + string(REGEX REPLACE "\.h$" ".cpp" actcpp "${actfile}") + if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${actcpp} ) + target_sources(${EXENAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/${actcpp}) + endif() file(APPEND ${ACTIONLISTINC} "#include \"${actfile}\"\n") endforeach(actfile) # End generation of actions list