forked from wilfrantz/ipConverter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeListsx.txt
39 lines (31 loc) · 897 Bytes
/
CMakeListsx.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
CMAKE_MINIMUM_REQUIRED(VERSION 3.26)
PROJECT(ipconverter VERSION 0.0.1 LANGUAGES CXX)
SET(CMAKE_CXX_STANDARD 17)
# Find packages
find_package(PkgConfig REQUIRED)
pkg_check_modules(JSONCPP jsoncpp)
link_libraries(${JSONCPP_LIBRARIES})
# FIND_PACKAGE(JSONCPP REQUIRED)
FIND_PACKAGE(CURL REQUIRED)
OPTION(CMAKE_VERBOSE_MAKEFILE "Verbose Makefile" ON)
OPTION(BUILD_TESTS "Build tests" ON)
ADD_COMPILE_DEFINITIONS(ENGINE_VERSION="${PROJECT_VERSION}")
ADD_EXECUTABLE("${PROJECT_NAME}"
src/ipconverter.cpp
src/main.cpp
)
TARGET_LINK_LIBRARIES("${PROJECT_NAME}"
PRIVATE
${CURL_LIBRARIES}
${JSONCPP_LIBRARIES}
)
TARGET_INCLUDE_DIRECTORIES("${PROJECT_NAME}"
PRIVATE
${JSONCPP_INCLUDE_DIRS}
)
IF (BUILD_TESTS)
MESSAGE(STATUS "Building tests ...")
ENABLE_TESTING()
ADD_SUBDIRECTORY(test)
ADD_TEST(NAME ${PROJECT_NAME}_tests COMMAND test/${PROJECT_NAME}_test)
ENDIF (BUILD_TESTS)