sequential-line-search icon indicating copy to clipboard operation
sequential-line-search copied to clipboard

CMake error in Xcode project generation

Open yuki-koyama opened this issue 3 years ago • 0 comments

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

yuki-koyama avatar Feb 13 '22 03:02 yuki-koyama