Skip to content

Commit

Permalink
Add Exiv2 namespace for exported targets
Browse files Browse the repository at this point in the history
* This matches an alias target name
* Recommend using the namespaced target in the README

Signed-off-by: Ryan Friedman <ryan.friedman+github@avinc.com>
(cherry picked from commit eb05551)
  • Loading branch information
Ryanf55 authored and mergify[bot] committed Jul 26, 2023
1 parent 462f8fd commit 9a969d4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ set(CMAKE_CXX_EXTENSIONS OFF)
find_package(exiv2 REQUIRED CONFIG NAMES exiv2) # search ${CMAKE_INSTALL_PREFIX}/lib/cmake/exiv2/
add_executable(exifprint ../samples/exifprint.cpp) # Create exifprint target
target_link_libraries(exifprint PRIVATE exiv2lib) # link exiv2lib
target_link_libraries(exifprint PRIVATE Exiv2::exiv2lib) # link exiv2lib
EOF
$ cmake . # generate the makefile
$ cmake --build . # build the code
Expand Down
3 changes: 2 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ add_library( exiv2lib
${PUBLIC_HEADERS}
$<TARGET_OBJECTS:exiv2lib_int>
)
add_library(Exiv2::exiv2lib ALIAS exiv2lib)

generate_export_header(exiv2lib
EXPORT_MACRO_NAME EXIV2API
Expand Down Expand Up @@ -300,7 +301,7 @@ install(FILES

install(EXPORT exiv2Export
DESTINATION "${CMAKE_INSTALL_DATADIR}/cmake/exiv2"
NAMESPACE exiv2::
NAMESPACE Exiv2::
)

install(
Expand Down

0 comments on commit 9a969d4

Please sign in to comment.