Skip to content

Commit

Permalink
[armadillo] Make primary CMake target armadillo::armadillo and reduce…
Browse files Browse the repository at this point in the history
… aliases

* Make armadillo::armadillo the primary CMake target because the
  upstream CMake module doesn't enforce this behaviour, and the policy
  of CCI is to use packagename::packagename when no target is enforced
* Make Armadillo::Armadillo and armadillo CMake target aliases as these
  are common in the wild, and this will facilitate conan package
  compatibility with existing build scripts.
* Remove Armadillo::armadillo and Armadillo as CMake targets as these
  have not been observed in the wild.
  • Loading branch information
samuel-emrys committed Jan 9, 2024
1 parent 6d83aa4 commit 64016f5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions recipes/armadillo/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,8 @@ def package_info(self):
self.cpp_info.set_property("pkg_config_name", "armadillo")
self.cpp_info.set_property("cmake_find_mode", "both")
self.cpp_info.set_property("cmake_file_name", "Armadillo")
self.cpp_info.set_property("cmake_target_name", "Armadillo::Armadillo")
self.cpp_info.set_property("cmake_target_aliases", ["Armadillo", "armadillo", "armadillo::armadillo", "Armadillo::armadillo"])
self.cpp_info.set_property("cmake_target_name", "armadillo::armadillo")
self.cpp_info.set_property("cmake_target_aliases", ["armadillo", "Armadillo::Armadillo"])
self.cpp_info.set_property("cmake_build_modules", [self._module_vars_rel_path])

# Remove when cmake_find_package and pkg_config generators are no
Expand Down
2 changes: 1 addition & 1 deletion recipes/armadillo/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if (LINK_HDF5)
endif()

add_executable(example src/example.cpp)
target_link_libraries(example Armadillo::Armadillo ${HDF5_TARGETS})
target_link_libraries(example armadillo::armadillo ${HDF5_TARGETS})
set_property(TARGET example PROPERTY CXX_STANDARD 11)

# Test whether variables from https://cmake.org/cmake/help/latest/module/FindArmadillo.html are properly defined
Expand Down
2 changes: 1 addition & 1 deletion recipes/armadillo/all/test_v1_package/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ conan_basic_setup(TARGETS)
find_package(Armadillo REQUIRED)

add_executable(example ../test_package/src/example.cpp)
target_link_libraries(example Armadillo::Armadillo)
target_link_libraries(example armadillo::armadillo)
set_property(TARGET example PROPERTY CXX_STANDARD 11)

# Test whether variables from https://cmake.org/cmake/help/latest/module/FindArmadillo.html are properly defined
Expand Down

0 comments on commit 64016f5

Please sign in to comment.