mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2024-12-25 21:35:41 +00:00
47 lines
1.5 KiB
CMake
47 lines
1.5 KiB
CMake
cmake_minimum_required(VERSION 2.8)
|
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/CMakeFiles/modules/")
|
|
|
|
project(sprout)
|
|
ENABLE_TESTING()
|
|
|
|
include(CheckIncludeFiles)
|
|
include (FindPkgConfig)
|
|
include(CheckCXXSourceCompiles)
|
|
|
|
# build type
|
|
if( NOT DEFINED CMAKE_BUILD_TYPE )
|
|
set(CMAKE_BUILD_TYPE Debug)
|
|
endif( NOT DEFINED CMAKE_BUILD_TYPE )
|
|
|
|
option( BUILD_TESTS "If true Sprout's tests will be built" TRUE)
|
|
|
|
|
|
set(CMAKE_CXX_FLAGS_DEBUG "-W -Wall -Wextra -Wno-unused-parameter -Werror -std=c++0x -O0 -g")
|
|
set(CMAKE_C_FLAGS_DEBUG "-W -Wall -Wextra -Wno-unused-parameter -Werror -O0 -g")
|
|
set(CMAKE_CXX_FLAGS_RELEASE "-W -Wall -Wextra -Wno-unused-parameter -Werror -std=c++0x -O2")
|
|
set(CMAKE_C_FLAGS_RELEASE "-W -Wall -Wextra -Wno-unused-parameter -Werror -O2")
|
|
|
|
#if you don't want the full compiler output, remove the following line
|
|
if( NOT DEFINED CMAKE_VERBOSE_MAKEFILE )
|
|
set(CMAKE_VERBOSE_MAKEFILE OFF)
|
|
endif( NOT DEFINED CMAKE_VERBOSE_MAKEFILE )
|
|
|
|
|
|
if( NOT DEFINED Boost_USE_MULTITHREADED )
|
|
set(Boost_USE_MULTITHREADED ON)
|
|
endif( NOT DEFINED Boost_USE_MULTITHREADED )
|
|
|
|
find_package( Boost 1.49.0 REQUIRED )
|
|
if( NOT Boost_FOUND )
|
|
message( SEND_ERROR "Required package Boost was not detected." )
|
|
endif (NOT Boost_FOUND)
|
|
|
|
pkg_check_modules(OpenCV opencv)
|
|
|
|
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR} ${Boost_INCLUDE_DIRS} )
|
|
link_directories( ${Boost_LIBRARY_DIRS} )
|
|
subdirs( sprout tools cmake )
|
|
if( ${BUILD_TESTS} )
|
|
subdirs(libs)
|
|
endif( ${BUILD_TESTS} )
|
|
|