Commit 17a4cf80 authored by Votre Nom's avatar Votre Nom
Browse files

Modenise CMake C++

parent 442fbd30
cmake_minimum_required(VERSION 2.6)
cmake_minimum_required(VERSION 3.13)
project(i_sndfile)
find_path(SNDFILE_INCLUDE_DIR sndfile.h)
find_library(SNDFILE_LIBRARIES NAMES sndfile)
find_package(blc_channel REQUIRED)
find_package(blc_program REQUIRED)
find_package(blc REQUIRED)
add_definitions(${BL_DEFINITIONS})
include_directories(${BL_INCLUDE_DIRS} ${SNDFILE_INCLUDE_DIR})
add_executable(i_sndfile i_sndfile.cpp)
target_link_libraries(i_sndfile ${BL_LIBRARIES} ${SNDFILE_LIBRARIES})
target_link_libraries(i_sndfile PRIVATE blc ${SNDFILE_LIBRARIES} rt)
#include <sndfile.h>
#include "blc_text.h"
#include "blc_channel.h"
#include "blc_program.h"
#include <unistd.h> //getpid
......@@ -7,7 +7,6 @@
#define DEFAULT_OUTPUT_NAME ":sound<pid>" //':'
int main(int argc, char**argv){
blc_channel output;
char const *filename, *iterations_nb_str, *length_str, *output_name, *period_str, *samplerate_str, *seek_pos_str, *type_str;
int iterations_nb, period, samplerate;
size_t length;
......@@ -45,7 +44,7 @@ int main(int argc, char**argv){
if (strcmp(DEFAULT_OUTPUT_NAME, output_name)==0) asprintf((char**)&output_name, ":sound%d", getpid());
output.create_or_open(output_name, BLC_CHANNEL_WRITE, type, 'LPCM', 1, length);
blc_channel output(output_name, BLC_CHANNEL_WRITE, type, 'LPCM', { length });
output.publish();
CLEAR(sfinfo);
......
cmake_minimum_required(VERSION 2.6)
cmake_minimum_required(VERSION 3.13)
project(o_sndfile)
find_path(SNDFILE_INCLUDE_DIR sndfile.h)
find_library(SNDFILE_LIBRARIES NAMES sndfile)
find_package(blc_channel REQUIRED)
find_package(blc_program REQUIRED)
find_package(blc REQUIRED)
add_definitions(${BL_DEFINITIONS})
include_directories(${BL_INCLUDE_DIRS} ${SNDFILE_INCLUDE_DIR})
add_executable(o_sndfile o_sndfile.cpp)
target_link_libraries(o_sndfile ${BL_LIBRARIES} ${SNDFILE_LIBRARIES})
target_link_libraries(o_sndfile PRIVATE blc ${SNDFILE_LIBRARIES} rt)
#include <sndfile.h>
#include "blc_text.h"
#include "blc_channel.h"
#include "blc_program.h"
#include <unistd.h> //getpid
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment