Closed cguentherTUChemnitz closed 7 years ago
Hi @cguentherTUChemnitz ! This is very good idea. I thought to add support of cmake, but unfortunately I'm not familiar with it.
Several thoughts on your code:
Shared and static Maybe instead of one option SHARED_LIB we could use two options: SHARED_LIB and STATIC_LIB. So user can build either one of the lib variants (shared or static) or both of them at the same time. And by default cmake will set option for shared library.
Qt4 and Qt5 In cmake file you set Qt5Core package as required. But what if I want to build qtcsv with Qt4?
Yeah i understand your thoughts.
shared and static Yeah, I saw you commit. Do not tested it yet, but looks good.
Qt4 and Qt5 Let's expose two new options: QT4 and QT5. By default they are both OFF.
I simplified a bit your Qt4 and Qt5 configuration suggestion.
I implemented only one option "USE_QT4", which defaults to OFF. In the disabled / default case Qt5 is used. We do not have to check against double definition of Qt Version, because only one option exists. If the user explicitly want to set either to Qt4 or Qt5, than he can switch by -DUSE_QT4=ON
or -DUSE_QT4=OFF
.
I merged your commits into dev branch. But work on cmake support still in progress... Thank you for your time and code!)
I want to create a conan.io package of your project. It easier to handle this, when the project builds with cmake. Therefore i implemented cmake project handling. I tried to adopt as most as possible of your qmake setup. Including your lib-versioning and symlinking.
You can test with example build:
I added two options, to handle the shared or static lib compilations, as well as the testing as a post-build step. This can be switched by:
cmake .. -DSHARED_LIB=OFF -DBUILD_AND_RUN_TESTS=OFF
I added also the installations commands. The default installation prefix is /usr/local for cmake. The installation can be started with:
make install