sequential-line-search
sequential-line-search copied to clipboard
CMake error in Xcode project generation
Problem
When generating an Xcode project file by
cmake -G Xcode /path/to/repository
we get the following error seemingly caused by nlopt:
CMake Error in external/nlopt/CMakeLists.txt:
The custom command generating
/path/to/build/external/nlopt/nlopt.f
is attached to multiple targets:
generate-fortran
nlopt
but none of these is a common dependency of the other(s). This is not
allowed by the Xcode "new build system".
A Tentative Solution
The error can be avoided by using a legacy setting specified by -T buildsystem=1. That is,
cmake -G Xcode -T buildsystem=1 /path/to/repository
Reference: https://stackoverflow.com/a/65474688