From 029414c8ea2cc89f2a5963fea2f4f6025984b205 Mon Sep 17 00:00:00 2001 From: Albert Graef Date: Wed, 5 Aug 2020 20:38:22 +0200 Subject: [PATCH 01/12] Add an option to link against an installed libfaust. Fixes #12. --- CMakeLists.txt | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2767981..63cdb32 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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") @@ -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) From 8908fa3402c901115988976b5645888ced659443 Mon Sep 17 00:00:00 2001 From: Albert Graef Date: Wed, 5 Aug 2020 11:57:57 +0200 Subject: [PATCH 02/12] Add an install target. --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 63cdb32..abda0c7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,3 +70,7 @@ endif() if(MSVC) set_property(TARGET faustgen_tilde_project APPEND_STRING PROPERTY LINK_FLAGS " /ignore:4099 ") endif() + +file(GLOB lib_files ${PROJECT_SOURCE_DIR}/faust/libraries/*.lib ${PROJECT_SOURCE_DIR}/faust/libraries/old/*.lib) +install(DIRECTORY external/ DESTINATION lib/pd/extra/faustgen~) +install(FILES ${lib_files} DESTINATION lib/pd/extra/faustgen~/libs) From c4377db9181b69bc912893d198664a0c248ed64e Mon Sep 17 00:00:00 2001 From: Albert Graef Date: Wed, 5 Aug 2020 18:59:58 +0200 Subject: [PATCH 03/12] Make the destination directory for the external configurable with the INSTALL_DIR variable, and use a more sensible default for that directory on Mac and Windows. --- CMakeLists.txt | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index abda0c7..49b024a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,6 +71,17 @@ if(MSVC) set_property(TARGET faustgen_tilde_project APPEND_STRING PROPERTY LINK_FLAGS " /ignore:4099 ") endif() +## Installation directory. This is relative to CMAKE_INSTALL_PREFIX. +## Default is lib/pd/extra/faustgen~ on Linux and other generic Unix-like +## systems, or just faustgen~ on Mac and Windows. +if(UNIX AND NOT APPLE) + set(INSTALL_DIR "lib/pd/extra/faustgen~" CACHE STRING "Destination directory for the external") +else() + set(INSTALL_DIR "faustgen~" CACHE STRING "Destination directory for the external") +endif() + +message(STATUS "Installation goes to CMAKE_INSTALL_PREFIX/${INSTALL_DIR}") + file(GLOB lib_files ${PROJECT_SOURCE_DIR}/faust/libraries/*.lib ${PROJECT_SOURCE_DIR}/faust/libraries/old/*.lib) -install(DIRECTORY external/ DESTINATION lib/pd/extra/faustgen~) -install(FILES ${lib_files} DESTINATION lib/pd/extra/faustgen~/libs) +install(DIRECTORY external/ DESTINATION ${INSTALL_DIR}) +install(FILES ${lib_files} DESTINATION ${INSTALL_DIR}/libs) From ff29c77dd0c9ca56c1a0c6706db98f102c4e55e7 Mon Sep 17 00:00:00 2001 From: Albert Graef Date: Wed, 5 Aug 2020 21:52:11 +0200 Subject: [PATCH 04/12] Add the necessary machinery to grab the Faust library files from the installed Faust when linking against an installed Faust version. --- CMakeLists.txt | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 49b024a..a942845 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -81,7 +81,23 @@ else() endif() message(STATUS "Installation goes to CMAKE_INSTALL_PREFIX/${INSTALL_DIR}") +message(STATUS "(set the INSTALL_DIR variable to override)") -file(GLOB lib_files ${PROJECT_SOURCE_DIR}/faust/libraries/*.lib ${PROJECT_SOURCE_DIR}/faust/libraries/old/*.lib) +if(INSTALLED_FAUST) + ## Grab the .lib files from the installed Faust using the FAUSTLIB path, + ## /usr/share/faust by default. You can adjust this path if needed by + ## setting the FAUSTLIB variable accordingly. + find_path(FAUSTLIB all.lib PATH_SUFFIXES faust share/faust) + if(NOT FAUSTLIB) + set(FAUSTLIB "/usr/share/faust") + message(WARNING "Faust library files not found, assuming ${FAUSTLIB} (set the FAUSTLIB variable to override)") + else() + message(STATUS "Faust library files found at ${FAUSTLIB}") + message(STATUS "(set the FAUSTLIB variable to override)") + endif() + file(GLOB lib_files ${FAUSTLIB}/*.lib) +else() + file(GLOB lib_files ${PROJECT_SOURCE_DIR}/faust/libraries/*.lib ${PROJECT_SOURCE_DIR}/faust/libraries/old/*.lib) +endif() install(DIRECTORY external/ DESTINATION ${INSTALL_DIR}) install(FILES ${lib_files} DESTINATION ${INSTALL_DIR}/libs) From bbadc5cac16a2e8cbef1fe32395e97b0c8bfee93 Mon Sep 17 00:00:00 2001 From: Albert Graef Date: Thu, 6 Aug 2020 09:25:27 +0200 Subject: [PATCH 05/12] Make it possible to link against an installed libfaust statically. --- CMakeLists.txt | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a942845..a820b84 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,8 +23,16 @@ endif() ## that will gurantee that libfaust is linked statically into the external. set(INSTALLED_FAUST "OFF" CACHE BOOL "Use an installed Faust library") +## In addition, set this to OFF in order to link to the shared libfaust +## library. Default is static linking. Note that this option only has an +## effect if INSTALLED_FAUST is ON. Static linking is always used when linking +## with the included Faust version. +set(STATIC_FAUST "ON" CACHE BOOL "Link the installed Faust library statically if possible") + message(STATUS "Installed Faust library: ${INSTALLED_FAUST}") -if(NOT INSTALLED_FAUST) +if(INSTALLED_FAUST) +message(STATUS "Installed Faust static linking: ${STATIC_FAUST}") +else() include(FaustLib.cmake) endif() @@ -46,7 +54,13 @@ add_pd_external(faustgen_tilde_project faustgen~ "${faustgen_tilde_sources}") ## Link the Pure Data external with faustlib if(INSTALLED_FAUST) - target_link_libraries(faustgen_tilde_project "-lfaust") + ## FIXME: The way we do static linking requires gcc at present, so disable + ## this option with MSVC for now. + if(STATIC_FAUST AND NOT MSVC) + target_link_libraries(faustgen_tilde_project "-Wl,-Bstatic" "-lfaust" "-Wl,-Bdynamic") + else() + target_link_libraries(faustgen_tilde_project "-lfaust") + endif() else() include_directories(${PROJECT_SOURCE_DIR}/faust/architecture) add_dependencies(faustgen_tilde_project staticlib) @@ -62,6 +76,21 @@ add_definitions(${LLVM_DEFINITIONS}) include_directories(${LLVM_INCLUDE_DIRS}) llvm_map_components_to_libnames(llvm_libs all) list(REMOVE_ITEM llvm_libs LTO) +## Work around llvm_map_components_to_libnames producing an empty result at +## least with some LLVM versions. In such a case, llvm-config can hopefully +## provide us with the correct options. Note that this requires that +## llvm-config can be found on PATH. +if(NOT llvm_libs) + execute_process(COMMAND llvm-config --libs OUTPUT_VARIABLE llvm_config_libs OUTPUT_STRIP_TRAILING_WHITESPACE) + if(NOT llvm_config_libs) + message(WARNING "Tried to get LLVM libraries from both cmake and llvm-config, but both came up empty (maybe try to set llvm_libs manually)") + else() + message(STATUS "Using fallback LLVM linker options (llvm-config --libs): ${llvm_config_libs}") + # Make sure that we get a proper cmake list in case llvm-config returned + # multiple libraries. + string(REPLACE " " ";" llvm_libs "${llvm_config_libs}") + endif() +endif() target_link_libraries(faustgen_tilde_project ${llvm_libs}) if(WIN32) target_link_libraries(faustgen_tilde_project ws2_32) From e3cb05654eedf3ea24ca1492178e34433569714f Mon Sep 17 00:00:00 2001 From: Albert Graef Date: Thu, 6 Aug 2020 17:36:57 +0200 Subject: [PATCH 06/12] Use find_library to locate an installed libfaust. --- CMakeLists.txt | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a820b84..19e3242 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,13 +54,21 @@ add_pd_external(faustgen_tilde_project faustgen~ "${faustgen_tilde_sources}") ## Link the Pure Data external with faustlib if(INSTALLED_FAUST) - ## FIXME: The way we do static linking requires gcc at present, so disable - ## this option with MSVC for now. - if(STATIC_FAUST AND NOT MSVC) - target_link_libraries(faustgen_tilde_project "-Wl,-Bstatic" "-lfaust" "-Wl,-Bdynamic") + if(STATIC_FAUST) + if(MSVC) + find_library(FAUST_LIBRARY faust.lib REQUIRED) + else() + find_library(FAUST_LIBRARY libfaust.a REQUIRED) + endif() else() - target_link_libraries(faustgen_tilde_project "-lfaust") + if(MSVC) + find_library(FAUST_LIBRARY faust.dll REQUIRED) + else() + find_library(FAUST_LIBRARY NAMES libfaust.so libfaust.dylib REQUIRED) + endif() endif() + message(STATUS "Found installed Faust library at: ${FAUST_LIBRARY}") + target_link_libraries(faustgen_tilde_project ${FAUST_LIBRARY}) else() include_directories(${PROJECT_SOURCE_DIR}/faust/architecture) add_dependencies(faustgen_tilde_project staticlib) From 2b687d62601d952494cd9015cb1d51453769642c Mon Sep 17 00:00:00 2001 From: Albert Graef Date: Sat, 22 Aug 2020 23:38:18 +0200 Subject: [PATCH 07/12] Add check around list REMOVE_ITEM to ensure that llvm_libs isn't empty. --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 19e3242..c76fe90 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -83,7 +83,9 @@ message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}") add_definitions(${LLVM_DEFINITIONS}) include_directories(${LLVM_INCLUDE_DIRS}) llvm_map_components_to_libnames(llvm_libs all) -list(REMOVE_ITEM llvm_libs LTO) +if(llvm_libs) + list(REMOVE_ITEM llvm_libs LTO) +endif() ## Work around llvm_map_components_to_libnames producing an empty result at ## least with some LLVM versions. In such a case, llvm-config can hopefully ## provide us with the correct options. Note that this requires that From bb9bed2351b74a09abadaac61b7a269c85f2f084 Mon Sep 17 00:00:00 2001 From: Albert Graef Date: Sun, 23 Aug 2020 00:03:18 +0200 Subject: [PATCH 08/12] INSTALLED_FAUST: It is now a fatal error if the search for the Faust library files fails, or the user specified the wrong library directory. --- CMakeLists.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c76fe90..2da1fe2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -123,13 +123,13 @@ message(STATUS "Installation goes to CMAKE_INSTALL_PREFIX/${INSTALL_DIR}") message(STATUS "(set the INSTALL_DIR variable to override)") if(INSTALLED_FAUST) - ## Grab the .lib files from the installed Faust using the FAUSTLIB path, - ## /usr/share/faust by default. You can adjust this path if needed by - ## setting the FAUSTLIB variable accordingly. - find_path(FAUSTLIB all.lib PATH_SUFFIXES faust share/faust) - if(NOT FAUSTLIB) - set(FAUSTLIB "/usr/share/faust") - message(WARNING "Faust library files not found, assuming ${FAUSTLIB} (set the FAUSTLIB variable to override)") + ## Grab the .lib files from the installed Faust using the FAUSTLIB + ## path. There's no default here if the search for the library files fails, + ## but you can adjust this path if needed by setting the FAUSTLIB variable + ## accordingly. + find_path(FAUSTLIB all.lib PATH_SUFFIXES faust share/faust REQUIRED) + if(NOT FAUSTLIB OR NOT EXISTS "${FAUSTLIB}/all.lib") + message(FATAL_ERROR "Faust library files not found, maybe you specified the wrong FAUSTLIB directory? Otherwise try using the included Faust instead (INSTALLED_FAUST=OFF).") else() message(STATUS "Faust library files found at ${FAUSTLIB}") message(STATUS "(set the FAUSTLIB variable to override)") From 6c901766fff495a737e409b52114f33f0871aed4 Mon Sep 17 00:00:00 2001 From: Albert Graef Date: Sun, 23 Aug 2020 11:19:23 +0200 Subject: [PATCH 09/12] INSTALLED_FAUST: Improve the detection of the installed Faust library, and search for the Faust include files. --- CMakeLists.txt | 54 ++++++++++++++++++++++++++++++++++---------------- 1 file changed, 37 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2da1fe2..f5e485b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,11 +16,9 @@ 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. +## faustgen~, in which case 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") ## In addition, set this to OFF in order to link to the shared libfaust @@ -67,7 +65,39 @@ if(INSTALLED_FAUST) find_library(FAUST_LIBRARY NAMES libfaust.so libfaust.dylib REQUIRED) endif() endif() - message(STATUS "Found installed Faust library at: ${FAUST_LIBRARY}") + # Double-check that the file actually exists, in case the user specified a + # wrong path. + if(FAUST_LIBRARY AND EXISTS ${FAUST_LIBRARY}) + ## Based on FAUST_LIBRARY we can make an educated guess about the + ## locations of the Faust include and library directories for the specific + ## Faust installation we're using. These should work in most cases, but we + ## also do a more general search in standard locations as a fallback. + get_filename_component(FAUST_LIBRARY_DIR ${FAUST_LIBRARY} DIRECTORY) + if(FAUST_LIBRARY_DIR) + find_path(FAUST_INCLUDE_DIR dsp/llvm-c-dsp.h HINTS "${FAUST_LIBRARY_DIR}/../include/faust" NO_DEFAULT_PATH) + if(NOT FAUST_INCLUDE_DIR) + find_path(FAUST_INCLUDE_DIR dsp/llvm-c-dsp.h PATH_SUFFIXES faust include/faust REQUIRED) + endif() + find_path(FAUSTLIB all.lib HINTS "${FAUST_LIBRARY_DIR}/../share/faust" NO_DEFAULT_PATH) + if(NOT FAUSTLIB) + find_path(FAUSTLIB all.lib PATH_SUFFIXES faust share/faust REQUIRED) + endif() + endif() + message(STATUS "Found installed Faust library at: ${FAUST_LIBRARY}") + if(FAUST_INCLUDE_DIR AND EXISTS "${FAUST_INCLUDE_DIR}/dsp/llvm-c-dsp.h") + message(STATUS "Found installed Faust include files at: ${FAUST_INCLUDE_DIR}") + else() + message(FATAL_ERROR "Faust include files not found, maybe you specified the wrong FAUST_INCLUDE_DIR directory? Otherwise try using the included Faust instead (INSTALLED_FAUST=OFF).") + endif() + if(FAUSTLIB AND EXISTS "${FAUSTLIB}/all.lib") + message(STATUS "Found installed Faust library files at: ${FAUSTLIB}") + else() + message(FATAL_ERROR "Faust library files not found, maybe you specified the wrong FAUSTLIB directory? Otherwise try using the included Faust instead (INSTALLED_FAUST=OFF).") + endif() + else() + message(FATAL_ERROR "Faust library not found, maybe you specified the wrong FAUST_LIBRARY directory? Otherwise try using the included Faust instead (INSTALLED_FAUST=OFF).") + endif() + include_directories(${FAUST_INCLUDE_DIR}) target_link_libraries(faustgen_tilde_project ${FAUST_LIBRARY}) else() include_directories(${PROJECT_SOURCE_DIR}/faust/architecture) @@ -123,17 +153,7 @@ message(STATUS "Installation goes to CMAKE_INSTALL_PREFIX/${INSTALL_DIR}") message(STATUS "(set the INSTALL_DIR variable to override)") if(INSTALLED_FAUST) - ## Grab the .lib files from the installed Faust using the FAUSTLIB - ## path. There's no default here if the search for the library files fails, - ## but you can adjust this path if needed by setting the FAUSTLIB variable - ## accordingly. - find_path(FAUSTLIB all.lib PATH_SUFFIXES faust share/faust REQUIRED) - if(NOT FAUSTLIB OR NOT EXISTS "${FAUSTLIB}/all.lib") - message(FATAL_ERROR "Faust library files not found, maybe you specified the wrong FAUSTLIB directory? Otherwise try using the included Faust instead (INSTALLED_FAUST=OFF).") - else() - message(STATUS "Faust library files found at ${FAUSTLIB}") - message(STATUS "(set the FAUSTLIB variable to override)") - endif() + ## Grab the .lib files from the installed Faust using the FAUSTLIB path. file(GLOB lib_files ${FAUSTLIB}/*.lib) else() file(GLOB lib_files ${PROJECT_SOURCE_DIR}/faust/libraries/*.lib ${PROJECT_SOURCE_DIR}/faust/libraries/old/*.lib) From 98db764d0b3501e2ea71372ff1d5266d15b72285 Mon Sep 17 00:00:00 2001 From: Albert Graef Date: Sun, 23 Aug 2020 11:39:15 +0200 Subject: [PATCH 10/12] Improve detection of the llvm-config executable. The LLVM_CONFIG_PROG variable can now be used to point cmake to the right llvm-config executable. --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f5e485b..e02bc13 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -119,9 +119,11 @@ endif() ## Work around llvm_map_components_to_libnames producing an empty result at ## least with some LLVM versions. In such a case, llvm-config can hopefully ## provide us with the correct options. Note that this requires that -## llvm-config can be found on PATH. +## llvm-config can be found on PATH, otherwise you'll have to set the +## LLVM_CONFIG_PROG variable. if(NOT llvm_libs) - execute_process(COMMAND llvm-config --libs OUTPUT_VARIABLE llvm_config_libs OUTPUT_STRIP_TRAILING_WHITESPACE) + find_program(LLVM_CONFIG_PROG "llvm-config" DOC "Use the given llvm-config executable" REQUIRED) + execute_process(COMMAND ${LLVM_CONFIG_PROG} --libs OUTPUT_VARIABLE llvm_config_libs OUTPUT_STRIP_TRAILING_WHITESPACE) if(NOT llvm_config_libs) message(WARNING "Tried to get LLVM libraries from both cmake and llvm-config, but both came up empty (maybe try to set llvm_libs manually)") else() From 966d99a86b44e7075637e5161f94857ac4230538 Mon Sep 17 00:00:00 2001 From: Albert Graef Date: Sun, 23 Aug 2020 11:56:08 +0200 Subject: [PATCH 11/12] Add some missing DOC strings for cached variables. --- CMakeLists.txt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e02bc13..ca4bd31 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,15 +54,15 @@ add_pd_external(faustgen_tilde_project faustgen~ "${faustgen_tilde_sources}") if(INSTALLED_FAUST) if(STATIC_FAUST) if(MSVC) - find_library(FAUST_LIBRARY faust.lib REQUIRED) + find_library(FAUST_LIBRARY faust.lib DOC "Faust library location" REQUIRED) else() - find_library(FAUST_LIBRARY libfaust.a REQUIRED) + find_library(FAUST_LIBRARY libfaust.a DOC "Faust library location" REQUIRED) endif() else() if(MSVC) - find_library(FAUST_LIBRARY faust.dll REQUIRED) + find_library(FAUST_LIBRARY faust.dll DOC "Faust library location" REQUIRED) else() - find_library(FAUST_LIBRARY NAMES libfaust.so libfaust.dylib REQUIRED) + find_library(FAUST_LIBRARY NAMES libfaust.so libfaust.dylib DOC "Faust library location" REQUIRED) endif() endif() # Double-check that the file actually exists, in case the user specified a @@ -74,13 +74,13 @@ if(INSTALLED_FAUST) ## also do a more general search in standard locations as a fallback. get_filename_component(FAUST_LIBRARY_DIR ${FAUST_LIBRARY} DIRECTORY) if(FAUST_LIBRARY_DIR) - find_path(FAUST_INCLUDE_DIR dsp/llvm-c-dsp.h HINTS "${FAUST_LIBRARY_DIR}/../include/faust" NO_DEFAULT_PATH) + find_path(FAUST_INCLUDE_DIR dsp/llvm-c-dsp.h HINTS "${FAUST_LIBRARY_DIR}/../include/faust" DOC "Faust include directory" NO_DEFAULT_PATH) if(NOT FAUST_INCLUDE_DIR) - find_path(FAUST_INCLUDE_DIR dsp/llvm-c-dsp.h PATH_SUFFIXES faust include/faust REQUIRED) + find_path(FAUST_INCLUDE_DIR dsp/llvm-c-dsp.h PATH_SUFFIXES faust include/faust DOC "Faust include directory" REQUIRED) endif() - find_path(FAUSTLIB all.lib HINTS "${FAUST_LIBRARY_DIR}/../share/faust" NO_DEFAULT_PATH) + find_path(FAUSTLIB all.lib HINTS "${FAUST_LIBRARY_DIR}/../share/faust" DOC "Faust library files" NO_DEFAULT_PATH) if(NOT FAUSTLIB) - find_path(FAUSTLIB all.lib PATH_SUFFIXES faust share/faust REQUIRED) + find_path(FAUSTLIB all.lib PATH_SUFFIXES faust share/faust DOC "Faust library files" REQUIRED) endif() endif() message(STATUS "Found installed Faust library at: ${FAUST_LIBRARY}") From ad98bc5ff15ac81e2ab0371f3519e62b431cfda9 Mon Sep 17 00:00:00 2001 From: Albert Graef Date: Sun, 23 Aug 2020 12:36:09 +0200 Subject: [PATCH 12/12] Fix a glitch in the detection of the Faust include files. --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ca4bd31..f25dce8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -74,9 +74,9 @@ if(INSTALLED_FAUST) ## also do a more general search in standard locations as a fallback. get_filename_component(FAUST_LIBRARY_DIR ${FAUST_LIBRARY} DIRECTORY) if(FAUST_LIBRARY_DIR) - find_path(FAUST_INCLUDE_DIR dsp/llvm-c-dsp.h HINTS "${FAUST_LIBRARY_DIR}/../include/faust" DOC "Faust include directory" NO_DEFAULT_PATH) + find_path(FAUST_INCLUDE_DIR faust/dsp/llvm-c-dsp.h HINTS "${FAUST_LIBRARY_DIR}/../include" DOC "Faust include directory" NO_DEFAULT_PATH) if(NOT FAUST_INCLUDE_DIR) - find_path(FAUST_INCLUDE_DIR dsp/llvm-c-dsp.h PATH_SUFFIXES faust include/faust DOC "Faust include directory" REQUIRED) + find_path(FAUST_INCLUDE_DIR faust/dsp/llvm-c-dsp.h DOC "Faust include directory" REQUIRED) endif() find_path(FAUSTLIB all.lib HINTS "${FAUST_LIBRARY_DIR}/../share/faust" DOC "Faust library files" NO_DEFAULT_PATH) if(NOT FAUSTLIB) @@ -84,7 +84,7 @@ if(INSTALLED_FAUST) endif() endif() message(STATUS "Found installed Faust library at: ${FAUST_LIBRARY}") - if(FAUST_INCLUDE_DIR AND EXISTS "${FAUST_INCLUDE_DIR}/dsp/llvm-c-dsp.h") + if(FAUST_INCLUDE_DIR AND EXISTS "${FAUST_INCLUDE_DIR}/faust/dsp/llvm-c-dsp.h") message(STATUS "Found installed Faust include files at: ${FAUST_INCLUDE_DIR}") else() message(FATAL_ERROR "Faust include files not found, maybe you specified the wrong FAUST_INCLUDE_DIR directory? Otherwise try using the included Faust instead (INSTALLED_FAUST=OFF).")