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)
4343option (ON_COVERALLS "Compile PaddlePaddle with code coverage" OFF )
4444option (COVERALLS_UPLOAD "Package code coverage data to coveralls" OFF )
4545option (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." )
4656########################################################################################
4757
4858include (external/zlib) # download, build, install zlib
Original file line number Diff line number Diff line change 1414
1515INCLUDE (ExternalProject)
1616
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)
1919SET (GLOG_INCLUDE_DIR "${GLOG_INSTALL_DIR} /include" CACHE PATH "glog include directory." FORCE)
2020
2121IF (WIN32 )
Original file line number Diff line number Diff line change @@ -16,8 +16,8 @@ IF(WITH_TESTING)
1616 ENABLE_TESTING ()
1717 INCLUDE (ExternalProject)
1818
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)
2121 SET (GTEST_INCLUDE_DIR "${GTEST_INSTALL_DIR} /include" CACHE PATH "gtest include directory." FORCE)
2222
2323 INCLUDE_DIRECTORIES (${GTEST_INCLUDE_DIR} )
Original file line number Diff line number Diff line change @@ -18,8 +18,8 @@ IF(NOT ${CBLAS_FOUND})
1818 MESSAGE (FATAL_ERROR "Please install OpenBlas, MKL or ATLAS." )
1919 INCLUDE (ExternalProject)
2020
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)
2323 SET (CBLAS_INC_DIR "${CBLAS_INSTALL_DIR} /include" CACHE PATH "openblas include directory." FORCE)
2424
2525 IF (WIN32 )
Original file line number Diff line number Diff line change 1414
1515INCLUDE (ExternalProject)
1616
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)
1919SET (PROTOBUF_INCLUDE_DIR "${PROTOBUF_INSTALL_DIR} /include" CACHE PATH "protobuf include directory." FORCE)
2020
2121INCLUDE_DIRECTORIES (${PROTOBUF_INCLUDE_DIR} )
Original file line number Diff line number Diff line change @@ -28,8 +28,8 @@ IF(PYTHONLIBS_FOUND AND PYTHONINTERP_FOUND)
2828 FIND_PACKAGE (NumPy REQUIRED)
2929ELSE (PYTHONLIBS_FOUND AND PYTHONINTERP_FOUND)
3030 ##################################### 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)
3333 SET (_python_DIR ${PYTHON_INSTALL_DIR} )
3434
3535 IF (UNIX )
Original file line number Diff line number Diff line change @@ -18,8 +18,8 @@ IF(NOT SWIG_FOUND)
1818 # build swig as an external project
1919 INCLUDE (ExternalProject)
2020
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)
2323 SET (SWIG_TARGET_VERSION "3.0.2" )
2424 SET (SWIG_DOWNLOAD_SRC_MD5 "62f9b0d010cef36a13a010dc530d0d41" )
2525 SET (SWIG_DOWNLOAD_WIN_MD5 "3f18de4fc09ab9abb0d3be37c11fbc8f" )
Original file line number Diff line number Diff line change 1414
1515INCLUDE (ExternalProject)
1616
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)
1919SET (WARPCTC_INCLUDE_DIR "${WARPCTC_INSTALL_DIR} /include" CACHE PATH "Warp-ctc Directory" FORCE)
2020
2121INCLUDE_DIRECTORIES (${WARPCTC_INCLUDE_DIR} )
Original file line number Diff line number Diff line change 1414
1515INCLUDE (ExternalProject)
1616
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)
1919SET (ZLIB_ROOT ${ZLIB_INSTALL_DIR} CACHE FILEPATH "zlib root directory." FORCE)
2020SET (ZLIB_INCLUDE_DIR "${ZLIB_INSTALL_DIR} /include" CACHE PATH "zlib include directory." FORCE)
2121
Original file line number Diff line number Diff line change @@ -3,12 +3,6 @@ include(CheckCXXCompilerFlag)
33include (CheckCCompilerFlag)
44include (CheckCXXSymbolExists)
55
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-
126function (CheckCompilerCXX11Flag)
137 if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
148 if (${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 4.8)
You can’t perform that action at this time.
0 commit comments