1- #[[
2- Copyright 2020 (c) 2020 Raspberry Pi (Trading) Ltd.
1+ # To use FetchContent, we need CMake 3.14 or newer.
2+ cmake_minimum_required ( VERSION 3.14 )
33
4- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
5- following conditions are met:
4+ # Redefine project for testing.
5+ project (test_i2s)
66
7- 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
8- disclaimer.
7+ # Enable test to let the VS code find the test.
8+ include (CTest )
9+ enable_testing ()
910
10- 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
11- disclaimer in the documentation and/or other materials provided with the distribution.
1211
13- 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products
14- derived from this software without specific prior written permission.
12+ # GoogleTest requires at least C++14
13+ set (CMAKE_CXX_STANDARD 14)
14+ set (CMAKE_CXX_STANDARD_REQUIRED ON )
1515
16- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
17- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
19- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
20- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
21- WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23- ]]
16+ include (FetchContent )
17+ FetchContent_Declare (
18+ googletest
19+ URL https://github.com/google/googletest/archive/refs/tags/v1.14.0.zip)
20+ # For Windows: Prevent overriding the parent project's compiler/linker settings
21+ set (gtest_force_shared_crt ON CACHE BOOL "" FORCE )
22+ FetchContent_MakeAvailable (googletest)
2423
25- # The first part of the CMakeLists.txt which download SDK automatically.
24+ add_subdirectory ( test )
2625
27- # The original of this file can be found at :
28- # https://github.com/raspberrypi/pico-sdk/blob/master/README.md
29-
30- cmake_minimum_required (VERSION 3.13 )
31-
32- # initialize pico-sdk from GIT
33- # (note this can come from environment, CMake cache etc)
34- set (PICO_SDK_FETCH_FROM_GIT on )
35-
36- # pico_sdk_import.cmake is a single file copied from this SDK
37- # note: this must happen before project()
38- include (pico_sdk_import.cmake )
39-
40- # initialize the Raspberry Pi Pico SDK
41- pico_sdk_init ()
42-
43- # rest of your project
44- project (pico_duplex_i2s_samples)
45-
46- # The original of this file can be found at :
47- # https://github.com/raspberrypi/pico-examples/blob/master/blink/CMakeLists.txt
48-
49- add_subdirectory (samples )
0 commit comments