There is the following files:
MyWidget
|- MyWidget.cpp
|- MyWidget.hpp
|- MyWidget_UnitTest.cpp
I would like to generate at once following files:
- MyWidget.dll (or equivalent for non windows OS)
- MyWidget_UnitTest.exe (or equivalent for non windows OS)
So it is easy to test the widget for bugs, but also to have the result inside further widgets or projects.
I tried to manipulate the .pro file, but with no success:
# ONLY TESTING UNIT
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = MyWidget_UnitTest
TEMPLATE = app
SOURCES +=\
MyWidget.cpp \
MyWidget_UnitTest.cpp
HEADERS += \
MyWidget.hpp
CONFIG += c++11 -Wall
#ONLY LIB
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = MyWidget_UnitTest
TEMPLATE = lib
SOURCES +=\
MyWidget.cpp \
MyWidget_UnitTest.cpp
HEADERS += \
MyWidget.hpp
CONFIG += c++11 -Wall
CONFIG += dll
I am unable to merge both into a single project.
Possibly more result could be added: static vs dynamic lib, etc.
Aucun commentaire:
Enregistrer un commentaire