-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
47 lines (37 loc) · 1.16 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
cmake_minimum_required(VERSION 3.0)
project(inslib)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
include(GNUInstallDirs)
message(STATUS "Looking for CURL")
include(FindCURL)
find_package(CURL REQUIRED)
if(CURL_FOUND)
message(STATUS "Found CURL version: ${CURL_VERSION_STRING}")
message(STATUS "Using CURL include dir(s): ${CURL_INCLUDE_DIRS}")
message(STATUS "Using CURL lib(s): ${CURL_LIBRARIES}")
else()
message(FATAL_ERROR "Could not find CURL")
endif()
message(STATUS "Looking for CURLPP")
find_library(CURLPP curlpp)
if(NOT CURLPP)
message(FATAL_ERROR "Could not find CURLPP")
else()
message(STATUS "CURLPP founded")
endif()
add_library(${PROJECT_NAME} SHARED ./inslib.h ./inslib.cpp)
if(${CMAKE_SYSTEM_NAME} STREQUAL Windows)
set(LIB_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/lib/)
elseif(${CMAKE_SYSTEM_NAME} STREQUAL Linux)
set(LIB_INSTALL_PATH /usr/lib/)
endif()
#enable_testing()
#
#if(BUILD_TESTING)
# add_subdirectory(tests)
#endif()
install(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_PATH})
find_path(LIB_INCLUDE_PATH string.h)
install(FILES inslib.h DESTINATION ${LIB_INCLUDE_PATH})