Skip to content

Commit

Permalink
Merge pull request #200 from BioDataAnalysis/bda_require_newer_cmake
Browse files Browse the repository at this point in the history
Require cmake minimum version 3.4 on all platforms
  • Loading branch information
zeyiwen committed Feb 6, 2020
2 parents 7e39299 + 4e8c910 commit d92c232
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,25 +1,19 @@
if(MSVC)
cmake_minimum_required(VERSION 3.4)
else()
cmake_minimum_required(VERSION 2.8.12)
endif()
cmake_minimum_required(VERSION 3.4)

cmake_policy(SET CMP0048 NEW)
cmake_policy(SET CMP0042 NEW)
project(thundersvm VERSION 0.1.0 LANGUAGES C CXX)

if (CMAKE_VERSION VERSION_LESS "3.0")
project(thundersvm C CXX)
set(PROJECT_VERSION 0.1.0)
else ()
cmake_policy(SET CMP0048 NEW)
cmake_policy(SET CMP0042 NEW)
project(thundersvm VERSION 0.1.0 LANGUAGES C CXX)
endif ()
if(MSVC)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
endif()

set(USE_CUDA ON CACHE BOOL "Compile with CUDA")
set(USE_EIGEN OFF CACHE BOOL "Compile with Eigen")
set(BUILD_TESTS OFF CACHE BOOL "Build Tests")
set(USE_DOUBLE OFF CACHE BOOL "Use double as kernel_type")

if(USE_DOUBLE)
message("Use double as kernel_type")
endif()
Expand All @@ -28,7 +22,7 @@ if (NOT CMAKE_BUILD_TYPE)
endif ()
find_package(Threads REQUIRED QUIET)
find_package(OpenMP REQUIRED QUIET)
add_definitions("-DELPP_NO_LOG_TO_FILE")
add_definitions("-DELPP_NO_LOG_TO_FILE")
if (OPENMP_FOUND)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
Expand Down

0 comments on commit d92c232

Please sign in to comment.