-
Notifications
You must be signed in to change notification settings - Fork 217
Fix name conflict & Support cmake install #97
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
Changes from all commits
295cdda
f6b5578
42394fa
89cc5ee
d4f1cfb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,25 @@ | ||
| CMAKE_MINIMUM_REQUIRED( VERSION 3.25 ) | ||
|
|
||
| add_library( | ||
| atomic_queue | ||
| INTERFACE | ||
| ${CMAKE_CURRENT_SOURCE_DIR}/atomic_queue/atomic_queue.h | ||
| ${CMAKE_CURRENT_SOURCE_DIR}/atomic_queue/atomic_queue_mutex.h | ||
| ${CMAKE_CURRENT_SOURCE_DIR}/atomic_queue/barrier.h | ||
| ${CMAKE_CURRENT_SOURCE_DIR}/atomic_queue/defs.h | ||
| ${CMAKE_CURRENT_SOURCE_DIR}/atomic_queue/spinlock.h | ||
| include(GNUInstallDirs) | ||
|
|
||
| add_library(atomic_queue INTERFACE) | ||
| target_include_directories(atomic_queue INTERFACE | ||
| "$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}>" | ||
| "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>" | ||
| ) | ||
|
|
||
| target_include_directories( | ||
| atomic_queue | ||
| INTERFACE | ||
| ${CMAKE_CURRENT_SOURCE_DIR} | ||
| ) | ||
| add_library(atomic_queue::atomic_queue ALIAS atomic_queue) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @max0x7ba
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree, we need make a new release after merge this.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And also, after make a new release, I will submit a new pr to add cmake usage about FetchContent. |
||
|
|
||
| if ( ATOMIC_QUEUE_ENABLE_INSTALL ) | ||
| install(TARGETS atomic_queue EXPORT atomic_queue) | ||
| install( | ||
| DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/atomic_queue" | ||
| DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" | ||
| ) | ||
| install( | ||
| EXPORT atomic_queue | ||
| FILE atomic_queue-config.cmake | ||
| DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/atomic_queue" | ||
| NAMESPACE atomic_queue:: | ||
| ) | ||
| endif () | ||
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 very generic and might potentially conflict with some other package in the vcpkg ecosystem, perhaps it might be a good time to change this internal library name from
atomic_queueto something likemax0x7ba_atomic_queueand then alias that to eithermax0x7ba::atomic_queueoratomic_queue::atomic_queue?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.
IMO changing the port name of vcpkg is not a good idea, as it would break downstream. As for naming conflicts, that is an issue future ports should consider, I would like to keep the current port name.