DeepForge-Tech / DeepForge-Toolset

DeepForge Toolset - cross-platform installer of necessary tools for programming.
GNU General Public License v3.0
3 stars 2 forks source link

Import fmt in cmake #37

Closed Blackflame576 closed 1 year ago

Blackflame576 commented 1 year ago
# CMAKE_CXX_STANDARD requires 3.12 and the convenience function
# `FetchContent_MakeAvailable` was introduced in CMake 3.14
cmake_minimum_required(VERSION 3.14) 
project(ReadGraph)

include(FetchContent)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

FetchContent_Declare(googletest
  GIT_REPOSITORY https://github.com/google/googletest.git
  GIT_TAG main
)
FetchContent_MakeAvailable(googletest)

FetchContent_Declare(fmt
  GIT_REPOSITORY https://github.com/fmtlib/fmt.git
  GIT_TAG master
)
FetchContent_MakeAvailable(fmt)

find_package(Threads REQUIRED) # for pthread

include_directories(include)

enable_testing()
file(GLOB TESTS "test/*.cpp" "test/*/*.cpp" "src/*.cpp" "src/*/*.cpp")
add_executable(Tests ${TESTS})
target_link_libraries(Tests 
  PRIVATE 
    gtest_main 
    fmt::fmt 
    Threads::Threads
)