CMake - set_property could not find CACHE variable
<p><strong>Disclaimer:</strong> I'm aware of <a href="https://stackoverflow.com/questions/23626099/cmake-set-property-could-not-find-target-xxx-perhaps-it-has-not-yet-been-crea">this</a> question. However, The OP's needs are different to mine: what he actually wants is to port an app to Linux and therefore the answers go in that line, not answering what I want to know: the reasons of the error.</p>

<hr>

<p>I'm trying to create a dropdown list in CMake GUI following the instructions in <a href="https://blog.kitware.com/constraining-values-with-comboboxes-in-cmake-cmake-gui/" rel="nofollow noreferrer">here</a> and <a href="http://blog.bethcodes.com/cmake-tips-tricks-drop-down-list" rel="nofollow noreferrer">here</a></p>

<p>So I have this very simple CMakeLists.txt:</p>

<pre><code>cmake_minimum_required(VERSION 3.6)

project(datasetprograms)

set(CMAKE_CXX_STANDARD 11)

#LINES TO MAKE THE GUI DROP-DOWN:
set(TARGET_ARCHITECTURE “arm” CACHE STRING “Architecture to compile to”)
set_property(CACHE TARGET_ARCHITECTURE PROPERTY STRINGS arm x86)

#Add subdirectories for each project
add_subdirectory(helloworld)
</code></pre>

<p>Basically I just copied and pasted, following the instructions. However, instead of having a nice drop-down in the CMake GUI, I got the following error:</p>

<blockquote>
  <p>CMake Error at CMakeLists.txt:9 (set_property):   set_property could
  not find CACHE variable TARGET_ARCHITECTURE.  Perhaps it  has not yet
  been created</p>
</blockquote>

<p><strong>Question:</strong> What I'm doing wrong? </p>