csound / plugins

Repository for Csound plugins which were originally in the main repository, and for new plugins as well.
GNU Lesser General Public License v2.1
11 stars 11 forks source link

CMake Error at src/widgets/CMakeLists.txt:22 (target_link_libraries): #22

Closed jwaldmann closed 9 months ago

jwaldmann commented 9 months ago

I am trying to build csound-plugins for csound-6.18.1, and get

cmake ../csound-plugins -DCMAKE_INSTALL_PREFIX=/opt/csound/csound
-6.18.1 -DCSOUND_INCLUDE_DIR=/opt/csound/csound-6.18.1/include/csound -DUSE_FLTK=ON

...

-- USE_FLTK is enabled.
CMake Error at src/widgets/CMakeLists.txt:22 (target_link_libraries):
  The keyword signature for target_link_libraries has already been used with
  the target "widgets".  All uses of target_link_libraries with a target must
  be either all-keyword or all-plain.

  The uses of the keyword signature are here:

   * CMakeLists.txt:236 (target_link_libraries)

CMake Error at src/widgets/CMakeLists.txt:46 (target_link_libraries):
  The keyword signature for target_link_libraries has already been used with
  the target "virtual".  All uses of target_link_libraries with a target must
  be either all-keyword or all-plain.

  The uses of the keyword signature are here:

   * CMakeLists.txt:236 (target_link_libraries)

...
-- BUILD_P5GLOVE_OPCODES is disabled.        
-- BUILD_JACK_OPCODES is enabled.
-- BUILD_FLUID_OPCODES is enabled.             
-- Configuring incomplete, errors occurred!

I am using ca4e7a8d9904306c754bfde5e0d8d483c9f28f04 , and cmake version 3.25.1.

The above does NOT happen for master 27274a520ea9774d56185e36b4a3010ad8ae350e (cmake, make, make install all run but in the end, csound does not find the plugins)

jwaldmann commented 9 months ago

this seems to repair it (add PRIVATE)

diff --git a/src/widgets/CMakeLists.txt b/src/widgets/CMakeLists.txt
index fd30afd..7d441cf 100644
--- a/src/widgets/CMakeLists.txt
+++ b/src/widgets/CMakeLists.txt
@@ -19,7 +19,7 @@ if(USE_FLTK)
     if(USE_VCPKG)
         target_link_libraries(widgets PRIVATE fltk fltk_gl fltk_forms fltk_images)
     else()
-        target_link_libraries(widgets
+        target_link_libraries(widgets PRIVATE
             ${FLTK_BASE_LIBRARY} ${FLTK_FORMS_LIBRARY} ${FLTK_IMAGES_LIBRARY}
         )
     endif()
@@ -43,8 +43,8 @@ if(USE_FLTK)
     if (USE_VCPKG)
         target_link_libraries(virtual PRIVATE fltk fltk_gl fltk_forms fltk_images)
     else()
-        target_link_libraries(virtual
+        target_link_libraries(virtual PRIVATE
             ${FLTK_BASE_LIBRARY} ${FLTK_FORMS_LIBRARY} ${FLTK_IMAGES_LIBRARY}
         )
     endif()
-endif()
\ No newline at end of file
+endif()
stekyne commented 9 months ago

Maybe open a PR for this and I can merge it?