Skip to content
View Harikrish-rrk's full-sized avatar
💭
Working on projects
💭
Working on projects

Block or report Harikrish-rrk

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Please don't include any personal information such as legal names or email addresses. Maximum 100 characters, markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
Harikrish-rrk/README.md

Hi there 👋

Here are some common CMake CLI (Command Line Interface) commands used in typical workflows:

1. Generate Build Files

Generate build files using a CMake generator (e.g., Makefile, Ninja, Visual Studio):

cmake -S <source_directory> -B <build_directory> -G <generator_name> -S: Specify the source directory containing the CMakeLists.txt. -B: Specify the build directory where the build files will be generated. -G: Specify the generator (e.g., "Unix Makefiles", "Ninja", "Visual Studio 16 2019"). Example:

cmake -S . -B build -G "Unix Makefiles"

2. Configure a Project

Set CMake variables during configuration:

cmake -S <source_directory> -B <build_directory> -D<variable>=<value> -D<variable>=<value>:

Define a CMake variable. You can define multiple variables by adding more -D flags. Example:

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON

3. Build a Project

Build the project after configuration:

cmake --build <build_directory> --target <target_name> --config <configuration> --target: Specify a particular target to build (optional). --config: Specify the build configuration (e.g., Debug, Release).

Example:

cmake --build build --config Release

4. Install the Project

Install the build outputs to a specified directory:

cmake --install <build_directory> --prefix <install_directory>

Example:

cmake --install build --prefix /usr/local

5. Run Tests

Run tests after building the project:

ctest --test-dir <build_directory> --output-on-failure --output-on-failure: Shows test output if a test fails. Example:

ctest --test-dir build --output-on-failure

6. Clean the Build Directory

Remove build artifacts:

cmake --build <build_directory> --target clean

Example:

cmake --build build --target clean

7. Package the Project

Create a package (e.g., .tar.gz, .zip) from the build artifacts:

cpack --config <package_configuration_file>

Example: cpack --config CPackConfig.cmake These commands help manage a CMake-based project through the command line, from generation and building to testing and packaging.

Pinned Loading

  1. dscvitchennai dscvitchennai Public

    Forked from dscvitc/dscvitchennai

    GDSC VIT Chennai Official website

    JavaScript

  2. Netflix_Analysis_Flask_Application_Tableau Netflix_Analysis_Flask_Application_Tableau Public

    Please Refer README.md File. Also note that the project directory named "Netflix" is renamed to "Netflix_Flask_Application" for ease of understanding.

    Jupyter Notebook 3

  3. nasa-clone nasa-clone Public

    Forked from jaydeepdey03/nasa-clone

    An informative landing page, depicting the accomplishments of NASA, in a fun and innovative manner

    JavaScript

  4. Recipie-Page Recipie-Page Public

    HTML

  5. VR-website VR-website Public

    Forked from jaydeepdey03/VR-website

    Website to display all kind of VR Models available, with description of their features and a link to buy

    JavaScript

  6. youtube-clone youtube-clone Public

    Forked from jaydeepdey03/youtube-clone

    Cloning Youtube

    HTML