title: CMake How to check target for build
body: <p>I have tried to find solution: How to check target for build ?</p>
  
  <p>Consider the following CMake script:</p>
  
  <pre><code>cmake_minimum_required(VERSION 3.5.1)
  project(cppTests)
  
  # How to check at this point the target of build
  if(TARGET "cppTests")
      message(STATUS "Target is cppTests")
  else()
      message(STATUS "Target is not cppTests")
  endif()
  
  
  message(STATUS "Target is ${TARGET}")
  set(CMAKE_CXX_STANDARD 11)
  
  set(SOURCE_FILES main.cpp)
  add_executable(cppTests ${SOURCE_FILES})
  </code></pre>
  
  <p>Then I call the following:</p>
  
  <pre><code>/home/username/Software/clion-2017.1.1/bin/cmake/bin/cmake --build /home/username/Projects/cppTests/cmake-build-debug --target cppTests -- -j 8
  </code></pre>
  
  <p>How can I check target <strong>cppTests</strong> in <strong>CMake</strong> script after <strong>--target</strong> options ?
  I am looking for something like <strong>MAKECMDGOALS</strong> in <strong>Makefiles</strong>.
  I have found any useful solution ...</p>