aboutsummaryrefslogtreecommitdiffstats
path: root/thirdparty/apps/CMakeLists.txt
blob: 0fffccd45e97d43e350576a6772c30afc82b8bc9 (plain)
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
78
79
#########################################################################
#
# Copyright (c) 2018 Huawei Technologies Co.,Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#########################################################################

LINK_DIRECTORIES(${LIB_PATH_SHARED})
SET(NGINX_URL http://nginx.org/download/nginx-1.12.2.tar.gz)
SET(NGINX_DOWNLOAD_DIR ${CMAKE_CURRENT_LIST_DIR}/nginx/)
SET(NGINX_SRC ${CMAKE_CURRENT_LIST_DIR}/nginx/nginx-1.12.2)
SET(NGINX_RELEASE ${CMAKE_CURRENT_LIST_DIR}/nginx/release)

if(EXISTS "${NGINX_DOWNLOAD_DIR}/nginx-1.12.2.tar.gz")
    SET(NGINX_DOWNLOAD_CMD tar -xvf ${NGINX_DOWNLOAD_DIR}/nginx-1.12.2.tar.gz  -C ${NGINX_DOWNLOAD_DIR}/nginx-1.12.2 --strip-components 1)
else()
    SET(NGINX_DOWNLOAD_CMD wget --no-check-certificate -O nginx-1.12.2.tar.gz ${NGINX_URL} && tar -xvf ${NGINX_DOWNLOAD_DIR}/nginx-1.12.2.tar.gz  -C ${NGINX_DOWNLOAD_DIR}/nginx-1.12.2 --strip-components 1)
endif()

INCLUDE(ExternalProject)
ExternalProject_Add(
        NGINX
        URL ${NGINX_URL}
        DOWNLOAD_DIR ${NGINX_DOWNLOAD_DIR}
        DOWNLOAD_COMMAND ${NGINX_DOWNLOAD_CMD}
        BUILD_IN_SOURCE 1
        SOURCE_DIR ${NGINX_SRC}
        PATCH_COMMAND echo "./configure --with-stream --with-ld-opt=\"-L${LIB_PATH_SHARED}/ -lnStackAPI -Wl,-rpath=${LIB_PATH_SHARED}\" --sbin-path=${NGINX_RELEASE}/nginx --conf-path=${NGINX_RELEASE}/nginx.conf --pid-path=${NGINX_RELEASE}/nginx.pid " > configure.sh
        COMMAND sed -i -e "47 s/$/\"/" ${CMAKE_CURRENT_LIST_DIR}/nginx/nginx-1.12.2/auto/os/linux
        COMMAND sed -i -e "48,49 s/^/#/" ${CMAKE_CURRENT_LIST_DIR}/nginx/nginx-1.12.2/auto/os/linux
        CONFIGURE_COMMAND sh configure.sh
        BUILD_COMMAND make
        INSTALL_COMMAND make install
        DEPENDS nStackAPI
)

set_target_properties(NGINX PROPERTIES EXCLUDE_FROM_ALL TRUE)


SET(IPERF_URL https://iperf.fr/download/source/iperf-3.1.3-source.tar.gz)

INCLUDE(ExternalProject)
ExternalProject_Add(
        IPERF
        URL ${IPERF_URL}
        DOWNLOAD_DIR ${CMAKE_CURRENT_LIST_DIR}
        SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/iperf-3.1.3
        BUILD_IN_SOURCE 1
        CONFIGURE_COMMAND sh -c "LDFLAGS=\"-L${LIB_PATH_SHARED} -Wl,-rpath=${LIB_PATH_SHARED} -lnStackAPI\" ./configure"
        BUILD_COMMAND make
        DEPENDS nStackAPI
)

set_target_properties(IPERF PROPERTIES EXCLUDE_FROM_ALL TRUE)

SET(NETPERF_URL https://github.com/HewlettPackard/netperf/archive/netperf-2.7.0.tar.gz)

INCLUDE(ExternalProject)
ExternalProject_Add(
        NETPERF
        URL ${NETPERF_URL}
        DOWNLOAD_DIR ${CMAKE_CURRENT_LIST_DIR}
        SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/netperf-2.7.0
        BUILD_IN_SOURCE 1
        CONFIGURE_COMMAND sh -c "LDFLAGS=\"-L${LIB_PATH_SHARED} -Wl,-rpath=${LIB_PATH_SHARED} -lnStackAPI\" ./configure"
        BUILD_COMMAND make
        DEPENDS nStackAPI
)

set_target_properties(NETPERF PROPERTIES EXCLUDE_FROM_ALL TRUE)