cmake_minimum_required(VERSION 2.8) set(PROJ mkHartmann) set(PROJ_VER "0.0.1") project(${PROJ}) set(CMAKE_COLOR_MAKEFILE ON) #set(DEBUG 1) # Comment out this line in release mode if(NOT DEFINED NO_CUDA) message("Try to use CUDA") find_package(CUDA) if(CUDA_FOUND) add_definitions(-DCUDA_FOUND) endif() endif() if(NOT DEFINED PROCESSOR_COUNT) set(PROCESSOR_COUNT 2) # by default 2 cores set(cpuinfo_file "/proc/cpuinfo") if(EXISTS "${cpuinfo_file}") file(STRINGS "${cpuinfo_file}" procs REGEX "^processor.: [0-9]+$") list(LENGTH procs PROCESSOR_COUNT) endif() endif() add_definitions(-DTHREAD_NUMBER=${PROCESSOR_COUNT}) message("In multithreaded operations will use ${PROCESSOR_COUNT} threads") # fix invalid install paths if(DEFINED CMAKE_INSTALL_PREFIX AND CMAKE_INSTALL_PREFIX MATCHES "/usr/local") set(CMAKE_INSTALL_PREFIX "/usr") endif() # change path by user's wish if(NOT DEFINED LOCALEDIR) set(LOCALEDIR "${CMAKE_INSTALL_PREFIX}/share/locale") endif() set(CMAKE_INSTALL_LOCALEDIR "${LOCALEDIR}/ru/LC_MESSAGES") subdirs(src)