Skip to content

Commit 1f98ac3

Browse files
committed
Fixed CMakeLists.txt and set build type in RPM scripts
1 parent 617de51 commit 1f98ac3

File tree

6 files changed

+11
-8
lines changed

6 files changed

+11
-8
lines changed

CMakeLists.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#-------------------------------------------------------------------------------
2929

3030
cmake_minimum_required(VERSION 2.8.7)
31-
cmake_policy(SET CMP0048 NEW)
3231

3332
# Read version number from VERSION file and split into its component parts.
3433

@@ -42,14 +41,18 @@ set(VERSION_PATCH ${CMAKE_MATCH_3})
4241

4342
message(STATUS "Building version ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
4443

45-
project(audiowaveform VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
44+
if(${CMAKE_VERSION} VERSION_GREATER "3.0.0")
45+
cmake_policy(SET CMP0048 NEW)
46+
project(audiowaveform VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
47+
else()
48+
project(audiowaveform)
49+
endif()
4650

4751
if(NOT CMAKE_BUILD_TYPE)
4852
set(CMAKE_BUILD_TYPE "Release")
4953
message(STATUS "Build type not specified: default is Release")
5054
endif()
5155

52-
message(STATUS "CMAKE_VERSION=${CMAKE_VERSION}")
5356
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
5457

5558
# Prepend our CMake modules directory

rpm/Dockerfile-almalinux9

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ RUN wget -qO- https://github.com/bbc/audiowaveform/archive/${AUDIOWAVEFORM_VERSI
2626
cd audiowaveform-${AUDIOWAVEFORM_VERSION} && \
2727
mkdir build && \
2828
cd build && \
29-
cmake -D ENABLE_TESTS=0 .. && \
29+
cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_TESTS=0 .. && \
3030
make && \
3131
cpack -G RPM
3232

rpm/Dockerfile-amazon-linux-2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ RUN wget -qO- https://github.com/bbc/audiowaveform/archive/${AUDIOWAVEFORM_VERSI
3030
cd audiowaveform-${AUDIOWAVEFORM_VERSION} && \
3131
mkdir build && \
3232
cd build && \
33-
cmake3 -D ENABLE_TESTS=0 .. && \
33+
cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_TESTS=0 .. && \
3434
make && \
3535
cpack3 -G RPM
3636

rpm/Dockerfile-centos7

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ RUN wget -qO- https://github.com/bbc/audiowaveform/archive/${AUDIOWAVEFORM_VERSI
2929
cd audiowaveform-${AUDIOWAVEFORM_VERSION} && \
3030
mkdir build && \
3131
cd build && \
32-
cmake3 -D ENABLE_TESTS=0 .. && \
32+
cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_TESTS=0 .. && \
3333
make && \
3434
cpack3 -G RPM
3535

rpm/Dockerfile-centos8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ RUN wget -qO- https://github.com/bbc/audiowaveform/archive/${AUDIOWAVEFORM_VERSI
3838
cd audiowaveform-${AUDIOWAVEFORM_VERSION} && \
3939
mkdir build && \
4040
cd build && \
41-
cmake -D ENABLE_TESTS=0 .. && \
41+
cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_TESTS=0 .. && \
4242
make && \
4343
cpack -G RPM
4444

rpm/Dockerfile-debian

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ RUN wget -qO- https://github.com/bbc/audiowaveform/archive/${AUDIOWAVEFORM_VERSI
2424
cd audiowaveform-${AUDIOWAVEFORM_VERSION} && \
2525
mkdir build && \
2626
cd build && \
27-
cmake -D ENABLE_TESTS=0 .. && \
27+
cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_TESTS=0 .. && \
2828
make && \
2929
cpack -G DEB
3030

0 commit comments

Comments
 (0)