{"id":13992409,"url":"https://github.com/mulle-nat/mulle-xcode-to-cmake","last_synced_at":"2026-01-18T12:25:14.450Z","repository":{"id":148907442,"uuid":"78289661","full_name":"mulle-nat/mulle-xcode-to-cmake","owner":"mulle-nat","description":"🎭 Convert Xcode projects to cmake CMakeLists.txt","archived":false,"fork":false,"pushed_at":"2023-09-11T15:30:59.000Z","size":170,"stargazers_count":118,"open_issues_count":2,"forks_count":18,"subscribers_count":7,"default_branch":"release","last_synced_at":"2024-08-10T14:10:07.966Z","etag":null,"topics":["cmake","cmakelists","converter","xcode","xcodeproj"],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mulle-nat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-01-07T16:22:08.000Z","updated_at":"2024-06-28T11:26:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"b129d449-0fa7-40f5-83b5-156e07a30bea","html_url":"https://github.com/mulle-nat/mulle-xcode-to-cmake","commit_stats":null,"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mulle-nat%2Fmulle-xcode-to-cmake","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mulle-nat%2Fmulle-xcode-to-cmake/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mulle-nat%2Fmulle-xcode-to-cmake/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mulle-nat%2Fmulle-xcode-to-cmake/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mulle-nat","download_url":"https://codeload.github.com/mulle-nat/mulle-xcode-to-cmake/tar.gz/refs/heads/release","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227133794,"owners_count":17735808,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cmake","cmakelists","converter","xcode","xcodeproj"],"created_at":"2024-08-09T14:01:58.948Z","updated_at":"2026-01-18T12:25:14.393Z","avatar_url":"https://github.com/mulle-nat.png","language":"Objective-C","funding_links":[],"categories":["Objective-C"],"sub_categories":[],"readme":"# mulle-xcode-to-cmake\n\nA little tool to convert [Xcode](https://developer.apple.com/xcode/) projects\nto [cmake](https://cmake.org/) CMakeLists.txt.\n\nYou can specify the target to export. If you don't specify a target, all\ntargets are exported.\nIt doesn't do a perfect job, but it's better than doing it all by hand.\nIt can convert most targets, but it will do better with libraries and tools or\nframeworks.\n\n\u003e This is useful for \"one-shot\" conversions. For continous conversions from\n\u003e Xcode to cmake, use [mulle-sde](https://github.com/mulle-sde/mulle-sde).\n\n\n|  Build Status | Version\n|---------------|-----------------------------------\n| [![CI](https://github.com/mulle-nat/mulle-xcode-to-cmake/actions/workflows/mulle-sde-ci.yml/badge.svg?branch=release)](https://github.com/mulle-nat/mulle-xcode-to-cmake/actions/workflows/mulle-sde-ci.yml) | ![Mulle kybernetiK tag](https://img.shields.io/github/tag/mulle-nat/mulle-xcode-to-cmake.svg) \n\n\n## Install\n\n\n### MacOS : Apple\n\nUse the [homebrew](//brew.sh) package manager to install it, or build\nit yourself with Xcode:\n\n```\nbrew install mulle-kybernetik/software/mulle-xcode-to-cmake\n```\n\n\n## Build\n\n\n### MacOS / Linux / FreeBSD : mulle-objc\n\nGet [foundation-developer](//github.com/MulleFoundation/foundation-developer)\ninstalled and then build **mulle-xcode-to-cmake** with:\n\n```\nmulle-sde clean cache\nmulle-sde craft --release\nmulle-sde run mulle-make install --prefix /usr/local/bin\n```\n\n### Windows / Linux : GNUstep\n\nIt is also possible to build with GNUstep using **cmake** and the\n`CMakeLists.txt` file generated by **mulle-xcode-to-cmake** itself. After\nchecking out the sources, change into the source directory and then:\n\n```\nmkdir build \u0026\u0026 cd build\ncmake -Wno-dev ..\nmake\nsudo make install\n```\n\nOn Mac this should work without installing any additional dependencies. On other\nplatforms it is suggested to install a recent clang version (5 or later) and you\nwill need libobjc and the gnustep-base developer package, both from GNUstep\n(or another implementation of the ObjC runtime and the Foundation library).\n\nOn Windows, it is a bit tricky : please refer to this little guide [here](https://github.com/ElMostafaIdrassi/mulle-xcode-to-cmake/blob/release/BUILD-GNUSTEP-WINDOWS.md)\n\n\n## Usage\n\n```\nusage: mulle-xcode-to-cmake [options] \u003ccommands\u003e \u003cfile.xcodeproj\u003e\n\nOptions:\n   -2          : CMakeLists.txt includes CMakeSourcesAndHeaders.txt\n   -a          : always prefix cmake variables with target\n   -b          : suppress boilerplate definitions\n   -d          : create static and shared library\n   -f          : suppress Foundation (implicitly added)\n   -i          : print global include_directories\n   -l \u003clang\u003e   : specify project language (c,c++,objc) (default: objc)\n   -n          : suppress find_library trace\n   -p          : suppress project\n   -P \u003cprefix\u003e : prefix filepaths\n   -r          : suppress reminder, what generated this file\n   -s \u003csuffix\u003e : create standalone test library (framework/shared)\n   -t \u003ctarget\u003e : target to export\n   -u          : add UIKIt\n   -w \u003cname\u003e   : add weight to name for sorting\n\nCommands:\n   export      : export CMakeLists.txt to stdout\n   list        : list targets\n   sexport     : export CMakeSourcesAndHeaders.txt to stdout\n\nEnvironment:\n   VERBOSE     : dump some info to stderr\n```\n\n### Examples\n\nList all project targets:\n\n```console\n$ mulle-xcode-to-cmake list mulle-xcode-to-cmake.xcodeproj\nmulle-xcode-to-cmake\nmullepbx\n```\n\nCreate \"CMakeLists.txt\" for target `mullepbx` leaving out some\nboilerplate template code. Invoking `mulle-xcode-to-cmake -b export mulle-xcode-to-cmake.xcodeproj` yields:\n\n```console\n# Generated by mulle-xcode-to-cmake [2017-2-21 18:16:4]\n\nproject( mulle-xcode-to-cmake)\n\ncmake_minimum_required (VERSION 3.4)\n\n\n##\n## mulle-xcode-to-cmake Files\n##\n\nset( MULLE_XCODE_TO_CMAKE_SOURCES\nsrc/mulle-xcode-to-cmake/NSArray+Path.m\nsrc/mulle-xcode-to-cmake/NSString+ExternalName.m\nsrc/mulle-xcode-to-cmake/PBXHeadersBuildPhase+Export.m\nsrc/mulle-xcode-to-cmake/PBXPathObject+HierarchyAndPaths.m\nsrc/mulle-xcode-to-cmake/main.m\n)\n\nfind_library( MULLEPBX_LIBRARY mullepbx)\nmessage( STATUS \"MULLEPBX_LIBRARY is ${MULLEPBX_LIBRARY}\")\n\nset( MULLE_XCODE_TO_CMAKE_STATIC_DEPENDENCIES\n${MULLEPBX_LIBRARY}\n)\n\nfind_library( FOUNDATION_LIBRARY Foundation)\nmessage( STATUS \"FOUNDATION_LIBRARY is ${FOUNDATION_LIBRARY}\")\n\nset( MULLE_XCODE_TO_CMAKE_DEPENDENCIES\n${FOUNDATION_LIBRARY}\n)\n\n\n##\n## mullepbx Files\n##\n\nset( MULLEPBX_PUBLIC_HEADERS\nsrc/PBXReading/MullePBXUnarchiver.h\nsrc/PBXReading/PBXObject.h\nsrc/PBXWriting/MullePBXArchiver.h\nsrc/PBXWriting/PBXObject+PBXEncoding.h\n)\n\nset( MULLEPBX_PROJECT_HEADERS\n)\n\nset( MULLEPBX_PRIVATE_HEADERS\nsrc/PBXReading/NSObject+DecodeWithObjectStorage.h\nsrc/PBXReading/NSString+KeyFromSetterSelector.h\nsrc/PBXReading/NSString+LeadingDotExpansion.h\nsrc/PBXReading/PBXProjectProxy.h\nsrc/PBXWriting/MulleSortedKeyDictionary.h\n)\n\nset( MULLEPBX_SOURCES\nsrc/PBXReading/MullePBXUnarchiver.m\nsrc/PBXReading/NSObject+DecodeWithObjectStorage.m\nsrc/PBXReading/NSString+KeyFromSetterSelector.m\nsrc/PBXReading/NSString+LeadingDotExpansion.m\nsrc/PBXReading/PBXObject.m\nsrc/PBXReading/PBXProjectProxy.m\nsrc/PBXWriting/MullePBXArchiver.m\nsrc/PBXWriting/MulleSortedKeyDictionary.m\nsrc/PBXWriting/PBXObject+PBXEncoding.m\n)\n\n\n##\n## mulle-xcode-to-cmake\n##\n\nadd_executable( mulle-xcode-to-cmake MACOSX_BUNDLE\n${MULLE_XCODE_TO_CMAKE_SOURCES}\n${MULLE_XCODE_TO_CMAKE_PUBLIC_HEADERS}\n${MULLE_XCODE_TO_CMAKE_PROJECT_HEADERS}\n${MULLE_XCODE_TO_CMAKE_PRIVATE_HEADERS}\n${MULLE_XCODE_TO_CMAKE_RESOURCES}\n)\n\ntarget_include_directories( mulle-xcode-to-cmake\n   PUBLIC\n      src/PBXReading\n      src/PBXWriting\n)\n\nadd_dependencies( mulle-xcode-to-cmake mullepbx)\n\ntarget_link_libraries( mulle-xcode-to-cmake\n${MULLE_XCODE_TO_CMAKE_STATIC_DEPENDENCIES}\n${MULLE_XCODE_TO_CMAKE_DEPENDENCIES}\n)\n\n\n##\n## mullepbx\n##\n\nadd_library( mullepbx STATIC\n${MULLEPBX_SOURCES}\n${MULLEPBX_PUBLIC_HEADERS}\n${MULLEPBX_PROJECT_HEADERS}\n${MULLEPBX_PRIVATE_HEADERS}\n${MULLEPBX_RESOURCES}\n)\n\ntarget_include_directories( mullepbx\n   PUBLIC\n      src/PBXReading\n      src/PBXWriting\n)\n\ninstall( TARGETS mullepbx DESTINATION \"lib\")\ninstall( FILES ${MULLEPBX_PUBLIC_HEADERS} DESTINATION \"include/mullepbx\")\n```\n\nYou have your own `CMakeLists.txt` template and just want to `include()`\nthe list of sources as they change in the Xcode project:\n\n`mulle-xcode-to-cmake sexport mulle-xcode-to-cmake.xcodeproj` yields:\n\n```console\n##\n## mulle-xcode-to-cmake Files\n##\n\nset( MULLE_XCODE_TO_CMAKE_SOURCES\nsrc/mulle-xcode-to-cmake/NSArray+Path.m\nsrc/mulle-xcode-to-cmake/NSString+ExternalName.m\nsrc/mulle-xcode-to-cmake/PBXHeadersBuildPhase+Export.m\nsrc/mulle-xcode-to-cmake/PBXPathObject+HierarchyAndPaths.m\nsrc/mulle-xcode-to-cmake/main.m\n)\n\n\n##\n## mullepbx Files\n##\n\nset( MULLEPBX_PUBLIC_HEADERS\nsrc/PBXReading/MullePBXUnarchiver.h\nsrc/PBXReading/PBXObject.h\nsrc/PBXWriting/MullePBXArchiver.h\nsrc/PBXWriting/PBXObject+PBXEncoding.h\n)\n\nset( MULLEPBX_SOURCES\nsrc/PBXReading/MullePBXUnarchiver.m\nsrc/PBXReading/NSObject+DecodeWithObjectStorage.m\nsrc/PBXReading/NSString+KeyFromSetterSelector.m\nsrc/PBXReading/NSString+LeadingDotExpansion.m\nsrc/PBXReading/PBXObject.m\nsrc/PBXReading/PBXProjectProxy.m\nsrc/PBXWriting/MullePBXArchiver.m\nsrc/PBXWriting/MulleSortedKeyDictionary.m\nsrc/PBXWriting/PBXObject+PBXEncoding.m\n)\n```\n\n### History\n\nThis is basically a stripped down version of `mulle_xcode_utility`.\n\nSee the [RELEASENOTES.md](RELEASENOTES.md) for what has changed.\n\n\n\n### Author\n\nCoded by Nat!\n\n\n### Contributors\n\n[Contributors](https://github.com/mulle-nat/mulle-xcode-to-cmake/graphs/contributors)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmulle-nat%2Fmulle-xcode-to-cmake","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmulle-nat%2Fmulle-xcode-to-cmake","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmulle-nat%2Fmulle-xcode-to-cmake/lists"}