Skip to content

Commit

Permalink
Add an option to link against an installed libfaust. Fixes CICM#12.
Browse files Browse the repository at this point in the history
  • Loading branch information
agraef committed Aug 5, 2020
1 parent 9e2aaea commit 029414c
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,21 @@ if(UNIX AND NOT APPLE)
set(FAUST_LIBS "stdc++" CACHE STRING "FAUST LIBRARIES" FORCE)
endif()

## Set this to ON to link against an installed libfaust rather than the
## version we include. CAVEATS: Use at your own risk. The Faust version
## provided by your system may be too old or too new to be used with
## faustgen~. You also have to make sure that Faust's include files and
## libfaust.so and/or libfaust.a are on the standard include and library
## paths, respectively, otherwise the compilation will fail. If you plan to
## upload the external to Deken, we recommend leaving this option OFF, since
## that will gurantee that libfaust is linked statically into the external.
set(INSTALLED_FAUST "OFF" CACHE BOOL "Use an installed Faust library")

message(STATUS "Installed Faust library: ${INSTALLED_FAUST}")
if(NOT INSTALLED_FAUST)
include(FaustLib.cmake)
endif()

## Create Faust~
message(STATUS "faustgen~ external")

Expand All @@ -31,9 +45,13 @@ ${PROJECT_SOURCE_DIR}/src/faust_tilde_options.c)
add_pd_external(faustgen_tilde_project faustgen~ "${faustgen_tilde_sources}")

## Link the Pure Data external with faustlib
include_directories(${PROJECT_SOURCE_DIR}/faust/architecture)
add_dependencies(faustgen_tilde_project staticlib)
target_link_libraries(faustgen_tilde_project staticlib)
if(INSTALLED_FAUST)
target_link_libraries(faustgen_tilde_project "-lfaust")
else()
include_directories(${PROJECT_SOURCE_DIR}/faust/architecture)
add_dependencies(faustgen_tilde_project staticlib)
target_link_libraries(faustgen_tilde_project staticlib)
endif()

## Link the Pure Data external with llvm
find_package(LLVM REQUIRED CONFIG)
Expand Down

0 comments on commit 029414c

Please sign in to comment.