{"id":20834526,"url":"https://github.com/apriorit/findwix","last_synced_at":"2026-03-14T21:10:47.378Z","repository":{"id":145107368,"uuid":"135570673","full_name":"apriorit/FindWiX","owner":"apriorit","description":"CMake module for building Windows Installer packages with WiX toolset","archived":false,"fork":false,"pushed_at":"2022-10-31T22:10:16.000Z","size":18,"stargazers_count":18,"open_issues_count":0,"forks_count":5,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-01-18T21:31:50.890Z","etag":null,"topics":["cmake","cmake-module","installer","wix","wix-toolset"],"latest_commit_sha":null,"homepage":"","language":"CMake","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apriorit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-31T10:44:46.000Z","updated_at":"2024-02-22T14:55:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"a8bb5f02-f983-4ce8-84ab-b0c2397beba3","html_url":"https://github.com/apriorit/FindWiX","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apriorit%2FFindWiX","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apriorit%2FFindWiX/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apriorit%2FFindWiX/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apriorit%2FFindWiX/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apriorit","download_url":"https://codeload.github.com/apriorit/FindWiX/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243188199,"owners_count":20250453,"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","cmake-module","installer","wix","wix-toolset"],"created_at":"2024-11-18T00:19:33.578Z","updated_at":"2025-12-24T21:53:04.267Z","avatar_url":"https://github.com/apriorit.png","language":"CMake","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FindWiX [![Build status](https://ci.appveyor.com/api/projects/status/ixogwlydnlf0vl2b?svg=true)](https://ci.appveyor.com/project/apriorit/findwix)\n\n[CMake](https://cmake.org) module for building [Windows Installer](https://en.wikipedia.org/wiki/Windows_Installer) packages with [WiX toolset](http://wixtoolset.org)\n* [Introduction](#introduction)\n  * [Requirements](#requirements)\n* [Usage](#usage)\n  * [find_package()](#find_package)\n  * [wix_add_project()](#wix_add_project)\n  * [WiX compile and link flags](#wix-compile-and-link-flags)\n  * [CMake variables in WiX](#cmake-variables-in-wix)\n  * [CMake project dependencies in WiX](#cmake-project-dependencies-in-wix)\n* [Samples](#samples) \n* [License](#license) \n* [Version History](#version-history)\n\n# Introduction\nA native solution for building [Windows Installer](https://en.wikipedia.org/wiki/Windows_Installer) packages in [CMake](https://cmake.org) is [CPack](https://cmake.org/cmake/help/v3.0/module/CPack.html). However it has several drawbacks:\n- limited to one installer project (cannot created several installers, for example `client.msi` and `server.msi`)\n- cannot directly work with `wsx` files (hard to convert existings installer source code to [CMake](https://cmake.org))\n\n[FindWiX](https://github.com/apriorit/FindWiX) comes to rescue in such cases.\n\n## Requirements\n- [CMake 3.0](https://cmake.org/download/) or higher\n- [WiX toolset 3.0](http://wixtoolset.org/releases/) or higher\n\n# Usage\n## find_package()\nAdd [FindWiX](https://github.com/apriorit/FindWiX) to the module search path and call `find_package`:\n```cmake\nlist(APPEND CMAKE_MODULE_PATH \"${CMAKE_CURRENT_LIST_DIR}/cmake\")\nfind_package(WIX REQUIRED)\n```\n[FindWiX](https://github.com/apriorit/FindWiX) will search for the installed [WiX toolset](http://wixtoolset.org), expose functions for creating installer packages and define the following variables:\n- `WIX_FOUND` - if false [WiX toolset](http://wixtoolset.org) is absent\n- `WIX_ROOT` - path where [WiX toolset](http://wixtoolset.org) is installed\n- `WIX_COMPILE_FLAGS` - flags to be used when compiling `wxs` source files\n- `WIX_LINK_FLAGS` - flags to be used when linking `wixobj` files\n\n## wix_add_project()\nThis function creates a new target for WiX project. It compiles one or several `wsx` files to `wixobj` files and then links them together into the resulting `msi` file.\n\n```cmake\nwix_add_project(\u003cname\u003e\n    source1 [source2 ...]\n    [OUTPUT_NAME \u003cmsi_file_name\u003e]\n    [EXTENSIONS extension1 [extension2...]]\n    [DEPENDS target1 [target2...]])\n```\n\nWhere:\n- `\u003cname\u003e` - name of the project target\n- `source1 [source2 ...]` - one or several `wsx` files\n- `OUTPUT_NAME` - allows to set a name for the resulting `msi` file, if omitted the name is set to `\u003cname\u003e`\n- `EXTENSIONS` - add one or more WiX extensions (for example `WixUIExtension`)\n- `DEPENDS` - add project dependencies for the correct build order\n  \nExample:\n```cmake\nwix_add_project(my_project \n    main.wxs one_more.wxs \n    OUTPUT_NAME \"NameSample\" \n    EXTENSIONS WixUIExtension WixUtilExtension\n    DEPENDS CppExecutable)\n```\n\n## WiX compile and link flags\nYou could do some fine tuning, for example treat warnings as errors:\n```cmake\nset(WIX_COMPILE_FLAGS ${WIX_COMPILE_FLAGS} -wx)\nset(WIX_LINK_FLAGS ${WIX_LINK_FLAGS} -wx)\n```\n\n## CMake variables in WiX\n[FindWiX](https://github.com/apriorit/FindWiX) generates `vars.wxi` to make [CMake](https://cmake.org) variables available in WiX. Here is a fragment of `vars.wxi`:\n```xml\n\u003c?xml version='1.0' encoding='UTF-8'?\u003e\n\u003cInclude\u003e\n    \u003c?define ARGC='4' ?\u003e\n    \u003c?define ARGN='Main.wxs;DEPENDS;CppExecutable' ?\u003e\n    \u003c?define ARGV='WithExecutable;Main.wxs;DEPENDS;CppExecutable' ?\u003e\n    \u003c?define ARGV0='WithExecutable' ?\u003e\n    \u003c?define ARGV1='Main.wxs' ?\u003e\n    \u003c?define ARGV2='DEPENDS' ?\u003e\n    \u003c?define ARGV3='CppExecutable' ?\u003e\n    \u003c?define CMAKE_AR='' ?\u003e\n    \u003c?define CMAKE_AUTOMOC_COMPILER_PREDEFINES='ON' ?\u003e\n    \u003c?define CMAKE_AUTOMOC_MACRO_NAMES='Q_OBJECT;Q_GADGET;Q_NAMESPACE' ?\u003e\n    ...\n\u003c/Include\u003e\n```\nTo get access to those variables include `vars.wxi` into your `wxs` file:\n```xml\n\u003c?include vars.wxi?\u003e \u003c!--cmake variables and their values--\u003e\n```\n\n## CMake project dependencies in WiX\nAlso [FindWiX](https://github.com/apriorit/FindWiX) generates `depends.wxi` with file paths to [CMake](https://cmake.org) project dependencies. Here is a fragment of `depends.wxi`:\n```xml\n\u003c?xml version='1.0' encoding='UTF-8'?\u003e\n\u003cInclude\u003e\n    \u003c?define TARGET_FILE:CppExecutable='C:/my_proj/WithExecutable/Debug/CppExecutable.exe' ?\u003e\n    \u003c?define TARGET_PDB_FILE:CppExecutable='C:/my_proj/WithExecutable/Debug/CppExecutable.pdb' ?\u003e\n    ...\n\u003c/Include\u003e\n```\nTo get access to those variables include `depends.wxi` into your `wxs` file:\n```xml\n\u003c?include depends.wxi?\u003e \u003c!--paths to cmake dependencies--\u003e\n```\n\n# Samples \nTake a look at the [samples](samples/) folder to see how to use [FindWiX](https://github.com/apriorit/FindWiX).\n\n# License\n[Apriorit](http://www.apriorit.com/) released [FindWiX](https://github.com/apriorit/FindWiX) under the OSI-approved 3-clause BSD license. You can freely use it in your commercial or opensource software.\n\n# Version History\n\n## Version 1.0.0 (20 Sep 2018)\n- Initial public release","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapriorit%2Ffindwix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapriorit%2Ffindwix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapriorit%2Ffindwix/lists"}