Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6094391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:40:21+00:00 2026-05-23T12:40:21+00:00

I have a CMake project that generates a library. I have written a CMake

  • 0

I have a CMake project that generates a library. I have written a CMake script, FindXXX.cmake, to help users of my library. This way they can use find_package(XXX) and get the variables needed. So far so good.

The problem now is that users have copied this FindXXX.cmake into their own projects. If I modify it, they will just stick with the former one.

Is there a common way to distribute such a script? Should my installer put it in some special location so that CMake finds it without having users copying it in their project?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T12:40:21+00:00Added an answer on May 23, 2026 at 12:40 pm

    Try to copy to ${CMAKE_ROOT}/Modules. You may need system administrator rights.

    Another solution could be add some registry entry on Windows: HKEY_CURRENT_USER\Software\Kitware\CMakeSetup\Settings\StartPath. You should add the next WhereBuild{i} value to your project CMake files. The trick here is that the CMake search for known libraries from the previously-used libraries.

    Based on the suggested documentation:

    You should create the following library and copy FindProjectName.cmake:
    C:\Program Files\ProjectName\CMake on Windows, /usr/local/ProjectName/share/cmake on Linux.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a project that generates a shell script at CMake time (with file(WRITE
I have a project that builds with CMake system, and I like to import
I have a precompiled library that I have to make visible to my Cmake
I have a project that is build with cmake. In my cmakelists I have
I do have a simple cmake project (on linux) that loads some libraries from
I used CMAKE to create the Visual Studios C++ project for a library that
Possible Duplicate: cmake is not working in opencv c++ project I have a huge
I am using CMake to build my project and I have the following line:
I have two cmake-related problems: first, I can't make it to find the includes
I have a project in Visual 2005 generated using CMake, and everytime I press

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.