-
Notifications
You must be signed in to change notification settings - Fork 8
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
Feature/install cmake config package #32
Feature/install cmake config package #32
Conversation
464f37b
to
def8c12
Compare
CMakeLists.txt
Outdated
# export cmake config package | ||
set(TARGET_NAME inplace_vector) | ||
set(TARGET_NAMESPACE beman) | ||
set(TARGET_ALIAS ${TARGET_NAMESPACE}::${TARGET_NAME}) | ||
set(TARGET_PREFIX ${TARGET_NAMESPACE}.${TARGET_NAME}) # -> PROJECT_NAME? | ||
set(TARGET_PACKAGE_NAME ${TARGET_NAME}-config) | ||
set(TARGETS_EXPORT_NAME ${TARGET_NAME}-targets) | ||
set(INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/${TARGET_NAME}) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NOTE: we need a decision about this settings: This variant is not usable!
bash-5.2$ cmake -S . -B build -G Ninja -D CMAKE_BUILD_TYPE=Debug --fresh
-- The CXX compiler identification is Clang 19.1.3
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/local/opt/llvm/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Examples to be built: fibonacci
-- Configuring done (0.9s)
-- Generating done (0.0s)
-- Build files have been written to: /Users/clausklein/Workspace/cpp/beman-project/inplace_vector/build
bash-5.2$ ninja -C build
ninja: Entering directory `build'
[8/8] Linking CXX executable examples/beman.inplace_vector.examples.fibonacci
bash-5.2$ ninja -C build test
ninja: Entering directory `build'
[0/1] Running tests...
Test project /Users/clausklein/Workspace/cpp/beman-project/inplace_vector/build
Start 1: beman.inplace_vector.test
1/3 Test #1: beman.inplace_vector.test ........ Passed 0.24 sec
Start 2: find-package-test
2/3 Test #2: find-package-test ................***Failed 1.10 sec
Start 3: fibonacci
3/3 Test #3: fibonacci ........................ Passed 0.24 sec
67% tests passed, 1 tests failed out of 3
Total Test time (real) = 1.59 sec
The following tests FAILED:
2 - find-package-test (Failed)
Errors while running CTest
Output from these tests are in: /Users/clausklein/Workspace/cpp/beman-project/inplace_vector/build/Testing/Temporary/LastTest.log
Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely.
FAILED: CMakeFiles/test.util
cd /Users/clausklein/Workspace/cpp/beman-project/inplace_vector/build && /usr/local/bin/ctest --force-new-ctest-process
ninja: build stopped: subcommand failed.
bash-5.2$ cd build
bash-5.2$ ctest --rerun-failed --verbose
UpdateCTestConfiguration from :/Users/clausklein/Workspace/cpp/beman-project/inplace_vector/build/DartConfiguration.tcl
UpdateCTestConfiguration from :/Users/clausklein/Workspace/cpp/beman-project/inplace_vector/build/DartConfiguration.tcl
Test project /Users/clausklein/Workspace/cpp/beman-project/inplace_vector/build
Constructing a list of tests
Done constructing a list of tests
Updating test list for fixtures
Added 0 tests to meet fixture requirements
Checking test dependency graph...
Checking test dependency graph end
test 2
Start 2: find-package-test
2: Test command: /usr/local/bin/ctest "--verbose" "--output-on-failure" "-C" "Debug" "--build-and-test" "/Users/clausklein/Workspace/cpp/beman-project/inplace_vector/examples" "/Users/clausklein/Workspace/cpp/beman-project/inplace_vector/build/tests/beman/inplace_vector/find-package-test" "--build-generator" "Ninja" "--build-makeprogram" "/usr/local/bin/ninja" "--build-options" "-DCMAKE_CXX_COMPILER=/usr/local/opt/llvm/bin/clang++" "-DCMAKE_CXX_STANDARD=20" "-DCMAKE_BUILD_TYPE=Debug" "-DCMAKE_PREFIX_PATH=/usr/local"
2: Working Directory: /Users/clausklein/Workspace/cpp/beman-project/inplace_vector/build/tests/beman/inplace_vector
2: Test timeout computed to be: 10000000
2: Internal cmake changing into directory: /Users/clausklein/Workspace/cpp/beman-project/inplace_vector/build/tests/beman/inplace_vector/find-package-test
2: Error: cmake execution failed
2: Examples to be built: fibonacci
2: Configuring done (0.0s)
2: CMake Error at CMakeLists.txt:22 (target_link_libraries):
2: Target "beman.inplace_vector.examples.fibonacci" links to:
2:
2: beman::inplace_vector
2:
2: but the target was not found. Possible reasons include:
2:
2: * There is a typo in the target name.
2: * A find_package call is missing for an IMPORTED target.
2: * An ALIAS target is missing.
2:
2:
2:
2: Generating done (0.0s)
2: CMake Generate step failed. Build files cannot be regenerated correctly.
2:
1/1 Test #2: find-package-test ................***Failed 0.06 sec
0% tests passed, 1 tests failed out of 1
Total Test time (real) = 0.07 sec
The following tests FAILED:
2 - find-package-test (Failed)
Errors while running CTest
Output from these tests are in: /Users/clausklein/Workspace/cpp/beman-project/inplace_vector/build/Testing/Temporary/LastTest.log
Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely.
bash-5.2$
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are you trying to say here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the beman naming conventions are not usable!
CMakeLists.txt
Outdated
add_library(beman.inplace_vector INTERFACE) | ||
# [CMAKE.LIBRARY_ALIAS] | ||
add_library(beman::inplace_vector ALIAS beman.inplace_vector) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The library
(export target) must named inplace_vector
only!
Within beman project, this should be unique and with the this exported ALIAS, it is right.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What change are you suggesting here specifically??? This comment is very confusing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the beman name conventions prevent using and installed cmake config package
!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean it prevents CMake config package? Can you provide more details
Use FILE_SET HEADERS for simplify installation Set VERIFY_INTERFACE_HEADER_SETS property Prevent use of include(CTest) Prepare CPack to easy distribution Add all_verify_interface_header_sets to CI builds Prevent in-source builds Ignore cmake configure trash
Co-authored-by: David Sankel <camior@gmail.com>
Add find-package-test Prevent undefined cmake values
def8c12
to
9a7fd7f
Compare
# [CMAKE.LIBRARY_ALIAS] | ||
add_library(beman::inplace_vector ALIAS beman.inplace_vector) | ||
add_library(beman::beman_inplace_vector ALIAS beman_inplace_vector) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is non conforming
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see #32 (comment)
Please try yourself to make it work with confirming names!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wdym try to make it work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
endless loop: you want some changes; I show you it does not work;
|
||
add_library(beman.inplace_vector INTERFACE) | ||
add_library(beman_inplace_vector INTERFACE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This name is non conforming
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see too bemanproject/optional26#82
you will find a way to do it as you like. |
NOTE: This is second of a series of PR based on #14
see too bemanproject/optional26#82