-
-
Notifications
You must be signed in to change notification settings - Fork 564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modernize CMake #374
base: master
Are you sure you want to change the base?
Modernize CMake #374
Conversation
All modern operating systems have at least CMake 3.12 installed, including all 3 in the CI build matrix. That allows more modern CMake features to be used. `MINGW` is defined since version 3.2. Specify allowed configuration types in `CMAKE_CONFIGURATION_TYPES`. Finally, add new option: `CMARK_EXE`.
* Use cmark as static library name when CMARK_SHARED is disabled. * Change install directory for CMake files on Windows.
CMake discourages the use of global commands like add_compile_options. Instead, things like target_compile_options should be used. Additional changes: + Do not build the cmark program when CMARK_EXE is off. + Use ENABLE_EXPORTS to disable -rdynamic. + Export cmark_static as just cmark when shared is disabled.
Hello! In Evince (Document Viewer), there is work in progress to support markdown files (via md -> html -> pdf conversion; see https://gitlab.gnome.org/GNOME/evince/-/merge_requests/391). I think the build option CMARK_EXE is what is needed to only build cmark as library for a flatpak build. So, it would be nice to have this. Thanks! |
@nwellnhof is there no build configuration currently accessible that allows building without creating the executable? It has been a while; I don't recall all the reasons this wasn't merged, but I think they include:
I see the value in something like CMARK_EXE. Maybe it's possible to extract that part of this patch without requiring more than cmake 3.7? |
@jgm: I now build with '-BUILDDIR=build' option in the json file, but '-DCMAKE_INSTALL_PREFIX=/app' does not work. However, if I edit the Makefile by removing the '?' after 'INSTALL_PREFIX' and by adding '/app' after '=', it works (I edit the file, then recompress in personal archive). Did I use the wrong option? |
This pull request updates the cmake build system to use more modern features. The minimum required version is v3.12, which is found in all three GitHub runners.
Changes:
add_compile_options
withtarget_compile_options
. CMake strongly encourages encourages this practice.CMARK_EXE
. When turned off, the cmark executable will not be built. Useful for when building cmark as a subproject.