Skip to content

Commit

Permalink
#150: Use CPM to bring in external dependency fmt (#151)
Browse files Browse the repository at this point in the history
  • Loading branch information
blozano-tt authored Oct 15, 2024
1 parent fa9d3e7 commit 2361d68
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 7 deletions.
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -DDEBUG=DEBUG")
include(${PROJECT_SOURCE_DIR}/cmake/dependencies.cmake)

add_library(umd_common_directories INTERFACE)
target_include_directories(umd_common_directories INTERFACE ${PROJECT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/device ${PROJECT_SOURCE_DIR}/third_party/fmt/include)
target_include_directories(umd_common_directories INTERFACE ${PROJECT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/device)

add_subdirectory(${PROJECT_SOURCE_DIR}/device)

Expand Down
10 changes: 10 additions & 0 deletions cmake/dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,16 @@ CPMAddPackage(
"LIBUV_BUILD_TESTS OFF"
)

############################################################################################################################
# fmt : https://github.com/fmtlib/fmt
############################################################################################################################

CPMAddPackage(
NAME fmt
GITHUB_REPOSITORY fmtlib/fmt
GIT_TAG 11.0.1
)

if(NOT MASTER_PROJECT)
set(nng_include_dir ${nanomsg_SOURCE_DIR}/include PARENT_SCOPE)
set(flatbuffers_include_dir ${flatbuffers_SOURCE_DIR}/include PARENT_SCOPE)
Expand Down
2 changes: 1 addition & 1 deletion device/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ set(UMD_DEVICE_SRCS
add_library(umd_device SHARED ${UMD_DEVICE_SRCS})
target_link_libraries(umd_device
PUBLIC yaml-cpp::yaml-cpp umd_common_directories nng uv compiler_flags
PRIVATE hwloc rt Boost::interprocess
PRIVATE hwloc rt Boost::interprocess fmt
)
target_include_directories(umd_device PUBLIC
${flatbuffers_SOURCE_DIR}/include
Expand Down
2 changes: 1 addition & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ elseif($ENV{ARCH_NAME} STREQUAL "blackhole")
endif()

add_library(test_common INTERFACE)
target_link_libraries(test_common INTERFACE umd_device gtest_main gtest pthread)
target_link_libraries(test_common INTERFACE umd_device gtest_main gtest pthread fmt)
target_include_directories(test_common INTERFACE
${PROJECT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
Expand Down
1 change: 0 additions & 1 deletion third_party/fmt
Submodule fmt deleted from b50e68

0 comments on commit 2361d68

Please sign in to comment.