Skip to content

the test_install does not build (include path wrong set in cmake config package) #104

Closed
@ClausKlein

Description

:~/.cache/CPM/project_options/test_install$ cmake -B build -G Ninja -D CMAKE_PREFIX_PATH=$PWD/../test/stage/usr/local
-- vcpkg is already installed at ~/vcpkg.
-- Running vcpkg install
Detecting compiler hash for triplet x64-linux...
All requested packages are currently installed.
Restored 0 packages from ~/.cache/vcpkg/archives in 1 us. Use --debug to see more details.

Total elapsed time: 1.628 s

The package eigen3 provides CMake targets:

    find_package(Eigen3 CONFIG REQUIRED)
    target_link_libraries(main PRIVATE Eigen3::Eigen)

The package fmt provides CMake targets:

    find_package(fmt CONFIG REQUIRED)
    target_link_libraries(main PRIVATE fmt::fmt)

    # Or use the header-only version
    find_package(fmt CONFIG REQUIRED)
    target_link_libraries(main PRIVATE fmt::fmt-header-only)

-- Running vcpkg install - done
-- The default CMAKE_CXX_STANDARD used by external targets and tools is not set yet. Using the latest supported C++ standard that is 20
-- The default CMAKE_C_STANDARD used by external targets and tools is not set yet. Using the latest supported C standard that is 17
-- Interprocedural optimization is enabled. In other projects, linking with the compiled libraries of this project might require `set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)`
-- /usr/bin/ccache found and enabled
-- Conan: Adding cci remote repository (https://center.conan.io) verify ssl (True)
-- Conan: Adding bincrafters remote repository (https://bincrafters.jfrog.io/artifactory/api/conan/public-conan) verify ssl (True)
-- Single configuration build!
-- Running Conan for build type 'RelWithDebInfo'
-- Conan: checking conan executable
-- Conan: Found program ~/.local/bin/conan
-- Conan: Version found Conan version 1.46.1
-- Conan executing:~/.local/bin/conan install ~/.cache/CPM/project_options/test_install --build missing --env CC=/usr/bin/cc --env CXX=/usr/bin/c++ --settings build_type=RelWithDebInfo --settings compiler=gcc --settings compiler.version=10 --settings compiler.libcxx=libstdc++11 --settings compiler.cppstd=20
Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=RelWithDebInfo
compiler=gcc
compiler.cppstd=20
compiler.libcxx=libstdc++11
compiler.version=10
os=Linux
os_build=Linux
[options]
[build_requires]
[env]
CC=/usr/bin/cc
CXX=/usr/bin/c++
conanfile.txt: Installing package
Requirements
    docopt.cpp/0.6.3 from 'cci' - Cache
Packages
    docopt.cpp/0.6.3:8a88cc7b41866206faedec217e3c9b3f0f909078 - Cache

Installing (downloading, building) binaries...
docopt.cpp/0.6.3: Already installed!
conanfile.txt: Generator cmake_find_package_multi created docopt-config-version.cmake
conanfile.txt: Generator cmake_find_package_multi created docoptTarget-relwithdebinfo.cmake
conanfile.txt: Generator cmake_find_package_multi created docoptTargets.cmake
conanfile.txt: Generator cmake_find_package_multi created docopt-config.cmake
conanfile.txt: Generator txt created conanbuildinfo.txt
conanfile.txt: Aggregating env generators
conanfile.txt: Generated conaninfo.txt
conanfile.txt: Generated graphinfo
-- Library docopt found ~/.conan/data/docopt.cpp/0.6.3/_/_/package/8a88cc7b41866206faedec217e3c9b3f0f909078/lib/libdocopt.a
-- Found: 
~/.conan/data/docopt.cpp/0.6.3/_/_/package/8a88cc7b41866206faedec217e3c9b3f0f909078/lib/libdocopt.a
-- Library docopt found ~/.conan/data/docopt.cpp/0.6.3/_/_/package/8a88cc7b41866206faedec217e3c9b3f0f909078/lib/libdocopt.a
-- Found: 
~/.conan/data/docopt.cpp/0.6.3/_/_/package/8a88cc7b41866206faedec217e3c9b3f0f909078/lib/libdocopt.a
-- Configuring done
-- Generating done
-- Build files have been written to: ~/.cache/CPM/project_options/test_install/build
:~/.cache/CPM/project_options/test_install$ cd build
 :~/.cache/CPM/project_options/test_install/build$ ninja
[1/2] Building CXX object CMakeFiles/another_main.dir/another_main.cpp.o
FAILED: CMakeFiles/another_main.dir/another_main.cpp.o
~/.local/lib/python3.8/site-packages/cmake/data/bin/cmake -E __run_co_compile --launcher=/usr/bin/ccache --tidy="~/.local/bin/clang-tidy;-extra-arg=-Wno-unknown-warning-option;-extra-arg=-std=c++20;--extra-arg-before=--driver-mode=g++" --cppcheck="/usr/bin/cppcheck;--template=gcc;--enable=style,performance,warning,portability;--inline-suppr;--suppress=internalAstError;--suppress=unmatchedSuppression;--inconclusive;--std=c++20" --source=~/.cache/CPM/project_options/test_install/another_main.cpp -- /usr/bin/c++ -DFMT_LOCALE -isystem ~/.cache/CPM/project_options/test/stage/usr/local/. -isystem ~/.cache/CPM/project_options/test_install/build/vcpkg_installed/x64-linux/include -isystem ~/.cache/CPM/project_options/test_install/build/vcpkg_installed/x64-linux/include/eigen3 -O2 -g -DNDEBUG -flto -fno-fat-lto-objects -fdiagnostics-color=always -Wall -Wextra -Wshadow -Wnon-virtual-dtor -Wold-style-cast -Wcast-align -Wunused -Woverloaded-virtual -Wpedantic -Wconversion -Wsign-conversion -Wnull-dereference -Wdouble-promotion -Wformat=2 -Wimplicit-fallthrough -Wmisleading-indentation -Wduplicated-cond -Wduplicated-branches -Wlogical-op -Wuseless-cast -march=native --coverage -O0 -g -std=c++2a -MD -MT CMakeFiles/another_main.dir/another_main.cpp.o -MF CMakeFiles/another_main.dir/another_main.cpp.o.d -o CMakeFiles/another_main.dir/another_main.cpp.o -c ~/.cache/CPM/project_options/test_install/another_main.cpp
~/.cache/CPM/project_options/test_install/another_main.cpp:1:10: error: 'mylib/lib.hpp' file not found [clang-diagnostic-error]
#include <mylib/lib.hpp>
         ^
1 warning and 2 errors generated.
Error while processing ~/.cache/CPM/project_options/test_install/another_main.cpp.
Suppressed 1 warnings (1 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
Found compiler error(s).
ninja: build stopped: subcommand failed.

~/.cache/CPM/project_options/test_install/build$ find $PWD/../../test/stage -name '*.hpp'
~/.cache/CPM/project_options/test_install/build/../../test/stage/usr/local/include/mylib/lib.hpp
~/.cache/CPM/project_options/test_install/build/../../test/stage/usr/local/include/mylib2/lib.hpp
~/.cache/CPM/project_options/test_install/build$

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions