diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b2deb951c..875f3d247 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -206,7 +206,6 @@ LIST(LENGTH DEVICE_CLASSES DEVICE_CLASSES_LEN) IF(${DEVICE_CLASSES_LEN} EQUAL 1) # only one device present - forte_add_custom_configuration("#define FORTE_MULTIPLE_DEVICES 0") LIST(GET DEVICE_CLASSES 0 CLASS) LIST(GET DEVICE_FILENAMES 0 FILENAME) @@ -215,7 +214,7 @@ IF(${DEVICE_CLASSES_LEN} EQUAL 1) SET(SINGLE_DEVICE_CREATE " return (paMGRID.length() != 0) ? std::make_unique<${CLASS}>(paMGRID) : std::make_unique<${CLASS}>(); ") ELSE() - forte_add_custom_configuration("#define FORTE_MULTIPLE_DEVICES 1") + forte_add_definition("-DFORTE_MULTIPLE_DEVICES") forte_add_sourcefile_with_path_cpp(${CMAKE_BINARY_DIR}/deviceFactory.cpp) # created file diff --git a/src/arch/utils/mainparam_utils.cpp b/src/arch/utils/mainparam_utils.cpp index d56758dc9..cdbbe2a1b 100644 --- a/src/arch/utils/mainparam_utils.cpp +++ b/src/arch/utils/mainparam_utils.cpp @@ -16,7 +16,7 @@ #include #include -#if FORTE_MULTIPLE_DEVICES +#ifdef FORTE_MULTIPLE_DEVICES #include "deviceFactory.h" #endif // FORTE_MULTIPLE_DEVICES @@ -32,7 +32,7 @@ void listHelp(){ printf("Options:\n"); printf("%-20s Display this information\n", " -h"); printf("%-20s Set the listening IP and port for the incoming connections\n", " -c :"); -#if FORTE_MULTIPLE_DEVICES +#ifdef FORTE_MULTIPLE_DEVICES printf("%-20s Set the device to be used\n", " -d DEVICE_NAME"); #endif // FORTE_MULTIPLE_DEVICES #ifdef FORTE_SUPPORT_BOOT_FILE @@ -67,7 +67,7 @@ const char *parseCommandLineArguments(int argc, char *arg[]){ case 'c': //! sets the destination for the connection pIpPort = arg[i + 1]; break; -#if FORTE_MULTIPLE_DEVICES +#ifdef FORTE_MULTIPLE_DEVICES case 'd': //! sets the device to be used if(!DeviceFactory::setDeviceToCreate(arg[i + 1])){ printf("The selected device '%s' is not valid. Select one of the following: %s\n", arg[i + 1], DeviceFactory::getAvailableDevices().c_str()); diff --git a/src/deviceFactory.h.in b/src/deviceFactory.h.in index d4f7db6dd..3e1e6d22f 100644 --- a/src/deviceFactory.h.in +++ b/src/deviceFactory.h.in @@ -13,12 +13,10 @@ #ifndef FORTE_DEVICE_FACTORY_H #define FORTE_DEVICE_FACTORY_H -#include - #include #include -#if FORTE_MULTIPLE_DEVICES +#ifdef FORTE_MULTIPLE_DEVICES class CDevice;