Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use target_compile_definitions to build backend within another project #54

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/lib/$<CONFIG>)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/lib/$<CONFIG>)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/lib/$<CONFIG>)

add_definitions(-D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS)

set(BackendSources
src/VocalTractLabBackend/AnatomyParams.cpp
src/VocalTractLabBackend/Dsp.cpp
Expand Down Expand Up @@ -52,12 +50,13 @@ target_include_directories (VocalTractLabApi PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
target_sources(VocalTractLabApi PRIVATE ${BackendSources}
src/VocalTractLabApi/VocalTractLabApi.cpp
src/VocalTractLabApi/VocalTractLabApi.def)

target_compile_definitions(VocalTractLabApi PRIVATE _USE_MATH_DEFINES PRIVATE _CRT_SECURE_NO_WARNINGS)

project("VocalTractLabBackend")
add_library(VocalTractLabBackend STATIC)
target_include_directories (VocalTractLabBackend PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
target_sources(VocalTractLabBackend PUBLIC ${BackendSources})
target_compile_definitions(VocalTractLabBackend PUBLIC _USE_MATH_DEFINES PUBLIC _CRT_SECURE_NO_WARNINGS)


include(FetchContent)
Expand Down