Skip to content

Commit

Permalink
Create a local tsl-robin-mapTargets.cmake to fix issue #45
Browse files Browse the repository at this point in the history
With this local Targets file the CMake binary directory can be passed to find_package without needing an installation.

Example:
find_package(tsl-robin-map PATHS "/home/user/robin-map/build")
if (tsl-robin-map_FOUND)
    target_link_libraries(my_project PRIVATE tsl::robin_map)
endif()
  • Loading branch information
Tessil committed Feb 27, 2022
1 parent 228883d commit e6229e1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ if(${CMAKE_VERSION} VERSION_GREATER "3.2")
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/cmake/tsl-robin-map")


## Create local tsl-robin-mapTargets.cmake
export(TARGETS robin_map NAMESPACE tsl:: FILE "${CMAKE_CURRENT_BINARY_DIR}/tsl-robin-mapTargets.cmake")

## Create and install tsl-robin-mapTargets.cmake
## Create and install global tsl-robin-mapTargets.cmake
install(TARGETS robin_map
EXPORT tsl-robin-mapTargets)

Expand Down

0 comments on commit e6229e1

Please sign in to comment.