# Add\_subdirectory() fails with ‘-features=no%anachronisms’

**URL:** <https://discourse.slicer.org/t/add-subdirectory-fails-with-features-no-anachronisms/20395>\
**Category:** Development\
**Tags:** cmake\
**Created:** [October 27, 2021, 10:34pm UTC](https://discourse.slicer.org/t/add-subdirectory-fails-with-features-no-anachronisms/20395 "2021-10-27T22:34:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![joachim](https://avatars.discourse-cdn.com/v4/letter/j/a87d85/32.png) [@joachim](https://discourse.slicer.org/u/joachim)\
**Post date:** [October 27, 2021, 10:34pm UTC](https://discourse.slicer.org/t/add-subdirectory-fails-with-features-no-anachronisms/20395/1 "2021-10-27T22:34:52Z")

</div>

I started working on my own loadable module based on _Extension Wizard_. My module has a subfolder containing [a library](https://github.com/libusb/hidapi) that my module depends on. This library is a CMake project. But in my module’s `CMakeLists.txt`, the line `add_subdirectory( path-to-library )` fails during cmake:

```auto
Determining if the CXX compiler accepts the flag -features=no%anachronisms passed with the following output:
Change Dir: /opt/e/SlicerNDOF-debug/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make cmTC_27b52/fast && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_27b52.dir/build.make CMakeFiles/cmTC_27b52.dir/build
Building CXX object CMakeFiles/cmTC_27b52.dir/src.cxx.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -features=no%anachronisms -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -mmacosx-version-min=10.15 -std=c++11 -o CMakeFiles/cmTC_27b52.dir/src.cxx.o -c /opt/e/SlicerNDOF-debug/CMakeFiles/CMakeTmp/src.cxx
clang: error: unknown argument: '-features=no%anachronisms'
make[1]: *** [CMakeFiles/cmTC_27b52.dir/src.cxx.o] Error 1
make: *** [cmTC_27b52/fast] Error 2

Source file was:
int main() { return 0;}

```

This compiler check seems to be [something that the Slicer build introduces](https://github.com/Slicer/Slicer/blob/955326ccbd0a7855a776a4da9d458f24fc2306f3/CMake/ITKPlatformSpecificChecks.cmake#L115) (?) and something that my library’s cmake doesn’t like. The library builds with no problem on its own.

Do you know how to fix this?
