How to set newbuild system of xcode in cmake?

1k Views Asked by At

Am trying to upgrade my project to new build system. I have to set the -UseModernBuildSystem=YES in the cmakelists.txt file. How can I do that? My project is builded using the terminal

1

There are 1 best solutions below

0
sandroid On

Problem is here

  if (this->XcodeVersion >= 100) {
    xout.Element("key", "BuildSystemType");
    xout.Element("string", "Original");
    xout.Element("key", "DisableBuildSystemDeprecationWarning");
    xout.Element("true");
  }

This should be configurable in CMake

Had to find a work-around and this worked for me

# use the new build system
set(WORKSPACE_FILE project.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings)
message("Deleting workspace file: ${WORKSPACE_FILE}")
execute_process(COMMAND ${CMAKE_COMMAND} -E remove ${WORKSPACE_FILE}
                INPUT_FILE ${WORKSPACE_FILE})