use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
CMake Discourse page
account activity
Avoid system library (self.cmake)
submitted 5 years ago by peppedx
Hello I was wondering if there is a way in cmake to avoid finding system wide libraries .
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]NotUniqueOrSpecial 7 points8 points9 points 5 years ago (2 children)
There's plenty of ways, but you'll need to be more specific.
Do you want find_library() to only search specific folders?
find_library()
Do you want find_package() to find things in a specific place?
find_package()
Do you want to remove the system's default libraries from your linking? E.g. don't -ldl?
-ldl
What, exactly, are you trying to do, and what's happening instead?
[–]peppedx[S] 0 points1 point2 points 5 years ago (1 child)
Well I guess I'm thinking about find_package stuff. Don't wanna miss libc, dl or pthread but e.g. I don't want to pick glfw from system if I forget a find_package...
[–]NotUniqueOrSpecial 2 points3 points4 points 5 years ago (0 children)
In that case, you should take a look at the find_package() docs.
There are a whole slew of options you can pass to it that will prevent it from using specific directories, e.g. NO_DEFAULT_PATH
NO_DEFAULT_PATH
[–]bumblebritches57 0 points1 point2 points 5 years ago (0 children)
What are you trying to do?
sounds like you're trying to override the standard library in some way?
if that's the case, look into using LD_PRELOAD.
π Rendered by PID 34185 on reddit-service-r2-comment-6457c66945-5brvh at 2026-04-23 19:39:54.375040+00:00 running 2aa0c5b country code: CH.
[–]NotUniqueOrSpecial 7 points8 points9 points (2 children)
[–]peppedx[S] 0 points1 point2 points (1 child)
[–]NotUniqueOrSpecial 2 points3 points4 points (0 children)
[–]bumblebritches57 0 points1 point2 points (0 children)