-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
66 lines (52 loc) · 1.52 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#
# Copyright 2019-2020 Konstantinos Fragkiadakis
# All rights reserved.
#
cmake_minimum_required (VERSION 3.10)
include(GNUInstallDirs)
project (diffmerge)
option(ENABLE_TEST "Build tests" OFF)
option(ENABLE_DOC "Create and install the HTML based documentation (requires Doxygen)" OFF)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
########################################################################
## Targets
########################################################################
add_library(lcs SHARED
include/lcs.h
)
target_include_directories(lcs
PUBLIC
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
install(TARGETS lcs
LIBRARY
DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
set_target_properties(lcs
PROPERTIES LINKER_LANGUAGE CXX #required because diff.h file is not recognized as CXX by cmake
CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON
)
add_executable(diff
src/diffmain.cc
)
target_link_libraries(diff lcs stdc++fs)
install(TARGETS diff
RUNTIME
DESTINATION ${CMAKE_INSTALL_BINDIR}
)
set_target_properties(diff PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON
)
########################################################################
## Sub-directory Targets
########################################################################
if (ENABLE_TEST)
add_subdirectory(unittests)
endif(ENABLE_TEST)