title: CMake Command Line Definitions Not Perpetuating To Toolchain File
body: <p>I have a cmake cross compiler toolchain file, abridged as: </p>
  
  <pre><code>set(CMAKE_SYSTEM_NAME Linux)
  if( DEFINED TC_PATH )
      message( STATUS " TC_PATH IS defined. ${TC_PATH}" )
  else()
      message( FATAL_ERROR " TC_PATH not defined." )
  endif()
  
  set(CMAKE_C_COMPILER ${TC_PATH}/usr/bin/i586-linux/i586-linux-gcc )
  set(CMAKE_CXX_COMPILER ${TC_PATH}/usr/bin/i586-linux/i586-linux-g++ )
  set(CMAKE_LINKER ${TC_PATH}/usr/bin/i586-linux/i586-linux-ld )
  </code></pre>
  
  <p>I call cmake, setting the TC_PATH as well as the toolchain file:</p>
  
  <pre><code>~/CMakeTest/output $ cmake -DTC_PATH:PATH=/opt/toolchain -DCMAKE_TOOLCHAIN_FILE=../toolchain.cmake ../
  </code></pre>
  
  <p>It appears cmake is invoking the toolchain file multiple times. On the first two time, the TC_PATH check succeeds, but later, after identifying the compilers, it throws an error:</p>
  
  <pre><code>--  TC_PATH IS defined. /opt/toolchain
  --  TC_PATH IS defined. /opt/toolchain
  -- The C compiler identification is GNU 4.9.1
  -- The CXX compiler identification is GNU 4.9.1
  -- Check for working C compiler: /opt/toolchain/usr/bin/i586-linux/i586-linux-gcc
  CMake Error at /home/gnac/CMakeTest/toolchain.cmake:4 (message):
     TC_PATH not defined.
  Call Stack (most recent call first):
    /home/gnac/CMakeTest/output/CMakeFiles/3.0.2/CMakeSystem.cmake:6 (include)
    CMakeLists.txt:2 (project)
  </code></pre>
  
  <p>So, outside of setting a permanent environment variable in the shell, how I can set the TC_PATH variable via the command line so that it will be remain in context while executing the cmake generate command?</p>