aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniil Cherednik <dan.cherednik@gmail.com>2016-07-17 19:21:55 +0300
committerDaniil Cherednik <dcherednik@gmail.com>2016-07-17 19:47:45 +0300
commit5154e84468bba497026d41889ac3648bfcc9f2dd (patch)
treec064ac3d1814435a01b1924e6d8481e49787548a
parent63f950fc474a0b371feee74485192c11bed03187 (diff)
downloadatracdenc-5154e84468bba497026d41889ac3648bfcc9f2dd.tar.gz
Fix building with cmake < 3.1
-rw-r--r--CMakeLists.txt13
-rw-r--r--src/CMakeLists.txt3
-rw-r--r--src/pcmengin.h1
-rw-r--r--src/transient_detector.cpp1
4 files changed, 14 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index db76a04..2bce62f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,16 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
-set(CMAKE_CXX_STANDARD 11)
+
+macro(use_cxx11)
+ if (CMAKE_VERSION VERSION_LESS "3.1")
+ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+ set (CMAKE_CXX_FLAGS "--std=gnu++11 ${CMAKE_CXX_FLAGS}")
+ endif ()
+ else ()
+ set (CMAKE_CXX_STANDARD 11)
+ endif ()
+endmacro(use_cxx11)
+
+use_cxx11()
add_subdirectory(3rd/gtest-1.7.0)
add_subdirectory(src)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 3fc1d11..fd7fe24 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,15 +1,12 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
add_definitions( "-Wall -O2 -g" )
-set(CMAKE_CXX_STANDARD 11)
project(atracdenc)
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/modules")
INCLUDE(FindLibSndFile)
-find_package(libsndfile REQUIRED)
-
include_directories(${LIBSNDFILE_INCLUDE_DIR})
set(SOURCE_LIB mdct/vorbis_impl/mdct.c)
diff --git a/src/pcmengin.h b/src/pcmengin.h
index 802d2d8..0dff7aa 100644
--- a/src/pcmengin.h
+++ b/src/pcmengin.h
@@ -6,6 +6,7 @@
#include <functional>
#include <assert.h>
+#include <string.h>
class TPCMBufferTooSmall : public std::exception {
virtual const char* what() const throw() {
diff --git a/src/transient_detector.cpp b/src/transient_detector.cpp
index 43897d6..1c6a2aa 100644
--- a/src/transient_detector.cpp
+++ b/src/transient_detector.cpp
@@ -1,5 +1,6 @@
#include "transient_detector.h"
#include <stdlib.h>
+#include <string.h>
namespace NAtracDEnc {