inyokaproject / inyokaedit

A markup editor for Inyoka articles.
GNU General Public License v3.0
7 stars 6 forks source link

Add Cmake Closes #110 #111

Closed Lasall closed 3 years ago

Lasall commented 3 years ago

I didn't compare the (Linux) compiler flags with qmake. The CMake compile instructions can be generated with the option -DCMAKE_EXPORT_COMPILE_COMMANDS=ON which generates a file compile_commands.json.

Following steps will configure and build the project (change Qt install path and any make options accordingly):

cmake -B build-cmake -DCMAKE_PREFIX_PATH=/opt/Qt/5.15.2/gcc_64
cmake --build build-cmake -- -j8
sudo cmake --install build-cmake  # or DESTDIR=foobar cmake --install build-cmake
ElTh0r0 commented 3 years ago

Many thanks @Lasall I'll need some time before merging it - not because I don't trust you that it is working as expected, but I want to (try to) understand the provided cmake setup and do some tests since I never used cmake before :)

Lasall commented 3 years ago

No worries, on the way you can maybe add the missing macOS instructions. I might find some time next week to add missing Windows instructions. Will also compare the build instructions (compile_commands.json) to make sure the compiler invocations are the same. Does InyokaEdit generally work with Qt6? If so we could add an option for Qt6.

ElTh0r0 commented 3 years ago

Yes Qt6 is working! There are only two things to be considered:

ElTh0r0 commented 3 years ago

It took me longer than expected to find time to test it. In the end testing was quite easy, but for sure I would not have been able to write the cmake files myself! One more time: Many thanks Lasall!