summaryrefslogtreecommitdiffstats
path: root/thirdparty/apps/CMakeLists.txt
diff options
context:
space:
mode:
authoryalei wang <wylandrea@gmail.com>2018-03-13 01:12:00 +0000
committerGerrit Code Review <gerrit@fd.io>2018-03-13 01:12:00 +0000
commit1b031216ba4cd37943900b8759f50fd0e3a8f1cf (patch)
treeb6816d9228ddb456b6f26889d8831c2e879e47ce /thirdparty/apps/CMakeLists.txt
parenta8261960bcb4d08b254b2cfce746cca166329b6a (diff)
parent71e33ec17c12e6ca43f149215ca05fc9d8b1d5a9 (diff)
Merge "Add some third-party src code for DMM"
Diffstat (limited to 'thirdparty/apps/CMakeLists.txt')
-rw-r--r--thirdparty/apps/CMakeLists.txt27
1 files changed, 27 insertions, 0 deletions
diff --git a/thirdparty/apps/CMakeLists.txt b/thirdparty/apps/CMakeLists.txt
new file mode 100644
index 0000000..379f3e4
--- /dev/null
+++ b/thirdparty/apps/CMakeLists.txt
@@ -0,0 +1,27 @@
+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-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
+ CONFIGURE_COMMAND sh configure.sh
+ BUILD_COMMAND make
+ INSTALL_COMMAND make install
+ DEPENDS nStackAPI
+)
+