diff --git a/CMakeLists.txt b/CMakeLists.txt index d6893c61656b..19e1c49216e6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,11 +16,11 @@ set(CMAKE_CXX_EXTENSIONS ON) # GNU extensions used by src/operator/random/shuff # some compilers claim they support c++17 without actually implementing crucial # parts of the standard leading to hard to understand compilation errors. if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0) + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0) message(FATAL_ERROR "MXNet 2 requires a C++17 compatible compiler. Please update to GCC version 7 or newer.") endif() elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0) + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0) message(FATAL_ERROR "MXNet 2 requires a C++17 compatible compiler. Please update to Clang version 6 or newer.") endif() endif() @@ -116,7 +116,7 @@ if(USE_CUDA) cmake_minimum_required(VERSION 3.13.2) # CUDA 10 (Turing) detection available starting 3.13.2 include(CheckLanguage) check_language(CUDA) - if (NOT CMAKE_CUDA_COMPILER AND UNIX AND EXISTS "/usr/local/cuda/bin/nvcc") + if(NOT CMAKE_CUDA_COMPILER AND UNIX AND EXISTS "/usr/local/cuda/bin/nvcc") set(ENV{CUDACXX} "/usr/local/cuda/bin/nvcc") message(WARNING "CMAKE_CUDA_COMPILER guessed: " $ENV{CUDACXX} "\n" "Please fix your cuda installation: https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#mandatory-post") @@ -562,7 +562,7 @@ if(USE_OPERATOR_TUNING AND USE_OPENMP) add_definitions(-DMXNET_USE_OPERATOR_TUNING=1) endif() -if (NOT (EXTRA_OPERATORS STREQUAL "")) +if(NOT (EXTRA_OPERATORS STREQUAL "")) mxnet_source_group("Extra" GLOB_RECURSE "${EXTRA_OPERATORS}/*.cc") mxnet_source_group("Extra\\Cuda" GLOB_RECURSE "${EXTRA_OPERATORS}/*.cu") FILE(GLOB_RECURSE EXTRA_SRC "${EXTRA_OPERATORS}/*.cc") @@ -818,7 +818,7 @@ if(USE_CUDA) target_include_directories(customop_gpu_lib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include/mxnet ${CMAKE_CURRENT_SOURCE_DIR}/example/extensions/lib_custom_op) endif() if(UNIX) - if (USE_CUDA) + if(USE_CUDA) target_compile_options(customop_gpu_lib PUBLIC -shared) endif() elseif(MSVC) @@ -948,11 +948,11 @@ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/dmlc-core/include/ DESTIN install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/mshadow/mshadow/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mshadow) install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/mxnet/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mxnet) install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/tvm/nnvm/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) -if (INSTALL_EXAMPLES) +if(INSTALL_EXAMPLES) install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/example DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}) endif() -if (USE_SIGNAL_HANDLER) +if(USE_SIGNAL_HANDLER) add_definitions(-DMXNET_USE_SIGNAL_HANDLER=1) endif() diff --git a/cmake/Utils.cmake b/cmake/Utils.cmake index 294e7cf4cc5c..ce062e2b745f 100644 --- a/cmake/Utils.cmake +++ b/cmake/Utils.cmake @@ -370,7 +370,7 @@ endfunction() function(assign_source_group group) foreach(_source IN ITEMS ${ARGN}) - if (IS_ABSOLUTE "${_source}") + if(IS_ABSOLUTE "${_source}") file(RELATIVE_PATH _source_rel "${CMAKE_CURRENT_SOURCE_DIR}" "${_source}") else() set(_source_rel "${_source}") diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 3209aa0cae1a..4844036341a5 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -25,7 +25,7 @@ if(GTEST_FOUND AND NOT MSVC) include_directories(${GTEST_INCLUDE_DIR}) include_directories(cpp/include) - if (NOT PRIVATE_RUNTIME_DIR) + if(NOT PRIVATE_RUNTIME_DIR) set(PRIVATE_RUNTIME_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) endif()