-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
37 lines (28 loc) · 877 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
29
30
31
32
33
34
35
36
37
cmake_minimum_required(VERSION 3.22)
project(quickdiff)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)
## Fetch dependencies
include(FetchContent)
FetchContent_Declare(
difflib
GIT_REPOSITORY https://github.com/duckie/difflib.git
)
FetchContent_GetProperties(difflib)
if(NOT difflib_POPULATED)
FetchContent_Populate(difflib)
endif()
add_library(difflib INTERFACE)
target_include_directories(difflib INTERFACE ${difflib_SOURCE_DIR}/src)
FetchContent_Declare(
utfcpp
GIT_REPOSITORY https://github.com/nemtrif/utfcpp
)
FetchContent_MakeAvailable(utfcpp)
##
add_executable(quickdiff src/quickdiff.cpp)
include(FindOpenMP)
if(OpenMP_CXX_FOUND) # TODO: handle the case in which CMake couldn't find OpenMP
target_link_libraries(quickdiff PRIVATE OpenMP::OpenMP_CXX)
endif()
target_link_libraries(quickdiff PRIVATE difflib utf8::cpp)