Skip to content

Commit ff29c77

Browse files
committed
Add the necessary machinery to grab the Faust library files from the installed Faust when linking against an installed Faust version.
1 parent c4377db commit ff29c77

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

CMakeLists.txt

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,23 @@ else()
8181
endif()
8282

8383
message(STATUS "Installation goes to CMAKE_INSTALL_PREFIX/${INSTALL_DIR}")
84+
message(STATUS "(set the INSTALL_DIR variable to override)")
8485

85-
file(GLOB lib_files ${PROJECT_SOURCE_DIR}/faust/libraries/*.lib ${PROJECT_SOURCE_DIR}/faust/libraries/old/*.lib)
86+
if(INSTALLED_FAUST)
87+
## Grab the .lib files from the installed Faust using the FAUSTLIB path,
88+
## /usr/share/faust by default. You can adjust this path if needed by
89+
## setting the FAUSTLIB variable accordingly.
90+
find_path(FAUSTLIB all.lib PATH_SUFFIXES faust share/faust)
91+
if(NOT FAUSTLIB)
92+
set(FAUSTLIB "/usr/share/faust")
93+
message(WARNING "Faust library files not found, assuming ${FAUSTLIB} (set the FAUSTLIB variable to override)")
94+
else()
95+
message(STATUS "Faust library files found at ${FAUSTLIB}")
96+
message(STATUS "(set the FAUSTLIB variable to override)")
97+
endif()
98+
file(GLOB lib_files ${FAUSTLIB}/*.lib)
99+
else()
100+
file(GLOB lib_files ${PROJECT_SOURCE_DIR}/faust/libraries/*.lib ${PROJECT_SOURCE_DIR}/faust/libraries/old/*.lib)
101+
endif()
86102
install(DIRECTORY external/ DESTINATION ${INSTALL_DIR})
87103
install(FILES ${lib_files} DESTINATION ${INSTALL_DIR}/libs)

0 commit comments

Comments
 (0)