Added support module UsbD101 to cmake build system.

This commit is contained in:
Micke Prag 2009-05-11 15:18:10 +00:00
parent a7555ac119
commit b424c2c85a
3 changed files with 44 additions and 10 deletions

View file

@ -6,3 +6,7 @@ if(BUILD_LIBTELLDUS-CORE)
ADD_SUBDIRECTORY(libtelldus-core) ADD_SUBDIRECTORY(libtelldus-core)
endif(BUILD_LIBTELLDUS-CORE) endif(BUILD_LIBTELLDUS-CORE)
IF (WIN32)
ADD_SUBDIRECTORY(TellUsbD101)
ENDIF (WIN32)

View file

@ -0,0 +1,38 @@
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
SET( tellusbd101_SRCS
TellUsbD101.cpp
TellUsbD101.def
)
SET( tellusbd101_HDRS
TellUsbD101.h
)
SET( tellusbd101_TARGET TellUsbD101 )
ADD_DEFINITIONS(
-D_WINDOWS
-DTellUsbD101_EXPORTS
)
SET( tellusbd101_LIBRARIES
"${LIBRARY_OUTPUT_PATH}/Release/TelldusCore.lib"
)
######## Configuring ########
ADD_LIBRARY(${tellusbd101_TARGET} SHARED
${tellusbd101_SRCS}
${tellusbd101_HDRS}
)
TARGET_LINK_LIBRARIES( ${tellusbd101_TARGET} ${tellusbd101_LIBRARIES} )
SET_PROPERTY(TARGET ${tellusbd101_TARGET}
PROPERTY PUBLIC_HEADER ${tellusbd101_HDRS}
)

View file

@ -25,14 +25,7 @@ char* __stdcall devGetVendor(int intDeviceId){
} }
char* __stdcall devGetModel(int intDeviceId){ char* __stdcall devGetModel(int intDeviceId){
int intModel = tdGetModel(intDeviceId); return tdGetModel(intDeviceId);
std::ostringstream ss;
std::string str;
ss << intModel;
str = ss.str();
char *strModel = (char *)SysAllocStringByteLen (str.c_str(), (UINT)str.length());
return strModel;
} }
int __stdcall devGetNumberOfArguments(int intDeviceId){ int __stdcall devGetNumberOfArguments(int intDeviceId){
@ -56,8 +49,7 @@ bool __stdcall devSetVendor(int intDeviceId, char* strVendor) {
} }
bool __stdcall devSetModel(int intDeviceId, char* strNewModel){ bool __stdcall devSetModel(int intDeviceId, char* strNewModel){
int intModel = atoi(strNewModel); return tdSetModel(intDeviceId, strNewModel);
return tdSetModel(intDeviceId, intModel);
} }
bool __stdcall devSetArguments(int intDeviceId, char* strArguments){ bool __stdcall devSetArguments(int intDeviceId, char* strArguments){