2013-12-19 00:55:45 +00:00
|
|
|
cmake_minimum_required (VERSION 2.8)
|
|
|
|
project (benchmark)
|
|
|
|
|
2014-02-05 19:46:54 +00:00
|
|
|
find_package(Threads REQUIRED)
|
2013-12-19 00:55:45 +00:00
|
|
|
|
2014-01-10 23:07:04 +00:00
|
|
|
set(CMAKE_CXX_FLAGS "-Wall -Werror -pedantic-errors --std=c++0x")
|
2013-12-19 00:55:45 +00:00
|
|
|
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -DDEBUG")
|
|
|
|
set(CMAKE_CXX_FLAGS_RELEASE "-fno-strict-aliasing -O3 -DNDEBUG")
|
|
|
|
|
|
|
|
# Set OS
|
|
|
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
|
|
|
add_definitions(-DOS_MACOSX)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
|
|
|
add_definitions(-DOS_LINUX)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
|
|
|
add_definitions(-DOS_WINDOWS)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# Set CPU
|
|
|
|
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86")
|
|
|
|
add_definitions(-DARCH_X86)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# Set up directories
|
|
|
|
include_directories(${PROJECT_SOURCE_DIR}/include)
|
|
|
|
include_directories(${PROJECT_SOURCE_DIR}/src)
|
|
|
|
|
|
|
|
# Build the targets
|
2014-04-23 07:47:07 +00:00
|
|
|
enable_testing()
|
|
|
|
add_subdirectory(src)
|
|
|
|
add_subdirectory(test)
|