0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

CMake Error「This app targets API set 'X', but this build targets the latest API set 'Y'.」の解決方法

Last updated at Posted at 2021-03-13

事象

自プロジェクトをAzure Sphere SDKの最新APIセットに対応させようと、CMakeLists.txtのTARGET_API_SETを最新(今回は"7"から"8")に変更したところ、キャッシュを生成時にエラーが発生した。

1> 構成 'ARM-Debug' の CMake 生成を開始しました。
1> コマンド ライン: "cmd.exe" /c "%SYSTEMROOT%\System32\chcp.com 65001 >NUL && "C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\ENTERPRISE\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe"  -G "Ninja"  -DCMAKE_BUILD_TYPE:STRING="Debug" -DCMAKE_INSTALL_PREFIX:PATH="C:\AzureSphere\azure-sphere-thief-detector\projects\multicore\control-hl\install\ARM-Debug" -DCMAKE_TOOLCHAIN_FILE:FILEPATH="C:\Program Files (x86)\Microsoft Azure Sphere SDK\CMakeFiles\AzureSphereToolchain.cmake" -DAZURE_SPHERE_TARGET_API_SET:STRING="latest-lts"  -DCMAKE_MAKE_PROGRAM="C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\ENTERPRISE\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe" "C:\AzureSphere\azure-sphere-thief-detector\projects\multicore\control-hl" 2>&1"
1> 作業ディレクトリ: C:\AzureSphere\azure-sphere-thief-detector\projects\multicore\control-hl\out\ARM-Debug
1> [CMake] -- The C compiler identification is GNU 9.3.0
1> [CMake] -- Detecting C compiler ABI info
1> [CMake] -- Detecting C compiler ABI info - done
1> [CMake] -- Check for working C compiler: C:/Program Files (x86)/Microsoft Azure Sphere SDK/Sysroots/7/tools/gcc/arm-poky-linux-musleabi-gcc.exe - skipped
1> [CMake] -- Detecting C compile features
1> [CMake] -- Detecting C compile features - done
1> [CMake] CMake Error at C:/Program Files (x86)/Microsoft Azure Sphere SDK/CMakeFiles/AzureSphere.cmake:104 (message):
1> [CMake]   This app targets API set '8', but this build targets the latest API set
1> [CMake]   '7'.

解決方法

CMakeLists.txtのキャッシュを生成では回避できず。
先に、プロジェクト配下のoutフォルダを削除すればOK。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?