# Could NOT find OpenCascade (missing: OPENCASCADE\_LIBRARIES)

**URL:** https://discourse.cmake.org/t/could-not-find-opencascade-missing-opencascade-libraries/3627
**Category:** Usage
**Created:** [June 25, 2021, 4:43pm UTC](https://discourse.cmake.org/t/could-not-find-opencascade-missing-opencascade-libraries/3627 "2021-06-25T16:43:39Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Marc\_Weber](https://discourse.cmake.org/user_avatar/discourse.cmake.org/marc_weber/32/1582_2.png) [@Marc\_Weber](https://discourse.cmake.org/u/Marc_Weber)
#### Post date: [June 25, 2021, 4:43pm UTC](https://discourse.cmake.org/t/could-not-find-opencascade-missing-opencascade-libraries/3627/1 "2021-06-25T16:43:39Z")

</div>

Hello, I am trying to compile OCP.

find\_package\_handle\_standard\_args( OpenCascade DEFAULT\_MSG OPENCASCADE\_LIBRARIES OPENCASCADE\_INCLUDE\_DIR )

I try using -DOPENCASCADE\_LIBRARIES= …  
but still I get the message.

With debugging everything etc I traced it down to:  
/nix/store/mb3idi3441q1f5zvvi47cix10dbafdjd-cmake-3.20.5/share/cmake-3.20/Modules/FindPackageHandleStandardArgs.cmake|488| if(NOT ${\_CURRENT\_VAR} )

The cache file contains:  
//No help, variable specified on the command line.  
OPENCASCADE\_LIBRARIES:UNINITIALIZED=/nix/store/m0fb47gw6naidy0zc9c6nsqd3y81h7n8-opencascade-occt-7.5.1

So it’s there ? I tried adding a type to the -D argument but failed. What am I missing ?

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [June 25, 2021, 4:56pm UTC](https://discourse.cmake.org/t/could-not-find-opencascade-missing-opencascade-libraries/3627/2 "2021-06-25T16:56:21Z")

</div>

The `LIBRARIES` variables are usually local variables built up from other cache variable entries, so if this is the case, the cache variable is being shadowed by the local version.

Either way, a directory is not what `_LIBRARIES` is meant to be; it should probably be a list of library file paths, so your approach is basically trying to subvert the intention of the module, but it’s not working 🙂 .

I would suggest adding `/nix/store/m0fb47gw6naidy0zc9c6nsqd3y81h7n8-opencascade-occt-7.5.1` to `CMAKE_PREFIX_PATH` either in the environment or to the cache variable (both work like `PATH`; the environment using `:` separators and the CMake variable using the `;` list separators). This is likely to work much better.
