# Building Slicer from /opt directory reports "permission denied" error

**URL:** <https://discourse.slicer.org/t/building-slicer-from-opt-directory-reports-permission-denied-error/41352>\
**Category:** Development\
**Tags:** build\
**Created:** [January 29, 2025, 12:00pm UTC](https://discourse.slicer.org/t/building-slicer-from-opt-directory-reports-permission-denied-error/41352 "2025-01-29T12:00:27Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![ferhue](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ferhue/32/82557_2.png) [@ferhue](https://discourse.slicer.org/u/ferhue)\
**Post date:** [January 29, 2025, 12:48pm UTC](https://discourse.slicer.org/t/building-slicer-from-opt-directory-reports-permission-denied-error/41352/5 "2025-01-29T12:48:11Z")

</div>

Thanks a lot for the swift clarification!

As a suggestion, since it’s not overly common that the build dir interacts with the source dir, may I suggest the following (pseudocode) improvement in the main CMakeLists, to inform the user about the error more easily/quickly? So that error happens right away, not after x hours and in the middle of the log.

```auto
if(CMAKE_VERSION VERSION_GREATER "3.21.0") 
   file(COPY_FILE ${CMAKE_SOURCE_DIR}/README.md ${CMAKE_SOURCE_DIR}/Utilities/Scripts/SlicerWizard/.tmp_txt RESULT result)
   if(NOT result)
      message(ERROR "You need write permissions in the source dir")
   endif()
endif()

```

Thanks again!

PS: This would also help with: [Variable Slicer\_WC\_LAST\_CHANGED\_DATE is expected to be defined - #9 by miniminic](https://discourse.slicer.org/t/variable-slicer-wc-last-changed-date-is-expected-to-be-defined/25389/9)

---

_[View the full topic](https://discourse.slicer.org/t/building-slicer-from-opt-directory-reports-permission-denied-error/41352)._
