diff --git a/src/svxlink/svxlink/CMakeLists.txt b/src/svxlink/svxlink/CMakeLists.txt index 8ddd5c75..f9fb4fca 100644 --- a/src/svxlink/svxlink/CMakeLists.txt +++ b/src/svxlink/svxlink/CMakeLists.txt @@ -24,6 +24,7 @@ include_directories(${GSM_INCLUDE_DIR}) # Include contributed parts add_subdirectory(contrib) +add_definitions(${SVXLINK_DEFINES}) # Find the TCL library if(TCL_LIBRARY) diff --git a/src/svxlink/svxlink/contrib/CMakeLists.txt b/src/svxlink/svxlink/contrib/CMakeLists.txt index 59b9f5cc..b1653476 100644 --- a/src/svxlink/svxlink/contrib/CMakeLists.txt +++ b/src/svxlink/svxlink/contrib/CMakeLists.txt @@ -1,9 +1,20 @@ -option(WITH_CONTRIB_SIP_LOGIC +# Add a subdirectory containing contributed code +# +# name - The upper case name of the contrib +# subdir - The subdirectory where the code is found +# comment - Comment text for the CMake option +# +macro(add_contrib name subdir comment) + option(WITH_CONTRIB_${name} ${comment}) + if(${WITH_CONTRIB_${name}}) + message(STATUS "Building experimental contributed code ${subdir}") + set(SVXLINK_DEFINES ${SVXLINK_DEFINES} "-DWITH_CONTRIB_${name}=ON" PARENT_SCOPE) + add_subdirectory(${subdir}) + endif(${WITH_CONTRIB_${name}}) +endmacro(add_contrib) + +add_contrib(SIP_LOGIC SipLogic "Set to ON to build and install contributed logic core SipLogic") -if(WITH_CONTRIB_SIP_LOGIC) - message(STATUS "Building experimental logic core SipLogic") - add_subdirectory(SipLogic) -endif(WITH_CONTRIB_SIP_LOGIC) # Propagate variables upwards set(LIBS ${LIBS} PARENT_SCOPE) diff --git a/src/svxlink/svxlink/svxlink.cpp b/src/svxlink/svxlink/svxlink.cpp index 403ca530..d2ec6d4f 100644 --- a/src/svxlink/svxlink/svxlink.cpp +++ b/src/svxlink/svxlink/svxlink.cpp @@ -85,8 +85,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "SimplexLogic.h" #include "RepeaterLogic.h" #include "ReflectorLogic.h" -#ifdef PJSIP_MAJOR -#include "SipLogic.h" +#ifdef WITH_CONTRIB_SIP_LOGIC +#include "contrib/SipLogic/SipLogic.h" #endif #include "LinkManager.h" @@ -758,7 +758,7 @@ static void initialize_logics(Config &cfg) { logic = new ReflectorLogic(cfg, logic_name); } -#ifdef PJSIP_MAJOR +#ifdef WITH_CONTRIB_SIP_LOGIC else if (logic_type == "Sip") { logic = new SipLogic(cfg, logic_name);