Skip to content

Conversation

gosha20777
Copy link

Create CMakeLists.txt to use CMake instead of compile.sh

@jmvalin
Copy link
Member

jmvalin commented Dec 12, 2018

Thanks for working on cmake support. Unfortunately, I made many many changes to the files recently, so I broke what you did. Any way you can adapt it to the current (cleaner) set of files? Also, the CMakeLists.txt should probably sit in the main directory and not in src/

@gosha20777
Copy link
Author

gosha20777 commented Dec 12, 2018

Thanks, I'll update my branch and pin newer version of this file.

@gosha20777
Copy link
Author

so... I ve change CMakeLists.txt

cmake_minimum_required(VERSION 3.1)

project(lpcnet)

set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

add_executable(dump_data
	src/dump_data.c
	src/freq.c
	src/kiss_fft.c
	src/pitch.c
	src/celt_lpc.c
)


target_compile_definitions(dump_data PRIVATE "TRAINING=1")
target_include_directories(dump_data PRIVATE ${CMAKE_CURRENT_SOURCE}/)
target_link_libraries(dump_data PRIVATE
	"m"
)


add_executable(test_lpcnet
	src/test_lpcnet.c
	src/lpcnet.c
	src/nnet.c
	src/nnet_data.c
	src/freq.c
	src/kiss_fft.c
	src/pitch.c
	src/celt_lpc.c
)
add_custom_command(OUTPUT nnet_data.c
	COMMAND dump_lpcnet.py `ls -t lpcnet*.h5 | head -1`
	WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE}/src)

target_compile_options (test_lpcnet PRIVATE -march=native)
target_include_directories(test_lpcnet PRIVATE ${CMAKE_CURRENT_SOURCE}/)
target_link_libraries(test_lpcnet PRIVATE
	"m"
)

@jmvalin
Copy link
Member

jmvalin commented Jan 10, 2019

I find the Github PR interface pretty unclear... did you upload an up-to-date patch or are you still working on it?

@gosha20777
Copy link
Author

Yes I synchronized your and my branch and added there CMakeLists.txt you can merge this request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants