If we enable testing, build TelldusService as a static library that can be used by the TestRunner

This commit is contained in:
Micke Prag 2012-06-20 12:18:50 +02:00
parent 6e47588096
commit ae7b9b8c1a

View file

@ -259,3 +259,16 @@ IF (UNIX AND NOT APPLE)
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ GROUP_WRITE WORLD_READ WORLD_WRITE
)
ENDIF (UNIX AND NOT APPLE)
IF(ENABLE_TESTING)
# Build it once more, but as static library so it can be linked by the test-tool
ADD_LIBRARY(TelldusServiceStatic STATIC
${telldus-service_SRCS}
${telldus-service_protocol_SRCS}
${telldus-service_HDRS}
)
TARGET_LINK_LIBRARIES( TelldusServiceStatic ${telldus-service_LIBRARIES} )
IF (UNIX)
SET_TARGET_PROPERTIES( TelldusServiceStatic PROPERTIES COMPILE_FLAGS "-fPIC")
ENDIF (UNIX)
ENDIF()