Skip to content

Improve cmake#100

Open
MhmRhm wants to merge 1 commit into
kosma:masterfrom
MhmRhm:improve-cmake
Open

Improve cmake#100
MhmRhm wants to merge 1 commit into
kosma:masterfrom
MhmRhm:improve-cmake

Conversation

@MhmRhm

@MhmRhm MhmRhm commented Jun 9, 2026

Copy link
Copy Markdown

Here is a clean, modern, FetchContent-friendly CMake rewrite of the project. It is structured so that:

  • works as standalone project
  • works via FetchContent
  • supports install() + find_package()
  • keeps examples/tests optional
  • avoids global flag pollution
  • uses proper target-based CMake

How users consume it (FetchContent)

include(FetchContent)

FetchContent_Declare(
    minmea
    GIT_REPOSITORY https://github.com/your/minmea.git
    GIT_TAG master
)

FetchContent_MakeAvailable(minmea)

target_link_libraries(my_app PRIVATE minmea::minmea)

Or with find_package (after install)

find_package(minmea REQUIRED)

target_link_libraries(my_app PRIVATE minmea::minmea)

What is improved vs original

✔ Fully target-based

No global CMAKE_C_FLAGS

✔ Safe for embedding

Works inside other projects without side effects

✔ FetchContent compatible

No assumptions about install step

✔ Proper namespace

minmea::minmea

✔ Clean install/export system

Supports find_package

✔ Optional components

  • examples
  • tests
  • install toggle

✔ Modern CMake practices

  • generator expressions
  • interface include dirs
  • alias target

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.

1 participant