-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathcmake.in
59 lines (49 loc) · 1.43 KB
/
cmake.in
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
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
project($$project$$)
find_package(OpenSSL REQUIRED)
if(NOT OPENSSL_FOUND)
message(FATAL_ERROR "You need OpenSSL to build this.")
endif()
find_package(ZLIB REQUIRED)
if(NOT ZLIB_FOUND)
message(FATAL_ERROR "You need ZLIB to build this.")
endif()
include_directories(${OPENSSL_INCLUDE_DIR})
include_directories(${ZLIB_INCLUDE_DIRS})
if(WIN32)
add_definitions(-DWIN32)
add_definitions(-D_WIN32)
add_definitions(-D_USRDLL)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
add_definitions(-D_WINSOCK_DEPRECATED_NO_WARNINGS)
endif()
if (MSVC)
add_definitions(/wd4102)
endif()
add_definitions(-DNDEBUG)
add_definitions(-DPy_BUILD_CORE)
include_directories(gen)
include_directories($$python_root$$/Include)
include_directories($$pypperoni_root$$/src)
if (UNIX)
if (APPLE)
link_directories($$python_root$$/build/osx)
else()
link_directories($$python_root$$/build/linux2)
endif()
else()
link_directories($$python_root$$/build/win64)
endif()
set(_FILES
$$pypperoni_root$$/src/pypperoni_impl.c
$$pypperoni_root$$/src/main.c
$$files$$)
add_executable($$project$$ ${_FILES})
target_link_libraries($$project$$ python3.6 ${ZLIB_LIBRARIES} ${OPENSSL_LIBRARIES})
if (WIN32)
target_link_libraries($$project$$ ws2_32 crypt32)
else()
target_link_libraries($$project$$ pthread m util)
endif()