File tree Expand file tree Collapse file tree 10 files changed +26
-22
lines changed Expand file tree Collapse file tree 10 files changed +26
-22
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,16 @@ option(WITH_DOC "Compile PaddlePaddle with documentation" OFF)
43
43
option (ON_COVERALLS "Compile PaddlePaddle with code coverage" OFF )
44
44
option (COVERALLS_UPLOAD "Package code coverage data to coveralls" OFF )
45
45
option (ON_TRAVIS "Exclude special unit test on Travis CI" OFF )
46
+
47
+ # CMAKE_BUILD_TYPE
48
+ if (NOT CMAKE_BUILD_TYPE )
49
+ set (CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING
50
+ "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel"
51
+ FORCE )
52
+ endif ()
53
+
54
+ set (THIRD_PARTY_PATH "${PROJ_ROOT} /third_party" CACHE STRING
55
+ "A path setting third party libraries download & build directories." )
46
56
########################################################################################
47
57
48
58
include (external/zlib ) # download, build, install zlib
Original file line number Diff line number Diff line change 14
14
15
15
INCLUDE (ExternalProject )
16
16
17
- SET (GLOG_SOURCES_DIR ${CMAKE_CURRENT_SOURCE_DIR} /third_party /glog )
18
- SET (GLOG_INSTALL_DIR ${CMAKE_CURRENT_SOURCE_DIR} /third_party /install/glog )
17
+ SET (GLOG_SOURCES_DIR ${THIRD_PARTY_PATH} /glog )
18
+ SET (GLOG_INSTALL_DIR ${THIRD_PARTY_PATH} /install/glog )
19
19
SET (GLOG_INCLUDE_DIR "${GLOG_INSTALL_DIR} /include" CACHE PATH "glog include directory." FORCE )
20
20
21
21
IF (WIN32 )
Original file line number Diff line number Diff line change @@ -16,8 +16,8 @@ IF(WITH_TESTING)
16
16
ENABLE_TESTING ()
17
17
INCLUDE (ExternalProject )
18
18
19
- SET (GTEST_SOURCES_DIR ${CMAKE_CURRENT_SOURCE_DIR} /third_party /gtest )
20
- SET (GTEST_INSTALL_DIR ${CMAKE_CURRENT_SOURCE_DIR} /third_party /install/gtest )
19
+ SET (GTEST_SOURCES_DIR ${THIRD_PARTY_PATH} /gtest )
20
+ SET (GTEST_INSTALL_DIR ${THIRD_PARTY_PATH} /install/gtest )
21
21
SET (GTEST_INCLUDE_DIR "${GTEST_INSTALL_DIR} /include" CACHE PATH "gtest include directory." FORCE )
22
22
23
23
INCLUDE_DIRECTORIES (${GTEST_INCLUDE_DIR} )
Original file line number Diff line number Diff line change @@ -18,8 +18,8 @@ IF(NOT ${CBLAS_FOUND})
18
18
MESSAGE (FATAL_ERROR "Please install OpenBlas, MKL or ATLAS." )
19
19
INCLUDE (ExternalProject )
20
20
21
- SET (CBLAS_SOURCES_DIR ${CMAKE_CURRENT_SOURCE_DIR} /third_party /openblas )
22
- SET (CBLAS_INSTALL_DIR ${CMAKE_CURRENT_SOURCE_DIR} /third_party /install/openblas )
21
+ SET (CBLAS_SOURCES_DIR ${THIRD_PARTY_PATH} /openblas )
22
+ SET (CBLAS_INSTALL_DIR ${THIRD_PARTY_PATH} /install/openblas )
23
23
SET (CBLAS_INC_DIR "${CBLAS_INSTALL_DIR} /include" CACHE PATH "openblas include directory." FORCE )
24
24
25
25
IF (WIN32 )
Original file line number Diff line number Diff line change 14
14
15
15
INCLUDE (ExternalProject )
16
16
17
- SET (PROTOBUF_SOURCES_DIR ${CMAKE_CURRENT_SOURCE_DIR} /third_party /protobuf )
18
- SET (PROTOBUF_INSTALL_DIR ${CMAKE_CURRENT_SOURCE_DIR} /third_party /install/protobuf )
17
+ SET (PROTOBUF_SOURCES_DIR ${THIRD_PARTY_PATH} /protobuf )
18
+ SET (PROTOBUF_INSTALL_DIR ${THIRD_PARTY_PATH} /install/protobuf )
19
19
SET (PROTOBUF_INCLUDE_DIR "${PROTOBUF_INSTALL_DIR} /include" CACHE PATH "protobuf include directory." FORCE )
20
20
21
21
INCLUDE_DIRECTORIES (${PROTOBUF_INCLUDE_DIR} )
Original file line number Diff line number Diff line change @@ -28,8 +28,8 @@ IF(PYTHONLIBS_FOUND AND PYTHONINTERP_FOUND)
28
28
FIND_PACKAGE (NumPy REQUIRED )
29
29
ELSE (PYTHONLIBS_FOUND AND PYTHONINTERP_FOUND )
30
30
##################################### PYTHON ########################################
31
- SET (PYTHON_SOURCES_DIR ${CMAKE_CURRENT_SOURCE_DIR} /third_party /python )
32
- SET (PYTHON_INSTALL_DIR ${CMAKE_CURRENT_SOURCE_DIR} /third_party /install/python )
31
+ SET (PYTHON_SOURCES_DIR ${THIRD_PARTY_PATH} /python )
32
+ SET (PYTHON_INSTALL_DIR ${THIRD_PARTY_PATH} /install/python )
33
33
SET (_python_DIR ${PYTHON_INSTALL_DIR} )
34
34
35
35
IF (UNIX )
Original file line number Diff line number Diff line change @@ -18,8 +18,8 @@ IF(NOT SWIG_FOUND)
18
18
# build swig as an external project
19
19
INCLUDE (ExternalProject )
20
20
21
- SET (SWIG_SOURCES_DIR ${CMAKE_CURRENT_SOURCE_DIR} /third_party /swig )
22
- SET (SWIG_INSTALL_DIR ${CMAKE_CURRENT_SOURCE_DIR} /third_party /install/swig )
21
+ SET (SWIG_SOURCES_DIR ${THIRD_PARTY_PATH} /swig )
22
+ SET (SWIG_INSTALL_DIR ${THIRD_PARTY_PATH} /install/swig )
23
23
SET (SWIG_TARGET_VERSION "3.0.2" )
24
24
SET (SWIG_DOWNLOAD_SRC_MD5 "62f9b0d010cef36a13a010dc530d0d41" )
25
25
SET (SWIG_DOWNLOAD_WIN_MD5 "3f18de4fc09ab9abb0d3be37c11fbc8f" )
Original file line number Diff line number Diff line change 14
14
15
15
INCLUDE (ExternalProject )
16
16
17
- SET (WARPCTC_SOURCES_DIR ${CMAKE_CURRENT_SOURCE_DIR} /third_party /warpctc )
18
- SET (WARPCTC_INSTALL_DIR ${CMAKE_CURRENT_SOURCE_DIR} /third_party /install/warpctc )
17
+ SET (WARPCTC_SOURCES_DIR ${THIRD_PARTY_PATH} /warpctc )
18
+ SET (WARPCTC_INSTALL_DIR ${THIRD_PARTY_PATH} /install/warpctc )
19
19
SET (WARPCTC_INCLUDE_DIR "${WARPCTC_INSTALL_DIR} /include" CACHE PATH "Warp-ctc Directory" FORCE )
20
20
21
21
INCLUDE_DIRECTORIES (${WARPCTC_INCLUDE_DIR} )
Original file line number Diff line number Diff line change 14
14
15
15
INCLUDE (ExternalProject )
16
16
17
- SET (ZLIB_SOURCES_DIR ${CMAKE_CURRENT_SOURCE_DIR} /third_party /zlib )
18
- SET (ZLIB_INSTALL_DIR ${CMAKE_CURRENT_SOURCE_DIR} /third_party /install/zlib )
17
+ SET (ZLIB_SOURCES_DIR ${THIRD_PARTY_PATH} /zlib )
18
+ SET (ZLIB_INSTALL_DIR ${THIRD_PARTY_PATH} /install/zlib )
19
19
SET (ZLIB_ROOT ${ZLIB_INSTALL_DIR} CACHE FILEPATH "zlib root directory." FORCE )
20
20
SET (ZLIB_INCLUDE_DIR "${ZLIB_INSTALL_DIR} /include" CACHE PATH "zlib include directory." FORCE )
21
21
Original file line number Diff line number Diff line change @@ -3,12 +3,6 @@ include(CheckCXXCompilerFlag)
3
3
include (CheckCCompilerFlag )
4
4
include (CheckCXXSymbolExists )
5
5
6
- if (NOT CMAKE_BUILD_TYPE )
7
- set (CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING
8
- "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel"
9
- FORCE )
10
- endif ()
11
-
12
6
function (CheckCompilerCXX11Flag )
13
7
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
14
8
if (${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 4.8 )
You can’t perform that action at this time.
0 commit comments