find_package(Qt4 4.8 COMPONENTS QtCore QtNetwork REQUIRED)

set(QT5JSON_SOURCE_DIR "${MoleQueue_SOURCE_DIR}/thirdparty/qt5json/")
include_directories("${QT5JSON_SOURCE_DIR}")
aux_source_directory(${QT5JSON_SOURCE_DIR} qt5json_srcs)

set(sources
  client.cpp
  job.cpp
  ${qt5json_srcs}
  )

set(headers
  client.h
  job.h
  )

include_directories(${CMAKE_CURRENT_BINARY_DIR})

add_library(MoleQueueClient ${sources} ${jsoncpp_srcs})
set_target_properties(MoleQueueClient PROPERTIES AUTOMOC TRUE)
target_link_libraries(MoleQueueClient ${QT_QTCORE_LIBRARY} ${QT_QTNETWORK_LIBRARY})
include(GenerateExportHeader)
generate_export_header(MoleQueueClient EXPORT_FILE_NAME molequeueclientexport.h)
list(APPEND headers "${CMAKE_CURRENT_BINARY_DIR}/molequeueclientexport.h")
add_compiler_export_flags(molequeue_export_flags)
set_property(TARGET MoleQueueClient APPEND
    PROPERTY COMPILE_FLAGS ${molequeue_export_flags})

install(FILES ${headers}
  DESTINATION "${INSTALL_INCLUDE_DIR}/molequeue/client")

find_package(Qt4 4.8 COMPONENTS QtCore QtNetwork REQUIRED)

set(QT5JSON_SOURCE_DIR "${MoleQueue_SOURCE_DIR}/thirdparty/qt5json/")
include_directories("${QT5JSON_SOURCE_DIR}")
aux_source_directory(${QT5JSON_SOURCE_DIR} qt5json_srcs)
foreach(source ${qt5json_srcs})
  if (${source} MATCHES ".*/main.cpp")
    list(REMOVE_ITEM qt5json_srcs ${source})
  endif()
endforeach()

set(sources
  client.cpp
  job.cpp
  ${qt5json_srcs}
  )

set(headers
  client.h
  job.h
  )

include_directories(${CMAKE_CURRENT_BINARY_DIR})

add_library(MoleQueueClient ${sources} ${jsoncpp_srcs})
set_target_properties(MoleQueueClient PROPERTIES AUTOMOC TRUE)
target_link_libraries(MoleQueueClient ${QT_QTCORE_LIBRARY} ${QT_QTNETWORK_LIBRARY})
include(GenerateExportHeader)
generate_export_header(MoleQueueClient EXPORT_FILE_NAME molequeueclientexport.h)
list(APPEND headers "${CMAKE_CURRENT_BINARY_DIR}/molequeueclientexport.h")
add_compiler_export_flags(molequeue_export_flags)
set_property(TARGET MoleQueueClient APPEND
    PROPERTY COMPILE_FLAGS ${molequeue_export_flags})

install(FILES ${headers}
  DESTINATION "${INSTALL_INCLUDE_DIR}/molequeue/client")

Remove test executable from the client library.
Remove test executable from the client library.

Change-Id: I96f2676d19d1c199e42eaf9595f258f7d6ba05db
