-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
77 lines (61 loc) · 3.25 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
67
68
69
70
71
72
73
74
75
76
77
#
# madana-api
# <h1>Using the madana-api</h1> <p>This documentation contains a Quickstart Guide, relating client functionality and information about the available endpoints and used datamodels. </p> <p> The madana-api and its implementations are still in heavy development. This means that there may be problems in our protocols, or there may be mistakes in our implementations. We take security vulnerabilities very seriously. If you discover a security issue, please bring it to our attention right away! If you find a vulnerability that may affect live deployments -- for example, by exposing a remote execution exploit -- please send your report privately to [email protected]. Please DO NOT file a public issue. If the issue is a protocol weakness that cannot be immediately exploited or something not yet deployed, just discuss it openly </p> <br> <p> Note: Not all functionality might be acessible without having accquired and api-license token. For more information visit <a href=\"https://www.madana.io\">www.madana.io</a> </p> <br>
#
# The version of the OpenAPI document: 1.0.0
#
# https://openapi-generator.tech
#
# NOTE: Auto generated by OpenAPI Generator (https://openapi-generator.tech).
cmake_minimum_required (VERSION 2.8)
#PROJECT's NAME
project(CppRestOpenAPIClient)
set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# THE LOCATION OF OUTPUT BINARIES
set(CMAKE_LIBRARY_DIR ${PROJECT_SOURCE_DIR}/lib)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
# BUILD TYPE
message("A ${CMAKE_BUILD_TYPE} build configuration is detected")
if (UNIX)
message(STATUS "Building client library for Linux/Unix")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -Wall -Wno-unused-variable")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall -Wno-unused-variable")
set(cpprestsdk_DIR /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}/cmake/)
find_package(cpprestsdk REQUIRED)
find_package(Boost REQUIRED)
else()
message(STATUS "Building client library for Windows")
find_package(cpprestsdk REQUIRED)
find_package(Boost REQUIRED)
find_package(pthreads REQUIRED)
endif()
# Manually set the cpprestsdk paths when not using package manager
#set(CPPREST_INCLUDE_DIR ${CPPREST_ROOT}/include)
#set(CPPREST_LIBRARY_DIR ${CPPREST_ROOT}/lib)
#include_directories(${CPPREST_INCLUDE_DIR})
#link_directories(${CPPREST_LIBRARY_DIR})
#SUPPORTING FILES
set(SUPPORTING_FILES "ApiClient" "ApiConfiguration" "ApiException" "HttpContent" "IHttpBody" "JsonBody" "ModelBase" "MultipartFormData" "Object")
#SOURCE FILES
file(GLOB SOURCE_FILES "api/*" "model/*")
add_library(${PROJECT_NAME} ${SUPPORTING_FILES} ${SOURCE_FILES})
target_include_directories(
${PROJECT_NAME} PRIVATE
${Boost_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR}/model
${CMAKE_CURRENT_SOURCE_DIR}/api
)
target_link_directories(
${PROJECT_NAME} PRIVATE
${Boost_LIBRARY_DIRS}
)
if (UNIX)
target_link_libraries(${PROJECT_NAME} PRIVATE cpprest pthread ${Boost_LIBRARIES} crypto)
else()
target_link_libraries(${PROJECT_NAME} PRIVATE cpprestsdk::cpprest ${pthreads_LIBRARIES} ${Boost_LIBRARIES} bcrypt)
endif()
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14)
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)