forked from approvals/ApprovalTests.cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
28 lines (22 loc) · 939 Bytes
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
if (NOT TARGET fmt)
cmake_minimum_required(VERSION 3.8)
# Download and unpack fmt at configure time
configure_file(CMakeLists.txt.in fmt-download/CMakeLists.txt)
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
RESULT_VARIABLE result
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/fmt-download)
if (result)
message(FATAL_ERROR "CMake step for fmt failed: ${result}")
endif ()
execute_process(COMMAND ${CMAKE_COMMAND} --build .
RESULT_VARIABLE result
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/fmt-download)
if (result)
message(FATAL_ERROR "Build step for fmt failed: ${result}")
endif ()
# Add fmt directly to our build. This defines the fmt target.
add_subdirectory(${CMAKE_CURRENT_BINARY_DIR}/fmt-src
${CMAKE_CURRENT_BINARY_DIR}/fmt-build
EXCLUDE_FROM_ALL
)
endif ()