First attempt at testing CMake Pacage. Will be squashed

This commit is contained in:
Walter Schell 2023-03-12 11:55:17 -04:00
parent b4d597e122
commit e1d13df4a0
3 changed files with 40 additions and 1 deletions

View File

@ -43,7 +43,22 @@ jobs:
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . --config $BUILD_TYPE
- name: Install
working-directory: ${{github.workspace}}/build
shell: bash
run: cmake --install . --prefix $GITHUB_WORKSPACE/sysroot
- name: Test
working-directory: ${{github.workspace}}/build
shell: bash
run: ctest -V
run: ctest -V
- name: Configure Test of CMake Package
working-directory: ${{github.workspace}}
shell: bash
run: cmake -S $GITHUB_WORKSPACE/lua-config-package-tests -B build-pkg-test -DCMAKE_PREFIX=$GITHUB_WORKSPACE/sysroot
- name: Build Test of CMake Package
working-directory: ${{github.workspace}}
shell: bash
run: cmake --build build-pkg-test

View File

@ -0,0 +1,14 @@
cmake_minimum_required(VERSION 3.1)
project(lua-config-package-test C)
find_package(Lua REQUIRED CONFIG)
add_executable(lua-config-package-build-test-using-static-target "./lua-config-package-build-test.c")
target_link_libraries(lua-config-package-build-test-using-static-target Lua::lua_static)
add_executable(lua-config-package-build-test-using-shared-target "./lua-config-package-build-test.c")
target_link_libraries(lua-config-package-build-test-using-shared-target Lua::lua_static)
add_executable(lua-config-package-build-test-using-variables "./lua-config-package-build-test.c")
target_link_libraries(lua-config-package-build-test-using-variables ${LUA_LIBRARIES})

View File

@ -0,0 +1,10 @@
#include <lua.h>
#include <lauxlib.h>
#include <stdio.h>
int main()
{
lua_State *l = luaL_newstate();
double lversion = lua_version(l);
printf("Lua version is %f\n", lversion);
}