Skip to content

Commit

Permalink
Fixed CMakeLists.txt and set build type in RPM scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisn committed Oct 1, 2023
1 parent 617de51 commit 1f98ac3
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 8 deletions.
9 changes: 6 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#-------------------------------------------------------------------------------

cmake_minimum_required(VERSION 2.8.7)
cmake_policy(SET CMP0048 NEW)

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

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

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

project(audiowaveform VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
if(${CMAKE_VERSION} VERSION_GREATER "3.0.0")
cmake_policy(SET CMP0048 NEW)
project(audiowaveform VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
else()
project(audiowaveform)
endif()

if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
message(STATUS "Build type not specified: default is Release")
endif()

message(STATUS "CMAKE_VERSION=${CMAKE_VERSION}")
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")

# Prepend our CMake modules directory
Expand Down
2 changes: 1 addition & 1 deletion rpm/Dockerfile-almalinux9
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ RUN wget -qO- https://github.com/bbc/audiowaveform/archive/${AUDIOWAVEFORM_VERSI
cd audiowaveform-${AUDIOWAVEFORM_VERSION} && \
mkdir build && \
cd build && \
cmake -D ENABLE_TESTS=0 .. && \
cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_TESTS=0 .. && \
make && \
cpack -G RPM

Expand Down
2 changes: 1 addition & 1 deletion rpm/Dockerfile-amazon-linux-2
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ RUN wget -qO- https://github.com/bbc/audiowaveform/archive/${AUDIOWAVEFORM_VERSI
cd audiowaveform-${AUDIOWAVEFORM_VERSION} && \
mkdir build && \
cd build && \
cmake3 -D ENABLE_TESTS=0 .. && \
cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_TESTS=0 .. && \
make && \
cpack3 -G RPM

Expand Down
2 changes: 1 addition & 1 deletion rpm/Dockerfile-centos7
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ RUN wget -qO- https://github.com/bbc/audiowaveform/archive/${AUDIOWAVEFORM_VERSI
cd audiowaveform-${AUDIOWAVEFORM_VERSION} && \
mkdir build && \
cd build && \
cmake3 -D ENABLE_TESTS=0 .. && \
cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_TESTS=0 .. && \
make && \
cpack3 -G RPM

Expand Down
2 changes: 1 addition & 1 deletion rpm/Dockerfile-centos8
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ RUN wget -qO- https://github.com/bbc/audiowaveform/archive/${AUDIOWAVEFORM_VERSI
cd audiowaveform-${AUDIOWAVEFORM_VERSION} && \
mkdir build && \
cd build && \
cmake -D ENABLE_TESTS=0 .. && \
cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_TESTS=0 .. && \
make && \
cpack -G RPM

Expand Down
2 changes: 1 addition & 1 deletion rpm/Dockerfile-debian
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ RUN wget -qO- https://github.com/bbc/audiowaveform/archive/${AUDIOWAVEFORM_VERSI
cd audiowaveform-${AUDIOWAVEFORM_VERSION} && \
mkdir build && \
cd build && \
cmake -D ENABLE_TESTS=0 .. && \
cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_TESTS=0 .. && \
make && \
cpack -G DEB

Expand Down

0 comments on commit 1f98ac3

Please sign in to comment.