File tree Expand file tree Collapse file tree 1 file changed +0
-39
lines changed
templates/.github/workflows Expand file tree Collapse file tree 1 file changed +0
-39
lines changed Original file line number Diff line number Diff line change 8888 # Test find_package
8989 cmake -B build -S .
9090
91- - name : Test CPMFindPackage
92- shell : bash
93- run : |
94- # Create test to verify CPMFindPackage works (tries find_package first, then CPM)
95- mkdir -p ${{ runner.temp }}/test-cpm
96- cd ${{ runner.temp }}/test-cpm
97-
98- # Download CPM.cmake
99- mkdir cmake
100- curl -L https://github.com/cpm-cmake/CPM.cmake/releases/latest/download/get_cpm.cmake -o cmake/CPM.cmake
101-
102- # Get project name from CMakeLists.txt
103- PACKAGE_NAME=$(grep -m1 "project(" "${{ github.workspace }}/CMakeLists.txt" | sed 's/project(\([^)]*\)).*/\1/' | awk '{print $1}')
104-
105- # Convert paths to forward slashes for CMake (works on all platforms)
106- INSTALL_PREFIX=$(echo "${{ runner.temp }}/install" | sed 's|\\|/|g')
107-
108- # Create test CMakeLists.txt that uses CPMFindPackage
109- cat > CMakeLists.txt << EOF
110- cmake_minimum_required(VERSION 3.20)
111- project(test-cpm CXX)
112-
113- set(CMAKE_PREFIX_PATH "${INSTALL_PREFIX}")
114- set(CPM_SOURCE_CACHE \${CMAKE_SOURCE_DIR}/.cache/cpm CACHE PATH "CPM cache")
115- include(cmake/CPM.cmake)
116-
117- # CPMFindPackage tries find_package first, then falls back to CPMAddPackage
118- CPMFindPackage(
119- NAME ${PACKAGE_NAME}
120- GITHUB_REPOSITORY ${{ github.repository }}
121- GIT_TAG ${{ github.sha }}
122- )
123-
124- message(STATUS "Successfully acquired ${PACKAGE_NAME} via CPMFindPackage")
125- EOF
126-
127- # Test CPMFindPackage (should find the installed version first)
128- cmake -B build -S .
129-
13091 clang-tidy :
13192 runs-on : ubuntu-latest
13293
You can’t perform that action at this time.
0 commit comments