From 8b773b191c81559d3f2fdd51207e13bbfa22802a Mon Sep 17 00:00:00 2001 From: Rocka Date: Sun, 19 Feb 2023 15:40:29 +0800 Subject: [PATCH 01/18] Correct LUA_LIBRARIES in cmake config --- lua-5.4.5/CMakeLists.txt | 15 ++++++++++----- lua-5.4.5/LuaConfig.cmake.in | 13 ++++++++++++- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/lua-5.4.5/CMakeLists.txt b/lua-5.4.5/CMakeLists.txt index dd36dbe..9e8c292 100644 --- a/lua-5.4.5/CMakeLists.txt +++ b/lua-5.4.5/CMakeLists.txt @@ -35,6 +35,8 @@ set(LUA_LIB_SRCS set(TARGETS_TO_INSTALL lua_internal lua_include) +set(LUA_LINKED_LIBRARIES) + if(LUA_BUILD_AS_CXX) set_source_files_properties(${LUA_LIB_SRCS} "src/lua.c" "src/luac.c" PROPERTIES LANGUAGE CXX ) endif() @@ -87,14 +89,17 @@ if(UNIX) if(NOT LIBM) message(FATAL_ERROR "libm not found and is required by lua") endif() + target_compile_definitions(lua_internal INTERFACE "LUA_USE_POSIX") target_link_libraries(lua_internal INTERFACE m) - - target_compile_definitions(lua_internal - INTERFACE LUA_USE_POSIX - ) + list(APPEND LUA_LINKED_LIBRARIES m) if(LUA_SUPPORT_DL) + find_library(LIBDL "${CMAKE_DL_LIBS}") + if(NOT LIBDL) + message(FATAL_ERROR "libdl not found and is required by lua") + endif() target_compile_definitions(lua_internal INTERFACE "LUA_USE_DLOPEN") - target_link_libraries(lua_internal INTERFACE dl) + target_link_libraries(lua_internal INTERFACE "${CMAKE_DL_LIBS}") + list(APPEND LUA_LINKED_LIBRARIES "${CMAKE_DL_LIBS}") endif() endif() diff --git a/lua-5.4.5/LuaConfig.cmake.in b/lua-5.4.5/LuaConfig.cmake.in index 8f32b2c..199f611 100644 --- a/lua-5.4.5/LuaConfig.cmake.in +++ b/lua-5.4.5/LuaConfig.cmake.in @@ -4,6 +4,17 @@ include("${CMAKE_CURRENT_LIST_DIR}/LuaTargets.cmake") set_and_check(LUA_INCLUDE_DIR "${PACKAGE_PREFIX_DIR}/include") add_library(Lua::Library ALIAS "Lua::@LUA_EXPORT_LIBRARY@") -set(LUA_LIBRARIES "Lua::Library") +get_target_property(LUA_CONFIG "Lua::@LUA_EXPORT_LIBRARY@" IMPORTED_CONFIGURATIONS) +get_target_property(LUA_LIBRARY "Lua::@LUA_EXPORT_LIBRARY@" "IMPORTED_LOCATION_${LUA_CONFIG}") +set(LUA_LIBRARIES "${LUA_LIBRARY}") + +foreach(LIB_NAME @LUA_LINKED_LIBRARIES@) + find_library(LIB_LOCATION "${LIB_NAME}") + if(NOT LIB_LOCATION) + message(FATAL_ERROR "lib${LIB_NAME} not found and is required by lua") + else() + list(APPEND LUA_LIBRARIES "${LIB_LOCATION}") + endif() +endforeach() check_required_components(Lua) From e1d13df4a0cdeeefd15f98db3cf7bab1d1944530 Mon Sep 17 00:00:00 2001 From: Walter Schell Date: Sun, 12 Mar 2023 11:55:17 -0400 Subject: [PATCH 02/18] First attempt at testing CMake Pacage. Will be squashed --- .github/workflows/build-linux.yml | 17 ++++++++++++++++- lua-config-package-tests/CMakeLists.txt | 14 ++++++++++++++ .../lua-config-package-build-test.c | 10 ++++++++++ 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 lua-config-package-tests/CMakeLists.txt create mode 100644 lua-config-package-tests/lua-config-package-build-test.c diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index abe5748..d94d9bb 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -43,7 +43,22 @@ jobs: # Execute the build. You can specify a specific target with "--target " 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 \ No newline at end of file + 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 \ No newline at end of file diff --git a/lua-config-package-tests/CMakeLists.txt b/lua-config-package-tests/CMakeLists.txt new file mode 100644 index 0000000..138139e --- /dev/null +++ b/lua-config-package-tests/CMakeLists.txt @@ -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}) + diff --git a/lua-config-package-tests/lua-config-package-build-test.c b/lua-config-package-tests/lua-config-package-build-test.c new file mode 100644 index 0000000..c4109a2 --- /dev/null +++ b/lua-config-package-tests/lua-config-package-build-test.c @@ -0,0 +1,10 @@ +#include +#include +#include + +int main() +{ + lua_State *l = luaL_newstate(); + double lversion = lua_version(l); + printf("Lua version is %f\n", lversion); +} \ No newline at end of file From 539ab33b85977a191c5f339b2716b7c899ca1a26 Mon Sep 17 00:00:00 2001 From: Walter Schell Date: Sun, 12 Mar 2023 12:00:18 -0400 Subject: [PATCH 03/18] Changed install path slightly --- lua-5.4.5/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lua-5.4.5/CMakeLists.txt b/lua-5.4.5/CMakeLists.txt index dd36dbe..c1f203b 100644 --- a/lua-5.4.5/CMakeLists.txt +++ b/lua-5.4.5/CMakeLists.txt @@ -150,17 +150,17 @@ write_basic_package_version_file( install(EXPORT LuaTargets FILE LuaTargets.cmake - DESTINATION "lib/cmake" + DESTINATION "lib/cmake/Lua" NAMESPACE Lua:: ) configure_package_config_file( LuaConfig.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/LuaConfig.cmake" - INSTALL_DESTINATION "lib/cmake" + INSTALL_DESTINATION "lib/cmake/Lua" ) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/LuaConfig.cmake" "${CMAKE_CURRENT_BINARY_DIR}/LuaConfigVersion.cmake" - DESTINATION "lib/cmake" + DESTINATION "lib/cmake/Lua" ) From 1e4b4e887c9951feb197ef1122b8995d1412981f Mon Sep 17 00:00:00 2001 From: Walter Schell Date: Sun, 12 Mar 2023 12:05:24 -0400 Subject: [PATCH 04/18] Added more debug --- .github/workflows/build-linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index d94d9bb..171bc0e 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -56,7 +56,7 @@ jobs: - 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 + run: cmake -S $GITHUB_WORKSPACE/lua-config-package-tests -B build-pkg-test -DCMAKE_PREFIX=$GITHUB_WORKSPACE/sysroot --debug-find - name: Build Test of CMake Package working-directory: ${{github.workspace}} From fd4daf7edd9c8af0f4939008c7f9bf13d5583937 Mon Sep 17 00:00:00 2001 From: Walter Schell Date: Sun, 12 Mar 2023 12:09:36 -0400 Subject: [PATCH 05/18] Changed cmake module install path to lib/share --- lua-5.4.5/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lua-5.4.5/CMakeLists.txt b/lua-5.4.5/CMakeLists.txt index c1f203b..4b1f101 100644 --- a/lua-5.4.5/CMakeLists.txt +++ b/lua-5.4.5/CMakeLists.txt @@ -150,17 +150,17 @@ write_basic_package_version_file( install(EXPORT LuaTargets FILE LuaTargets.cmake - DESTINATION "lib/cmake/Lua" + DESTINATION "lib/share/cmake/Lua" NAMESPACE Lua:: ) configure_package_config_file( LuaConfig.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/LuaConfig.cmake" - INSTALL_DESTINATION "lib/cmake/Lua" + INSTALL_DESTINATION "lib/share/cmake/Lua" ) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/LuaConfig.cmake" "${CMAKE_CURRENT_BINARY_DIR}/LuaConfigVersion.cmake" - DESTINATION "lib/cmake/Lua" + DESTINATION "lib/share/cmake/Lua" ) From aa5e05e3c1b607cbd742c6beefda229f2163d967 Mon Sep 17 00:00:00 2001 From: Walter Schell Date: Sun, 12 Mar 2023 12:40:03 -0400 Subject: [PATCH 06/18] Fixed typo in CMAKE_PREFIX_PATH --- .github/workflows/build-linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index 171bc0e..0af850d 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -56,7 +56,7 @@ jobs: - 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 --debug-find + run: cmake -S $GITHUB_WORKSPACE/lua-config-package-tests -B build-pkg-test -DCMAKE_PREFIX_PATH=$GITHUB_WORKSPACE/sysroot --debug-find - name: Build Test of CMake Package working-directory: ${{github.workspace}} From 83b85410dad5af9a14588c020489e3c5526326ab Mon Sep 17 00:00:00 2001 From: Walter Schell Date: Sun, 12 Mar 2023 13:11:19 -0400 Subject: [PATCH 07/18] Install package config files to share/cmake --- lua-5.4.5/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lua-5.4.5/CMakeLists.txt b/lua-5.4.5/CMakeLists.txt index 4b1f101..5ede404 100644 --- a/lua-5.4.5/CMakeLists.txt +++ b/lua-5.4.5/CMakeLists.txt @@ -150,17 +150,17 @@ write_basic_package_version_file( install(EXPORT LuaTargets FILE LuaTargets.cmake - DESTINATION "lib/share/cmake/Lua" + DESTINATION "share/cmake/Lua" NAMESPACE Lua:: ) configure_package_config_file( LuaConfig.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/LuaConfig.cmake" - INSTALL_DESTINATION "lib/share/cmake/Lua" + INSTALL_DESTINATION "share/cmake/Lua" ) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/LuaConfig.cmake" "${CMAKE_CURRENT_BINARY_DIR}/LuaConfigVersion.cmake" - DESTINATION "lib/share/cmake/Lua" + DESTINATION "share/cmake/Lua" ) From 5fa21b307997414d9d2c0c17023b4e06bc094599 Mon Sep 17 00:00:00 2001 From: Walter Schell Date: Sun, 12 Mar 2023 13:13:57 -0400 Subject: [PATCH 08/18] Removed path debug --- .github/workflows/build-linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index 0af850d..a386fae 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -56,7 +56,7 @@ jobs: - 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_PATH=$GITHUB_WORKSPACE/sysroot --debug-find + run: cmake -S $GITHUB_WORKSPACE/lua-config-package-tests -B build-pkg-test -DCMAKE_PREFIX_PATH=$GITHUB_WORKSPACE/sysroot - name: Build Test of CMake Package working-directory: ${{github.workspace}} From bc32a7bb259bd2bd9ecd65b8cdaf7b5023508b40 Mon Sep 17 00:00:00 2001 From: Walter Schell Date: Sun, 12 Mar 2023 13:25:09 -0400 Subject: [PATCH 09/18] Test using shared target needs to actually use the shared target --- lua-config-package-tests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua-config-package-tests/CMakeLists.txt b/lua-config-package-tests/CMakeLists.txt index 138139e..98a75ff 100644 --- a/lua-config-package-tests/CMakeLists.txt +++ b/lua-config-package-tests/CMakeLists.txt @@ -7,7 +7,7 @@ add_executable(lua-config-package-build-test-using-static-target "./lua-config-p 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) +target_link_libraries(lua-config-package-build-test-using-shared-target Lua::lua_shared) 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}) From b65e88424e6059ab733590eb0fafcd2883581d9f Mon Sep 17 00:00:00 2001 From: Rocka Date: Mon, 13 Mar 2023 13:29:06 +0800 Subject: [PATCH 10/18] Add test case for module compatible mode --- lua-config-package-tests/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lua-config-package-tests/CMakeLists.txt b/lua-config-package-tests/CMakeLists.txt index 98a75ff..48c52b6 100644 --- a/lua-config-package-tests/CMakeLists.txt +++ b/lua-config-package-tests/CMakeLists.txt @@ -12,3 +12,10 @@ target_link_libraries(lua-config-package-build-test-using-shared-target Lua::lua 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}) +add_library(lua-lib-module-compatible-mode UNKNOWN IMPORTED ${LUA_LIBRARY}) +set_target_properties(lua-lib-module-compatible-mode PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES ${LUA_INCLUDE_DIR} + IMPORTED_LOCATION ${LUA_LIBRARY}) + +add_executable(lua-config-package-build-test-using-module-compatible-mode "./lua-config-package-build-test.c") +target_link_libraries(lua-config-package-build-test-using-module-compatible-mode lua-lib-module-compatible-mode) From a808cd569f624a0da6f7569dc643a60959be8473 Mon Sep 17 00:00:00 2001 From: Walter Schell Date: Sat, 24 Jun 2023 21:11:36 -0400 Subject: [PATCH 11/18] Quoted variables to make less confusing --- lua-config-package-tests/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lua-config-package-tests/CMakeLists.txt b/lua-config-package-tests/CMakeLists.txt index 48c52b6..3f2b073 100644 --- a/lua-config-package-tests/CMakeLists.txt +++ b/lua-config-package-tests/CMakeLists.txt @@ -10,12 +10,12 @@ add_executable(lua-config-package-build-test-using-shared-target "./lua-config-p target_link_libraries(lua-config-package-build-test-using-shared-target Lua::lua_shared) 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}) +target_link_libraries(lua-config-package-build-test-using-variables "${LUA_LIBRARIES}") -add_library(lua-lib-module-compatible-mode UNKNOWN IMPORTED ${LUA_LIBRARY}) +add_library(lua-lib-module-compatible-mode UNKNOWN IMPORTED "${LUA_LIBRARY}") set_target_properties(lua-lib-module-compatible-mode PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES ${LUA_INCLUDE_DIR} - IMPORTED_LOCATION ${LUA_LIBRARY}) + INTERFACE_INCLUDE_DIRECTORIES "${LUA_INCLUDE_DIR}" + IMPORTED_LOCATION "${LUA_LIBRARY}") add_executable(lua-config-package-build-test-using-module-compatible-mode "./lua-config-package-build-test.c") target_link_libraries(lua-config-package-build-test-using-module-compatible-mode lua-lib-module-compatible-mode) From b7b0ded927e1ee7453305c6d9258787ba21ea5bc Mon Sep 17 00:00:00 2001 From: Walter Schell Date: Sat, 24 Jun 2023 21:37:17 -0400 Subject: [PATCH 12/18] All workflows updated --- .github/workflows/build-emscripten-cxx.yml | 14 ++++++++++++++ .github/workflows/build-emscripten.yml | 14 ++++++++++++++ .github/workflows/build-linux-cxx.yml | 17 ++++++++++++++++- .github/workflows/build-osx-cxx.yml | 17 ++++++++++++++++- .github/workflows/build-osx.yml | 18 +++++++++++++++++- .github/workflows/build-windows-cxx.yml | 17 ++++++++++++++++- .github/workflows/build-windows.yml | 17 ++++++++++++++++- 7 files changed, 109 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-emscripten-cxx.yml b/.github/workflows/build-emscripten-cxx.yml index 28bc761..9ccab12 100644 --- a/.github/workflows/build-emscripten-cxx.yml +++ b/.github/workflows/build-emscripten-cxx.yml @@ -35,3 +35,17 @@ jobs: # Execute the build. You can specify a specific target with "--target " run: cmake --build . --config $BUILD_TYPE + - name: Install + working-directory: ${{github.workspace}}/build + shell: bash + run: cmake --install . --prefix $GITHUB_WORKSPACE/sysroot + + - 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_PATH=$GITHUB_WORKSPACE/sysroot + + - name: Build Test of CMake Package + working-directory: ${{github.workspace}} + shell: bash + run: cmake --build build-pkg-test \ No newline at end of file diff --git a/.github/workflows/build-emscripten.yml b/.github/workflows/build-emscripten.yml index aeade19..74e7dc4 100644 --- a/.github/workflows/build-emscripten.yml +++ b/.github/workflows/build-emscripten.yml @@ -35,3 +35,17 @@ jobs: # Execute the build. You can specify a specific target with "--target " run: cmake --build . --config $BUILD_TYPE + - name: Install + working-directory: ${{github.workspace}}/build + shell: bash + run: cmake --install . --prefix $GITHUB_WORKSPACE/sysroot + + - 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_PATH=$GITHUB_WORKSPACE/sysroot + + - name: Build Test of CMake Package + working-directory: ${{github.workspace}} + shell: bash + run: cmake --build build-pkg-test \ No newline at end of file diff --git a/.github/workflows/build-linux-cxx.yml b/.github/workflows/build-linux-cxx.yml index 36d6e22..60f774d 100644 --- a/.github/workflows/build-linux-cxx.yml +++ b/.github/workflows/build-linux-cxx.yml @@ -43,7 +43,22 @@ jobs: # Execute the build. You can specify a specific target with "--target " 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 \ No newline at end of file + 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_PATH=$GITHUB_WORKSPACE/sysroot + + - name: Build Test of CMake Package + working-directory: ${{github.workspace}} + shell: bash + run: cmake --build build-pkg-test \ No newline at end of file diff --git a/.github/workflows/build-osx-cxx.yml b/.github/workflows/build-osx-cxx.yml index f6869e6..ba1520c 100644 --- a/.github/workflows/build-osx-cxx.yml +++ b/.github/workflows/build-osx-cxx.yml @@ -43,7 +43,22 @@ jobs: # Execute the build. You can specify a specific target with "--target " 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 \ No newline at end of file + 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_PATH=$GITHUB_WORKSPACE/sysroot + + - name: Build Test of CMake Package + working-directory: ${{github.workspace}} + shell: bash + run: cmake --build build-pkg-test \ No newline at end of file diff --git a/.github/workflows/build-osx.yml b/.github/workflows/build-osx.yml index 85d5a92..8afa097 100644 --- a/.github/workflows/build-osx.yml +++ b/.github/workflows/build-osx.yml @@ -43,7 +43,23 @@ jobs: # Execute the build. You can specify a specific target with "--target " 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 \ No newline at end of file + 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_PATH=$GITHUB_WORKSPACE/sysroot + + - name: Build Test of CMake Package + working-directory: ${{github.workspace}} + shell: bash + run: cmake --build build-pkg-test \ No newline at end of file diff --git a/.github/workflows/build-windows-cxx.yml b/.github/workflows/build-windows-cxx.yml index 34eb4b2..0cc05f8 100644 --- a/.github/workflows/build-windows-cxx.yml +++ b/.github/workflows/build-windows-cxx.yml @@ -43,7 +43,22 @@ jobs: # Execute the build. You can specify a specific target with "--target " 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 -C $BUILD_TYPE \ No newline at end of file + run: ctest -V -C $BUILD_TYPE + + - 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_PATH=$GITHUB_WORKSPACE/sysroot + + - name: Build Test of CMake Package + working-directory: ${{github.workspace}} + shell: bash + run: cmake --build build-pkg-test \ No newline at end of file diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index c16da98..5616ed2 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -43,7 +43,22 @@ jobs: # Execute the build. You can specify a specific target with "--target " 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 -C $BUILD_TYPE \ No newline at end of file + run: ctest -V -C $BUILD_TYPE + + - 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_PATH=$GITHUB_WORKSPACE/sysroot + + - name: Build Test of CMake Package + working-directory: ${{github.workspace}} + shell: bash + run: cmake --build build-pkg-test \ No newline at end of file From c80acc18351a94b3c0d556bc00b95f7cdc5b3e11 Mon Sep 17 00:00:00 2001 From: Walter Schell Date: Sun, 9 Jul 2023 17:17:19 -0400 Subject: [PATCH 13/18] Added include directory to LUA_LIBRARIES --- lua-5.4.5/LuaConfig.cmake.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua-5.4.5/LuaConfig.cmake.in b/lua-5.4.5/LuaConfig.cmake.in index 199f611..d55b97e 100644 --- a/lua-5.4.5/LuaConfig.cmake.in +++ b/lua-5.4.5/LuaConfig.cmake.in @@ -7,6 +7,9 @@ add_library(Lua::Library ALIAS "Lua::@LUA_EXPORT_LIBRARY@") get_target_property(LUA_CONFIG "Lua::@LUA_EXPORT_LIBRARY@" IMPORTED_CONFIGURATIONS) get_target_property(LUA_LIBRARY "Lua::@LUA_EXPORT_LIBRARY@" "IMPORTED_LOCATION_${LUA_CONFIG}") set(LUA_LIBRARIES "${LUA_LIBRARY}") +add_library(Lua::Includes INTERFACE) +target_include_directories(Lua::Includes INTERFACE "${LUA_INCLUDE_DIR}") +list(APPEND LUA_LIBRARIES Lua::Includes) foreach(LIB_NAME @LUA_LINKED_LIBRARIES@) find_library(LIB_LOCATION "${LIB_NAME}") From 90b1300f1ab557808908bf6c95a1815553a30a51 Mon Sep 17 00:00:00 2001 From: Walter Schell Date: Sun, 9 Jul 2023 17:20:42 -0400 Subject: [PATCH 14/18] Don't use reserved name for include library --- lua-5.4.5/LuaConfig.cmake.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lua-5.4.5/LuaConfig.cmake.in b/lua-5.4.5/LuaConfig.cmake.in index d55b97e..2361f38 100644 --- a/lua-5.4.5/LuaConfig.cmake.in +++ b/lua-5.4.5/LuaConfig.cmake.in @@ -7,9 +7,9 @@ add_library(Lua::Library ALIAS "Lua::@LUA_EXPORT_LIBRARY@") get_target_property(LUA_CONFIG "Lua::@LUA_EXPORT_LIBRARY@" IMPORTED_CONFIGURATIONS) get_target_property(LUA_LIBRARY "Lua::@LUA_EXPORT_LIBRARY@" "IMPORTED_LOCATION_${LUA_CONFIG}") set(LUA_LIBRARIES "${LUA_LIBRARY}") -add_library(Lua::Includes INTERFACE) -target_include_directories(Lua::Includes INTERFACE "${LUA_INCLUDE_DIR}") -list(APPEND LUA_LIBRARIES Lua::Includes) +add_library(LUA_INCLUDE_LIB INTERFACE) +target_include_directories(LUA_INCLUDE_LIB INTERFACE "${LUA_INCLUDE_DIR}") +list(APPEND LUA_LIBRARIES LUA_INCLUDE_LIB) foreach(LIB_NAME @LUA_LINKED_LIBRARIES@) find_library(LIB_LOCATION "${LIB_NAME}") From 0073d700d266eefce95cba799aaea2de72d518e7 Mon Sep 17 00:00:00 2001 From: Walter Schell Date: Sun, 9 Jul 2023 17:52:18 -0400 Subject: [PATCH 15/18] Add link to LUA_LIBRARIES in test for module compatible mode --- lua-config-package-tests/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/lua-config-package-tests/CMakeLists.txt b/lua-config-package-tests/CMakeLists.txt index 3f2b073..e810d8b 100644 --- a/lua-config-package-tests/CMakeLists.txt +++ b/lua-config-package-tests/CMakeLists.txt @@ -16,6 +16,7 @@ add_library(lua-lib-module-compatible-mode UNKNOWN IMPORTED "${LUA_LIBRARY}") set_target_properties(lua-lib-module-compatible-mode PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${LUA_INCLUDE_DIR}" IMPORTED_LOCATION "${LUA_LIBRARY}") +target_link_libraries(lua-lib-module-compatible-mode INTERFACE "${LUA_LIBRARIES}") add_executable(lua-config-package-build-test-using-module-compatible-mode "./lua-config-package-build-test.c") target_link_libraries(lua-config-package-build-test-using-module-compatible-mode lua-lib-module-compatible-mode) From c4b997abc3f5b55fd6c2eea09ad75bf630e4a276 Mon Sep 17 00:00:00 2001 From: Walter Schell Date: Tue, 11 Jul 2023 06:28:56 -0400 Subject: [PATCH 16/18] Commented out find package tests for CXX builds --- .github/workflows/build-emscripten-cxx.yml | 17 +++++++++-------- .github/workflows/build-linux-cxx.yml | 18 ++++++++++-------- .github/workflows/build-osx-cxx.yml | 17 +++++++++-------- .github/workflows/build-windows-cxx.yml | 17 +++++++++-------- 4 files changed, 37 insertions(+), 32 deletions(-) diff --git a/.github/workflows/build-emscripten-cxx.yml b/.github/workflows/build-emscripten-cxx.yml index 9ccab12..5970ed2 100644 --- a/.github/workflows/build-emscripten-cxx.yml +++ b/.github/workflows/build-emscripten-cxx.yml @@ -40,12 +40,13 @@ jobs: shell: bash run: cmake --install . --prefix $GITHUB_WORKSPACE/sysroot - - 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_PATH=$GITHUB_WORKSPACE/sysroot + ## Test of installing as CXX doesn't really make sense + # - 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_PATH=$GITHUB_WORKSPACE/sysroot - - name: Build Test of CMake Package - working-directory: ${{github.workspace}} - shell: bash - run: cmake --build build-pkg-test \ No newline at end of file + # - name: Build Test of CMake Package + # working-directory: ${{github.workspace}} + # shell: bash + # run: cmake --build build-pkg-test \ No newline at end of file diff --git a/.github/workflows/build-linux-cxx.yml b/.github/workflows/build-linux-cxx.yml index 60f774d..9dcd67d 100644 --- a/.github/workflows/build-linux-cxx.yml +++ b/.github/workflows/build-linux-cxx.yml @@ -53,12 +53,14 @@ jobs: shell: bash 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_PATH=$GITHUB_WORKSPACE/sysroot + ## Test of installing as CXX doesn't really make sense - - name: Build Test of CMake Package - working-directory: ${{github.workspace}} - shell: bash - run: cmake --build build-pkg-test \ No newline at end of file + # - 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_PATH=$GITHUB_WORKSPACE/sysroot + + # - name: Build Test of CMake Package + # working-directory: ${{github.workspace}} + # shell: bash + # run: cmake --build build-pkg-test \ No newline at end of file diff --git a/.github/workflows/build-osx-cxx.yml b/.github/workflows/build-osx-cxx.yml index ba1520c..89346fe 100644 --- a/.github/workflows/build-osx-cxx.yml +++ b/.github/workflows/build-osx-cxx.yml @@ -53,12 +53,13 @@ jobs: shell: bash 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_PATH=$GITHUB_WORKSPACE/sysroot + ## Test of installing as CXX doesn't really make sense + # - 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_PATH=$GITHUB_WORKSPACE/sysroot - - name: Build Test of CMake Package - working-directory: ${{github.workspace}} - shell: bash - run: cmake --build build-pkg-test \ No newline at end of file + # - name: Build Test of CMake Package + # working-directory: ${{github.workspace}} + # shell: bash + # run: cmake --build build-pkg-test \ No newline at end of file diff --git a/.github/workflows/build-windows-cxx.yml b/.github/workflows/build-windows-cxx.yml index 0cc05f8..5c4e370 100644 --- a/.github/workflows/build-windows-cxx.yml +++ b/.github/workflows/build-windows-cxx.yml @@ -53,12 +53,13 @@ jobs: shell: bash run: ctest -V -C $BUILD_TYPE - - 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_PATH=$GITHUB_WORKSPACE/sysroot + ## Test of installing as CXX doesn't really make sense + # - 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_PATH=$GITHUB_WORKSPACE/sysroot - - name: Build Test of CMake Package - working-directory: ${{github.workspace}} - shell: bash - run: cmake --build build-pkg-test \ No newline at end of file + # - name: Build Test of CMake Package + # working-directory: ${{github.workspace}} + # shell: bash + # run: cmake --build build-pkg-test \ No newline at end of file From 49add17f95567b4ce6f738c18966af79540d4c58 Mon Sep 17 00:00:00 2001 From: Walter Schell Date: Tue, 11 Jul 2023 06:37:56 -0400 Subject: [PATCH 17/18] Added emcmake to package test --- .github/workflows/build-emscripten.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-emscripten.yml b/.github/workflows/build-emscripten.yml index 74e7dc4..8879c17 100644 --- a/.github/workflows/build-emscripten.yml +++ b/.github/workflows/build-emscripten.yml @@ -43,7 +43,7 @@ jobs: - 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_PATH=$GITHUB_WORKSPACE/sysroot + run: emcmake cmake -S $GITHUB_WORKSPACE/lua-config-package-tests -B build-pkg-test -DCMAKE_PREFIX_PATH=$GITHUB_WORKSPACE/sysroot - name: Build Test of CMake Package working-directory: ${{github.workspace}} From b67861b05e3915bc8e6e7a78c18d30067c386398 Mon Sep 17 00:00:00 2001 From: Walter Schell Date: Tue, 11 Jul 2023 06:48:58 -0400 Subject: [PATCH 18/18] Comment out emscripten package test --- .github/workflows/build-emscripten.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-emscripten.yml b/.github/workflows/build-emscripten.yml index 8879c17..2f11154 100644 --- a/.github/workflows/build-emscripten.yml +++ b/.github/workflows/build-emscripten.yml @@ -40,12 +40,12 @@ jobs: shell: bash run: cmake --install . --prefix $GITHUB_WORKSPACE/sysroot - - name: Configure Test of CMake Package - working-directory: ${{github.workspace}} - shell: bash - run: emcmake cmake -S $GITHUB_WORKSPACE/lua-config-package-tests -B build-pkg-test -DCMAKE_PREFIX_PATH=$GITHUB_WORKSPACE/sysroot + # - name: Configure Test of CMake Package + # working-directory: ${{github.workspace}} + # shell: bash + # run: emcmake cmake -S $GITHUB_WORKSPACE/lua-config-package-tests -B build-pkg-test -DCMAKE_PREFIX_PATH=$GITHUB_WORKSPACE/sysroot - - name: Build Test of CMake Package - working-directory: ${{github.workspace}} - shell: bash - run: cmake --build build-pkg-test \ No newline at end of file + # - name: Build Test of CMake Package + # working-directory: ${{github.workspace}} + # shell: bash + # run: cmake --build build-pkg-test \ No newline at end of file