open-source-parsers / open-source-parsers/jsoncpp

CMake configuration needs some improvements

Open
#1,358 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug build
Dominant language
C++
Stars
8.9k
Forks
2.7k
Avg merge
31m
Merged PRs (30d)
1

Description

Describe the bug

Here is a full description, https://github.com/cpm-cmake/CPM.cmake/issues/299.

To Reproduce

  1. Build the problem with a CMake
  2. CMake build and install the project at the same time.

Expected behavior

In modern CMake, build and install targets are not the same, and by mixing them into one step, you are causing issues for other projects that wants to include the jsoncpp as dependency to their projects. Because jsoncpp initiate the install stage, all other projects will get confused and initiate their install stages into the GNU paths, and that should not happen unless intentionally. I was expecting that this flag, JSONCPP_WITH_CMAKE_PACKAGE would allow me to separate this but it doesn't.

Desktop (please complete the following information):

  • OS: macOS Monterey 12.0
  • CMake version, 3.21

Additional context

It is ok that this is a default behaviour but maybe there should be an option to disable it?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked CPM.cmake issue and the repository's CMake configuration around JSONCPP_WITH_CMAKE_PACKAGE. Reproduce the build-and-install behavior using CMake 3.21, then trace where the install stage is initiated. Done means build and install can be separated without causing dependent projects to install into system paths, with an option to disable the behavior if appropriate.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.