Skip to content

Conversation

@DrErickson
Copy link

This branch adds functionality that allows the stanford-cpp-library and related projects to be built from CMake rather than the Qt native qmake build system. Building from CMake makes it possible to use other IDEs for development.

I'm unsure if this should be left as a separate fork, merged, or documented as an option.

The following is a summary of the changes needed to build from CMake:

  • Added a CMakeList.txt in main directory to build the stanford-cpp-library
  • Added CMakeList.txt files to each of the project subdirectories
  • Moved filelib_isDirectory to before filelib_createDirectory to fix a scope issue
  • Modified build.h.in to accommodate CMake generation of the build.h file
  • The gif icons did not load for the console when building from CMake. Digging into the documentation, I found that QPixmap does not support gif images by default. To ensure the icons are always readable, the icons were converted to png files (the old gif icons are preserved in a separate folder). Relevant documentation is found here: https://doc.qt.io/qt-6/qpixmap.html#reading-and-writing-image-files

I verified the CMake builds on CLion 2024 and Visual Studio Code. I also tested the build on MacOS, Linux, and Windows using the SPL-unit-tests.

DrErickson and others added 22 commits August 20, 2024 05:34
Verified "Welcome", "SPL-unit-tests", and "SimpleTestGuide" working for Windows, MinGW, Qt6.2.4
Updated CMAKE_PREFIX_PATH to look at most likely install path based on OS
…lt. In some rare cases, Windows does not load the gif icons. Converted icons to png and updated images.qrc ensure compatibility.

https://doc.qt.io/qt-6/qimagewriter.html#supportedImageFormats
…ion.

Modified the library CMakeLists.txt to copy resources folder into per-user writable data location from QtStandardPaths.
Updated CMakeLists.txt to include Qt6::Multimedia.  Needed for changes to sounds library.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants