Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
85 lines (69 sloc) 2.71 KB
cmake_minimum_required(VERSION 2.8.0)
project(benchy)
option(BENCHY_BUILD_MODULES_CPU "Build benchy CPU modules" ON)
option(BENCHY_BUILD_MODULES_MEM "Build benchy MEM modules" ON)
#option(BENCHY_BUILD_MODULES_HDD "Build benchy HDD modules" ON)
#option(BENCHY_BUILD_MODULES_2D "Build benchy 2D modules" ON)
#option(BENCHY_BUILD_MODULES_3D "Build benchy 3D modules" ON)
option(BENCHY_BUILD_APP_CLI "Build benchy CLI frontend" ON)
#option(BENCHY_BUILD_APP_QT "Build benchy Qt frontend" ON)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake-extras/;${CMAKE_MODULE_PATH}")
find_package(Threads REQUIRED)
find_package(OpenMP REQUIRED)
#set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
find_package(Boost COMPONENTS date_time program_options system)
if(Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
else(Boost_FOUND)
message(FATAL_ERROR "Unable to find Boost")
endif(Boost_FOUND)
add_definitions(-Wall -O0 ${OpenMP_CXX_FLAGS})
if(BENCHY_BUILD_MODULES_CPU)
add_definitions(-DBUILD_CPU_TESTS)
include_directories(modules/CPU_count/include)
add_subdirectory(modules/CPU_count)
include_directories(modules/CPU_smallpt/include)
add_subdirectory(modules/CPU_smallpt)
endif(BENCHY_BUILD_MODULES_CPU)
if(BENCHY_BUILD_MODULES_MEM)
add_definitions(-DBUILD_CPU_TESTS)
include_directories(modules/MEM_array/include)
add_subdirectory(modules/MEM_array)
include_directories(modules/MEM_malloc/include)
add_subdirectory(modules/MEM_malloc)
endif(BENCHY_BUILD_MODULES_MEM)
if(BENCHY_BUILD_MODULES_HDD)
add_definitions(-DBUILD_CPU_TESTS)
include_directories(modules/HDD_readwrite/include)
add_subdirectory(modules/HDD_readwrite)
endif(BENCHY_BUILD_MODULES_HDD)
if(BENCHY_BUILD_MODULES_2D)
add_definitions(-DBUILD_CPU_TESTS)
include_directories(modules/2D_infinerator/include)
add_subdirectory(modules/2D_infinerator)
include_directories(modules/2D_sprites/include)
add_subdirectory(modules/2D_sprites)
endif(BENCHY_BUILD_MODULES_2D)
if(BENCHY_BUILD_MODULES_3D)
add_definitions(-DBUILD_CPU_TESTS)
include_directories(modules/3D_asteroids/include)
add_subdirectory(modules/3D_asteroids)
include_directories(modules/3D_dancers/include)
add_subdirectory(modules/3D_dancers)
include_directories(modules/3D_lunar/include)
add_subdirectory(modules/3D_lunar)
include_directories(modules/3D_tunnel/include)
add_subdirectory(modules/3D_tunnel)
include_directories(modules/3D_woods/include)
add_subdirectory(modules/3D_woods)
endif(BENCHY_BUILD_MODULES_3D)
if(BENCHY_BUILD_APP_CLI)
message(STATUS "Building benchy main application")
add_subdirectory(app)
endif(BENCHY_BUILD_APP_CLI)
if(BENCHY_BUILD_APP_QT)
message(STATUS "Building benchy Qt frontend")
find_package(Qt4 REQUIRED)
add_subdirectory(app)
endif(BENCHY_BUILD_APP_QT)