Skip to content

CMake Improvements#1551

Open
theoparis wants to merge 1 commit into
luau-lang:masterfrom
theoparis:theoparis/add-install-target
Open

CMake Improvements#1551
theoparis wants to merge 1 commit into
luau-lang:masterfrom
theoparis:theoparis/add-install-target

Conversation

@theoparis
Copy link
Copy Markdown

@theoparis theoparis commented Nov 30, 2024

I added a cmake install target that installs the libraries, headers and the CLI binaries to CMAKE_INSTALL_PREFIX.

This is how I built and installed luau with this PR (on a linux machine):

cmake -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo -G Ninja -DCMAKE_INSTALL_PREFIX=$PWD/build/install
cmake --build build
cmake --install build

Differences from #926 and #1317:
I added a step in the CMakeLists.txt to install a pkgconfig file so that this can be used in other build systems (e.g. Meson). I can also add the cmake-only LuauConfig file back in, however this is still useable from other cmake projects using pkgconfig.

The version is also detected from the latest git tag. Not sure if this is right way to automate it but it should allow installing the pkgconfig file with the correct version after a tag is created.

The minimum cmake requirement had to be bumped to 3.20, see https://github.com/jtojnar/cmake-snips#concatenating-paths-when-building-pkg-config-files

@theoparis theoparis changed the title Add cmake installation target CMake Improvements Nov 30, 2024
@theoparis theoparis force-pushed the theoparis/add-install-target branch from ec90c86 to cd1e614 Compare February 21, 2025 02:48
@theoparis theoparis closed this Jun 15, 2025
@theoparis theoparis reopened this Nov 1, 2025
@theoparis theoparis force-pushed the theoparis/add-install-target branch from cd1e614 to 6710b86 Compare November 2, 2025 04:40
@theoparis theoparis closed this Nov 2, 2025
@theoparis theoparis reopened this Feb 28, 2026
@theoparis theoparis force-pushed the theoparis/add-install-target branch from 6710b86 to a6ca3f3 Compare February 28, 2026 22:47
@theoparis theoparis force-pushed the theoparis/add-install-target branch from a6ca3f3 to 8ff7707 Compare March 19, 2026 07:27
@theoparis theoparis force-pushed the theoparis/add-install-target branch 3 times, most recently from 1c60ef3 to 1f4e91b Compare April 27, 2026 02:43
Add a cmake install target and fix utf-8 issues.

Signed-off-by: Theo Paris <theo@theoparis.com>
@theoparis theoparis force-pushed the theoparis/add-install-target branch from 1f4e91b to 4d1af06 Compare May 11, 2026 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant