Skip to content

Conversation

@karthikpoduval
Copy link

There is not way to install to a machine as build artifacts stayed in build folder, add such an option while also updating CMakeLists.txt to install to correct paths.

There is not way to install to a machine as build artifacts stayed in
build folder, add such an option while also updating CMakeLists.txt to
install to correct paths.
@CLAassistant
Copy link

CLAassistant commented Feb 17, 2024

CLA assistant check
All committers have signed the CLA.

@kiritigowda kiritigowda requested a review from Copilot May 23, 2025 20:32
@kiritigowda kiritigowda self-assigned this May 23, 2025
@kiritigowda kiritigowda added enhancement New feature or request Bug Fix labels May 23, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds a new --machine_install option to the build script to install artifacts to system-default locations and updates all sample and library CMake targets to use the standard CMAKE_INSTALL_BINDIR and CMAKE_INSTALL_LIBDIR variables.

  • Swapped hardcoded bin/lib destinations in many install() calls for ${CMAKE_INSTALL_BINDIR} and ${CMAKE_INSTALL_LIBDIR}.
  • Introduced --machine_install in Build.py to skip custom install prefixes and rely on CMake’s defaults.
  • Bumped cmake_minimum_required to 3.0.0 and changed several feature flags from ON to OFF by default.

Reviewed Changes

Copilot reviewed 27 out of 27 changed files in this pull request and generated 2 comments.

File Description
sample/**/CMakeLists.txt Updated install destinations to use ${CMAKE_INSTALL_BINDIR}/${CMAKE_INSTALL_LIBDIR}
CMakeLists.txt Increased minimum CMake version, added include changes, and toggled default options
Build.py Added --machine_install option and conditional prefix logic
Comments suppressed due to low confidence (3)

Build.py:168

  • Add automated tests or CI checks to cover the --machine_install code path, verifying that CMAKE_INSTALL_PREFIX is skipped and defaults to system paths when the flag is used.
if not options.machine_install:

CMakeLists.txt:21

  • Consider adding include(GNUInstallDirs) immediately after the cmake_minimum_required call to ensure CMAKE_INSTALL_BINDIR and CMAKE_INSTALL_LIBDIR are defined before use.
cmake_minimum_required(VERSION 3.0.0)

libraries/debug/CMakeLists.txt:50

  • [nitpick] Indentation here uses a mix of spaces/tabs. Align this line with the other install() arguments for consistent formatting.
          ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}

parser.add_option("--c_flags", dest="c_flags", help="Set C Compiler Flags -DCMAKE_C_FLAGS=" " [Default empty]", default='')
parser.add_option("--cpp_flags", dest="cpp_flags", help="Set CPP Compiler Flags -DCMAKE_CXX_FLAGS=" " [Default empty]", default='')
# machine install to /usr/local/.... paths
parser.add_option("--machine_install", dest="machine_install", help="Install to machine to preferred destination path", default=False, action='store_true')
Copy link

Copilot AI May 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the script’s help text or README to document the new --machine_install flag so users know how to invoke system-default installs.

Copilot uses AI. Check for mistakes.
)
set(CMAKE_CONFIGURATION_TYPES ${CMAKE_CONFIGURATION_TYPES} CACHE STRING "Available build configurations." FORCE)

# Default options for the CMake GUI
Copy link

Copilot AI May 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing several feature flags from ON to OFF by default is a breaking change; document these new defaults in the project README or release notes to inform users of the updated behavior.

Suggested change
# Default options for the CMake GUI
# Default options for the CMake GUI
# NOTE: If you change the default values of these feature flags, ensure that the changes are documented
# in the project's README or release notes to inform users of the updated behavior.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Fix enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants