Skip to content
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

Amalgate #907

Closed
milipili opened this issue Jan 9, 2018 · 5 comments
Closed

Amalgate #907

milipili opened this issue Jan 9, 2018 · 5 comments
Assignees
Labels
solution: proposed fix a fix for the issue has been proposed and waits for confirmation
Milestone

Comments

@milipili
Copy link

milipili commented Jan 9, 2018

Bug Report

  • What is the issue you have?
[ 44%] Performing update step for 'amalgamate'
Current branch master is up to date.
[ 44%] Performing configure step for 'amalgamate'
-- Configuring done
-- Generating done
-- Build files have been written to: /home/milipili/projects/hc/yml2json/ext/json/amalgamate-prefix/src/amalgamate-build
[ 45%] Performing build step for 'amalgamate'
[100%] Built target amalgamate
[ 46%] Performing install step for 'amalgamate'
[100%] Built target amalgamate
Install the project...
-- Install configuration: ""
-- Up-to-date: /home/milipili/projects/hc/yml2json/bin/amalgamate
[ 46%] Completed 'amalgamate'
[ 48%] Built target amalgamate
[ 49%] Amalgamating json.hpp...
/bin/sh: 1: cd: can't cd to /home/milipili/projects/hc/yml2json/src
ext/json/CMakeFiles/single_header.dir/build.make:57: recipe for target 'ext/json/CMakeFiles/single_header' failed
make[2]: *** [ext/json/CMakeFiles/single_header] Error 2
CMakeFiles/Makefile2:1576: recipe for target 'ext/json/CMakeFiles/single_header.dir/all' failed
make[1]: *** [ext/json/CMakeFiles/single_header.dir/all] Error 2
Makefile:129: recipe for target 'all' failed

Simply importing the json project does not work when building in-source.

  • Please describe the steps to reproduce the issue. Can you provide a small but working code example?
  • CMakeLists.txt
cmake_minimum_required(VERSION 3.9)
project(xxxxxx)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

set(JSON_BuildTests OFF CACHE STRING "")
add_subdirectory("ext/json")
  • What is the expected behavior?

It should compile.

  • And what is the actual behavior instead?

Well, obviously, it does not compile :)

  • Which compiler and operating system are you using? Is it a supported compiler?

  • Did you use a released version of the library or the version from the develop branch?

develop / b67e00b

Feature Request

  • Describe the feature in as much detail as possible.
  • Do not write files outside CMakeFiles (BINARY DIR). I certainly don't want to have a useless bin folder in my output (in source or out-of-source builds).
  • I don't really see the point of the project amalgamate. Simply using cmake to concatenate the files would be good enough and probably safer...
  • Include sample usage where appropriate.
@theodelrieu
Copy link
Contributor

theodelrieu commented Jan 9, 2018

Oops, sorry about that. I shall have a look tomorrow, but I would bet on a missing directory creation...

Could you try to tweak the json CMakeLists.txt to force the single_header directory creation?

@nlohmann
Copy link
Owner

nlohmann commented Jan 9, 2018

@theodelrieu I just sent you an email about this ;)

I would propose to not touch amalgamation in the "normal" build, but to add a special maintainer target for this. I opened a branch to sketch my idea: https://github.com/nlohmann/json/tree/reorganized.

@theodelrieu
Copy link
Contributor

That makes sense, the quickfix should be to remove the ALL in the custom_target_command. Unfortunately I cannot test it right now...

@theodelrieu
Copy link
Contributor

@nlohmann I don't see the new amalgamate python script in the latest develop commit, most likely because of the .gitignore.

@nlohmann
Copy link
Owner

@theodelrieu You are right - it was caught by the gitignore file. I just commited the script to the develop branch.

@milipili The original issue should be fixed now.

@nlohmann nlohmann added the solution: proposed fix a fix for the issue has been proposed and waits for confirmation label Jan 13, 2018
@nlohmann nlohmann self-assigned this Jan 14, 2018
@nlohmann nlohmann added this to the Release 3.1.0 milestone Jan 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solution: proposed fix a fix for the issue has been proposed and waits for confirmation
Projects
None yet
Development

No branches or pull requests

3 participants