Skip to content

Commit e6229e1

Browse files
committed
Create a local tsl-robin-mapTargets.cmake to fix issue #45
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()
1 parent 228883d commit e6229e1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,10 @@ if(${CMAKE_VERSION} VERSION_GREATER "3.2")
5252
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/cmake/tsl-robin-map")
5353

5454

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

56-
## Create and install tsl-robin-mapTargets.cmake
58+
## Create and install global tsl-robin-mapTargets.cmake
5759
install(TARGETS robin_map
5860
EXPORT tsl-robin-mapTargets)
5961

0 commit comments

Comments
 (0)