Skip to content

Modify LSLCMake.cmake install-helper functions to accept COMPONENT argument #264

Description

@cboulay

Using LSLCMake.cmake's LSL_install_xyz helper functions will result in an extra installation steps for Unknown components. We can modify the function to accept an argument so the user can optionally specify a component.

function(LSL_install_liblsl)
      cmake_parse_arguments(ARG "" "DESTINATION;FRAMEWORK_DESTINATION;COMPONENT" "" ${ARGN})

      # Build the optional COMPONENT argument list
      set(_component_args "")
      if(ARG_COMPONENT)
          set(_component_args COMPONENT ${ARG_COMPONENT})
      endif()

      if(APPLE)
          # ...
          install(CODE "..." ${_component_args})
      elseif(WIN32)
          if(_lsl_is_fetched)
              install(TARGETS lsl RUNTIME DESTINATION "${ARG_DESTINATION}" ${_component_args})
          else()
              install(IMPORTED_RUNTIME_ARTIFACTS LSL::lsl RUNTIME DESTINATION "${ARG_DESTINATION}" ${_component_args})
          endif()
      else()
          # Linux — same pattern
      endif()
  endfunction()

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions