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

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

Closed
ClausKlein opened this issue Mar 17, 2022 · 4 comments · May be fixed by #105
Closed

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

ClausKlein opened this issue Mar 17, 2022 · 4 comments · May be fixed by #105
Labels
bug Something isn't working

Comments

@ClausKlein
Copy link
Contributor

ClausKlein commented Mar 17, 2022

:~/.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$
@aminya
Copy link
Owner

aminya commented Mar 17, 2022

The CI and I cannot reproduce this:
https://github.com/cpp-best-practices/project_options/actions/runs/1995289932

@aminya aminya added the more-information-needed The issue needs for information label Mar 17, 2022
@ClausKlein
Copy link
Contributor Author

ClausKlein commented Mar 17, 2022

The CI and I cannot reproduce this: https://github.com/cpp-best-practices/project_options/actions/runs/1995289932

sure, it is not tested on CI (I will add it soon)

@aminya aminya added bug Something isn't working and removed more-information-needed The issue needs for information labels Mar 17, 2022
@ClausKlein
Copy link
Contributor Author

sure, it is not tested on CI (I will add it soon)

Ops, it is tested, and it works on CI!
see https://github.com/cpp-best-practices/project_options/blob/b6a86f897d7b21f2e3a32f7078250dfd83ce253b/Taskfile.yml#L19

May it possible, that CMAKE_INSTALL_INCLUDEDIR is set in some way on CI?

@aminya
Copy link
Owner

aminya commented Jul 13, 2022

I think this is fixed by other means. Please open it if still relevant.

@aminya aminya closed this as completed Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants