##### Probably don't want to edit below this line #####

IF (WIN32 AND Qt5Core_FOUND)
  FIND_PACKAGE( Qt5Widgets REQUIRED )

  INCLUDE_DIRECTORIES(${Qt5Widgets_INCLUDE_DIRS})
  ADD_DEFINITIONS(${Qt5Widgets_DEFINITIONS})
  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
ENDIF()

IF (NOT Qt5Core_FOUND)
  # Use it
  INCLUDE( ${QT_USE_FILE} )
ENDIF()

INCLUDE(AddFileDependencies)

# Include the library include directories, and the current build directory (moc)
INCLUDE_DIRECTORIES(
  ../../include
  ${CMAKE_CURRENT_BINARY_DIR}
)

ADD_EXECUTABLE(
  cmdline_tester
  cmdline_tester.cpp
  cmdlineparser.cpp
)

TARGET_LINK_LIBRARIES(
  cmdline_tester
  ${QT_LIBRARIES}
  ${Qt5Widgets_LIBRARIES}
  qjson${QJSON_SUFFIX}
)

##### Probably don't want to edit below this line #####

IF (WIN32 AND Qt5Core_FOUND)
  FIND_PACKAGE( Qt5Widgets REQUIRED )

  INCLUDE_DIRECTORIES(${Qt5Widgets_INCLUDE_DIRS})
  ADD_DEFINITIONS(${Qt5Widgets_DEFINITIONS})
  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
ENDIF()

IF (NOT Qt5Core_FOUND)
  # Use it
  INCLUDE( ${QT_USE_FILE} )
ENDIF()

INCLUDE(AddFileDependencies)

# Include the library include directories, and the current build directory (moc)
INCLUDE_DIRECTORIES(
  ../../include
  ${CMAKE_CURRENT_BINARY_DIR}
)

ADD_EXECUTABLE(
  cmdline_tester
  cmdline_tester.cpp
  cmdlineparser.cpp
)

TARGET_LINK_LIBRARIES(
  cmdline_tester
  ${QT_LIBRARIES}
  qjson${QJSON_SUFFIX}
)

if(WIN32)
    target_link_libraries(
        cmdline_tester
        ${QT_QTGUI_LIBRARY}
        ${Qt5Widgets_LIBRARIES}
    )
endif()

Fix linking tests on Windows
Fix linking tests on Windows
