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

ctest (58+60,/67 cmake_import_configure) fails when build with -D JSON_Install:BOOL=OFF because of missing nlohmann_jsonTargets.cmake #2946

Closed
2 of 5 tasks
Andreas-Schniertshauer opened this issue Aug 18, 2021 · 1 comment · Fixed by #2947
Assignees
Labels
confirmed kind: bug solution: proposed fix a fix for the issue has been proposed and waits for confirmation

Comments

@Andreas-Schniertshauer
Copy link

What is the issue you have?

Start 58: cmake_import_configure
58/67 Test #58: cmake_import_configure .......................***Failed    2.07 sec
...
-- Found nlohmann_json: build/json/nlohmann_jsonConfig.cmake (found version "3.10.0")
CMake Error at build/json/nlohmann_jsonConfig.cmake:6 (include):
  include could not find requested file:

    build/json/nlohmann_jsonTargets.cmake
Call Stack (most recent call first):
  CMakeLists.txt:5 (find_package)

This is because in CMakeLists.txt export ... NLOHMANN_JSON_CMAKE_PROJECT_TARGETS_FILE is called only in case of JSON_Install is true.

Please describe the steps to reproduce the issue.

  1. cmake .. -D JSON_Install:BOOL=OFF -D JSON_ImplicitConversions:BOOL=OFF -D JSON_BuildTests:BOOL=ON
  2. cmake --build . --config Release
  3. ctest -C Release --output-on-failure

What is the expected behavior?

Tests should not fail when using flags -D JSON_Install:BOOL=OFF -D JSON_ImplicitConversions:BOOL=OFF -D JSON_BuildTests:BOOL=ON

And what is the actual behavior instead?

Some tests fail.

Which compiler and operating system are you using?

  • Compiler: Visual Studio 2019 16.11.1 Professional
  • Operating system: Windows 10 21H1

Which version of the library did you use?

  • latest release version 3.10.0 (zip file)
  • other release - please state the version: ___
  • the develop branch

If you experience a compilation error: can you compile and run the unit tests?

  • yes
  • no - please copy/paste the error message below
@nlohmann
Copy link
Owner

I can confirm this.

Full output:

58/67 Test #58: cmake_import_configure .......................***Failed    0.41 sec
-- The CXX compiler identification is AppleClang 12.0.5.12050022
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found nlohmann_json: /Users/niels/Documents/repositories/json/build/nlohmann_jsonConfig.cmake (found version "3.10.0") 
CMake Error at /Users/niels/Documents/repositories/json/build/nlohmann_jsonConfig.cmake:6 (include):
  include could not find requested file:

    /Users/niels/Documents/repositories/json/build/nlohmann_jsonTargets.cmake
Call Stack (most recent call first):
  CMakeLists.txt:5 (find_package)


-- Configuring incomplete, errors occurred!
See also "/Users/niels/Documents/repositories/json/build/test/cmake_import/CMakeFiles/CMakeOutput.log".
See also "/Users/niels/Documents/repositories/json/build/test/cmake_import/CMakeFiles/CMakeError.log".

      Start 59: cmake_import_build
Failed test dependencies: cmake_import_configure
59/67 Test #59: cmake_import_build ...........................***Not Run   0.00 sec
      Start 60: cmake_import_minver_configure
60/67 Test #60: cmake_import_minver_configure ................***Failed    0.46 sec
-- The CXX compiler identification is AppleClang 12.0.5.12050022
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found nlohmann_json: /Users/niels/Documents/repositories/json/build/nlohmann_jsonConfig.cmake (found suitable version "3.10.0", minimum required is "3.2.0") 
CMake Error at /Users/niels/Documents/repositories/json/build/nlohmann_jsonConfig.cmake:6 (include):
  include could not find requested file:

    /Users/niels/Documents/repositories/json/build/nlohmann_jsonTargets.cmake
Call Stack (most recent call first):
  CMakeLists.txt:5 (find_package)


-- Configuring incomplete, errors occurred!
See also "/Users/niels/Documents/repositories/json/build/test/cmake_import_minver/CMakeFiles/CMakeOutput.log".
See also "/Users/niels/Documents/repositories/json/build/test/cmake_import_minver/CMakeFiles/CMakeError.log".

      Start 61: cmake_import_minver_build
Failed test dependencies: cmake_import_minver_configure
61/67 Test #61: cmake_import_minver_build ....................***Not Run   0.00 sec
...
94% tests passed, 4 tests failed out of 67

Label Time Summary:
all                 = 639.60 sec*proc (56 tests)
git_required        =   6.52 sec*proc (2 tests)
not_reproducible    =  22.95 sec*proc (10 tests)

Total Test time (real) = 677.98 sec

The following tests FAILED:
	 58 - cmake_import_configure (Failed)
	 59 - cmake_import_build (Not Run)
	 60 - cmake_import_minver_configure (Failed)
	 61 - cmake_import_minver_build (Not Run)
Errors while running CTest

@nlohmann nlohmann self-assigned this Aug 18, 2021
@nlohmann nlohmann added the solution: proposed fix a fix for the issue has been proposed and waits for confirmation label Aug 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed kind: bug solution: proposed fix a fix for the issue has been proposed and waits for confirmation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants