xref: /libbtbb/CMakeLists.txt (revision c256d3273fd9d12e1c6e52402af29877bb738fdb)
1#
2# Copyright 2013 Dominic Spill
3#
4# This file is part of Libbtbb.
5#
6# This program is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 2, or (at your option)
9# any later version.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program; see the file COPYING.  If not, write to
18# the Free Software Foundation, Inc., 51 Franklin Street,
19# Boston, MA 02110-1301, USA.
20#
21#top level cmake project for libbtbb lib + tools
22
23cmake_minimum_required(VERSION 2.8)
24set(MAJOR_VERSION 0)
25set(MINOR_VERSION 3)
26project(libbtbb_all)
27set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules)
28
29set(INSTALL_DEFAULT_BINDIR "bin" CACHE STRING "Appended to CMAKE_INSTALL_PREFIX")
30
31set(BUILD_SHARED_LIB ON CACHE BOOL "Build shared library")
32set(BUILD_STATIC_LIB OFF CACHE BOOL "Build static library")
33set(ENABLE_PYTHON ON CACHE BOOL "Build python tools")
34
35set( VERSION ${MAJOR_VERSION}.${MINOR_VERSION} )
36add_definitions( -DVERSION="${VERSION}" )
37
38# Comment the following out for releases.
39set(CMAKE_C_FLAGS "$ENV{CFLAGS}" CACHE STRING "C Flags")
40
41add_subdirectory(lib)
42if(ENABLE_PYTHON)
43	add_subdirectory(python)
44endif()
45
46# Create uninstall target
47configure_file(
48    ${PROJECT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in
49    ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
50@ONLY)
51
52add_custom_target(uninstall
53    ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
54)
55