Skip to content

Avoid installing the library in a hard-coded folder in the root of the cmake project? #31

@JeroenDM

Description

@JeroenDM

Hello! This is more of a question than an issue.

I'm using the library through the CPM "package manager". The static library is installed in a lib folder in the root of my project because of this line:

set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/lib)

Could it make sense to use ${CMAKE_BINARY_DIR} instead of ${CMAKE_SOURCE_DIR}. This gives a library user more control over where the library is installed I think.

Of course adding the lib/ folder to my .gitignore file also solves my problem.

I'm not sure what the cmake best practice is here. Maybe there even is yet an other option that is even better.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions