From 7f969e47da301e0bdd99e4b0f3f6544a873e798d Mon Sep 17 00:00:00 2001 From: David Garske Date: Mon, 5 Feb 2024 17:12:58 -0800 Subject: [PATCH] Fixes for CMake tests. --- .github/workflows/cmake-build.yml | 15 +++++++++------ CMakeLists.txt | 9 +++++---- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.github/workflows/cmake-build.yml b/.github/workflows/cmake-build.yml index 158ac5c6..0601e6f3 100644 --- a/.github/workflows/cmake-build.yml +++ b/.github/workflows/cmake-build.yml @@ -22,7 +22,8 @@ jobs: sudo apt-get install -y cmake #pull and build wolfssl - - uses: actions/checkout@master + - name: Checkout wolfssl + uses: actions/checkout@master with: repository: wolfssl/wolfssl path: wolfssl @@ -31,14 +32,16 @@ jobs: run: | mkdir build cd build - cmake -DWOLFSSL_TPM=yes .. - make - sudo make install + # wolfSSL PR 7188 broke "make install" unless WOLFSSL_INSTALL is set + cmake -DWOLFSSL_TPM=yes -DWOLFSSL_INSTALL=yes -DCMAKE_INSTALL_PREFIX="$GITHUB_WORKSPACE/install" .. + cmake --build . + cmake --install . #build wolftpm - name: Build wolfTPM run: | mkdir build cd build - cmake -DWOLFTPM_INTERFACE=SWTPM .. - make + cmake -DWOLFTPM_INTERFACE=SWTPM -DCMAKE_INSTALL_PREFIX="$GITHUB_WORKSPACE/install" -DWITH_WOLFSSL="$GITHUB_WORKSPACE/install" .. + cmake --build . + cmake --install . diff --git a/CMakeLists.txt b/CMakeLists.txt index 97469746..3960176b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ # CMakeList.txt # -# Copyright (C) 2006-2022 wolfSSL Inc. +# Copyright (C) 2006-2024 wolfSSL Inc. # # This file is part of wolfSSL. (formerly known as CyaSSL) # @@ -132,7 +132,7 @@ if (WITH_WOLFSSL) target_link_libraries(wolftpm PUBLIC wolfssl) target_include_directories(wolftpm PUBLIC ${WITH_WOLFSSL}/include) target_link_directories(wolftpm PUBLIC ${WITH_WOLFSSL}/lib) - elseif (WITH_WOLFSSL_TREE) +elseif (WITH_WOLFSSL_TREE) set(WOLFSSL_TPM "yes" CACHE STRING "") set(WOLFSSL_EXAMPLES "no" CACHE STRING "") set(WOLFSSL_CRYPT_TESTS "no" CACHE STRING "") @@ -221,7 +221,7 @@ file(REMOVE ${OPTION_FILE}) file(APPEND ${OPTION_FILE} "/* wolftpm options.h\n") file(APPEND ${OPTION_FILE} " * generated from cmake configure options\n") file(APPEND ${OPTION_FILE} " *\n") -file(APPEND ${OPTION_FILE} " * Copyright (C) 2006-2022 wolfSSL Inc.\n") +file(APPEND ${OPTION_FILE} " * Copyright (C) 2006-2024 wolfSSL Inc.\n") file(APPEND ${OPTION_FILE} " *\n") file(APPEND ${OPTION_FILE} " * This file is part of wolfSSL.\n") file(APPEND ${OPTION_FILE} " *\n") @@ -292,7 +292,8 @@ install(TARGETS wolftpm # Install the export set install(EXPORT wolftpm-targets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/wolftpm - FILE wolftpm-config.cmake) + FILE wolftpm-config.cmake + NAMESPACE wolfssl::) # Install the headers install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/wolftpm/