2009-09-09 02:51:47 -04:00
|
|
|
cmake_minimum_required(VERSION 2.6)
|
|
|
|
if(COMMAND cmake_policy)
|
|
|
|
cmake_policy(VERSION 2.6)
|
|
|
|
endif(COMMAND cmake_policy)
|
|
|
|
|
2010-02-24 19:04:41 -05:00
|
|
|
project( tmux-mem-cpu-load )
|
2009-09-09 02:51:47 -04:00
|
|
|
|
|
|
|
if(NOT CMAKE_BUILD_TYPE)
|
2013-07-15 19:23:11 -04:00
|
|
|
set(CMAKE_BUILD_TYPE MinSizeRel CACHE STRING
|
2009-09-09 02:51:47 -04:00
|
|
|
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
|
|
|
|
FORCE)
|
|
|
|
endif(NOT CMAKE_BUILD_TYPE)
|
|
|
|
|
2013-04-30 06:38:39 -04:00
|
|
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
|
2010-02-24 19:04:41 -05:00
|
|
|
add_executable(tmux-mem-cpu-load tmux-mem-cpu-load.cpp)
|
|
|
|
install(TARGETS tmux-mem-cpu-load
|
2013-04-04 19:50:16 -04:00
|
|
|
RUNTIME DESTINATION bin
|
2009-09-09 02:51:47 -04:00
|
|
|
)
|
2013-06-09 22:50:03 -04:00
|
|
|
|
|
|
|
include( CTest )
|
|
|
|
if( BUILD_TESTING )
|
|
|
|
add_test( NAME usage
|
|
|
|
COMMAND tmux-mem-cpu-load -h )
|
|
|
|
|
|
|
|
add_test( NAME no_arguments
|
|
|
|
COMMAND tmux-mem-cpu-load )
|
|
|
|
|
|
|
|
add_test( NAME colors
|
|
|
|
COMMAND tmux-mem-cpu-load --colors )
|
|
|
|
|
|
|
|
add_test( NAME arguments
|
|
|
|
COMMAND tmux-mem-cpu-load --colors 1 4 )
|
|
|
|
|
|
|
|
add_test( NAME invalid_status_interval
|
|
|
|
COMMAND tmux-mem-cpu-load -1 4 )
|
|
|
|
|
|
|
|
add_test( NAME invalid_graph_lines
|
|
|
|
COMMAND tmux-mem-cpu-load 1 -4 )
|
|
|
|
|
|
|
|
set_tests_properties( usage
|
|
|
|
invalid_status_interval
|
|
|
|
invalid_graph_lines
|
|
|
|
PROPERTIES WILL_FAIL TRUE )
|
|
|
|
endif()
|