CMake dependency target does not exist
<p>I have the following script to build one of my projects</p>

<pre><code>CMAKE_MINIMUM_REQUIRED(VERSION 3.0.2)
INCLUDE(ExternalProject)
SET(PROJECT_NAME Khronos)
PROJECT(${PROJECT_NAME})
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
SET_DIRECTORY_PROPERTIES(PROPERTIES EP_PREFIX ${CMAKE_BINARY_DIR}/library-build)

FIND_PACKAGE(sphinxbase)
if (${SPHINXBASE_FOUND})
    INCLUDE_DIRECTORIES(${SPHINXBASE_INCLUDE_DIR}/sphinxbase/)
else ()
    ExternalProject_Add(
        sphinxbase
        GIT_REPOSITORY      "https://github.com/cmusphinx/sphinxbase.git"
        GIT_TAG             "e34b1c632392276101ed16e8a05862e43f038a7c"
        SOURCE_DIR          ${CMAKE_CURRENT_SOURCE_DIR}/lib/sphinxbase
        CONFIGURE_COMMAND   ${CMAKE_CURRENT_SOURCE_DIR}/lib/sphinxbase/autogen.sh
        BUILD_COMMAND       make
        UPDATE_COMMAND      ""
        INSTALL_COMMAND     make install
        BUILD_IN_SOURCE     ON
        LOG_DOWNLOAD        ON
        LOG_UPDATE          ON
        LOG_CONFIGURE       ON
        LOG_BUILD           ON
        LOG_TEST            ON
        LOG_INSTALL         ON
    )
    ExternalProject_Get_Property(sphinxbase SOURCE_DIR)
    ExternalProject_Get_Property(sphinxbase BINARY_DIR)
    SET(SPHINXBASE_SOURCE_DIR ${SOURCE_DIR})
    SET(SPHINXBASE_BINARY_DIR ${BINARY_DIR})
    SET(SPHINXBASE_LIBRARIES ${SPHINXBASE_BINARY_DIR}/src/libsphinxbase/.libs/libsphinxbase.a)
    INCLUDE_DIRECTORIES(${SPHINXBASE_SOURCE_DIR}/include)
endif ()
SET(DEPENDENCIES ${DEPENDENCIES} sphinxbase)
SET(LIBS ${LIBS} ${SPHINXBASE_LIBRARIES})

FIND_PACKAGE(pocketsphinx)
if (${POCKETSPHINX_FOUND})
    INCLUDE_DIRECTORIES(${POCKETSPHINX_INCLUDE_DIR}/pocketsphinx/)
    add_definitions( -DMODELDIR="/usr/local/share/pocketsphinx/model")  # TODO: more portable
    SET(DEPENDENCIES ${DEPENDENCIES} pocketsphinx)
else ()
    ExternalProject_Add(
        pocketsphinx
        DEPENDS             sphinxbase
        GIT_REPOSITORY      "https://github.com/cmusphinx/pocketsphinx.git"
        GIT_TAG             "0d41af2efe3f77a3e7f22a54e42684bb1562876d"
        SOURCE_DIR          ${CMAKE_CURRENT_SOURCE_DIR}/lib/pocketsphinx
        CONFIGURE_COMMAND   ${CMAKE_CURRENT_SOURCE_DIR}/lib/pocketsphinx/autogen.sh --prefix=&lt;INSTALL_DIR&gt; --with-sphinxbase=${SPHINXBASE_BINARY_DIR}
        BUILD_COMMAND       make
        UPDATE_COMMAND      ""
        INSTALL_COMMAND     make install
        BUILD_IN_SOURCE     ON
        LOG_DOWNLOAD        ON
        LOG_UPDATE          ON
        LOG_CONFIGURE       ON
        LOG_BUILD           ON
        LOG_TEST            ON
        LOG_INSTALL         ON
        )
    ExternalProject_Get_Property(pocketsphinx SOURCE_DIR)
    ExternalProject_Get_Property(pocketsphinx BINARY_DIR)
    SET(POCKETSPHINX_SOURCE_DIR ${SOURCE_DIR})
    SET(POCKETSPHINX_BINARY_DIR ${BINARY_DIR})
    SET(POCKETSPHINX_LIBRARIES ${POCKETSPHINX_BINARY_DIR}/src/libpocketsphinx/.libs/libpocketsphinx.a)
    INCLUDE_DIRECTORIES(${POCKETSPHINX_SOURCE_DIR}/include/)
    add_definitions( -DMODELDIR="${POCKETSPHINX_BINARY_DIR}/model")
    SET(DEPENDENCIES ${DEPENDENCIES} pocketsphinx)
endif ()
SET(LIBS ${LIBS} ${POCKETSPHINX_LIBRARIES})

FIND_PACKAGE(PortAudio)
if (${PORTAUDIO_FOUND})
    INCLUDE_DIRECTORIES(${PORTAUDIO_INCLUDE_DIRS})
    SET(DEPENDENCIES ${DEPENDENCIES} PortAudio)
else ()
    ExternalProject_Add(
        PortAudio
        SVN_REPOSITORY      "https://subversion.assembla.com/svn/portaudio/portaudio/trunk/"
        SVN_TRUST_CERT      1
        SOURCE_DIR          ${CMAKE_CURRENT_SOURCE_DIR}/lib/PortAudio
        CONFIGURE_COMMAND   ${CMAKE_CURRENT_SOURCE_DIR}/lib/PortAudio/configure --prefix=&lt;INSTALL_DIR&gt;
        BUILD_COMMAND       make
        UPDATE_COMMAND      ""
        INSTALL_COMMAND     make install
        BUILD_IN_SOURCE     ON
        LOG_DOWNLOAD        ON
        LOG_UPDATE          ON
        LOG_CONFIGURE       ON
        LOG_BUILD           ON
        LOG_TEST            ON
        LOG_INSTALL         ON
    )
    ExternalProject_Get_Property(PortAudio SOURCE_DIR)
    ExternalProject_Get_Property(PortAudio BINARY_DIR)
    SET(PORTAUDIO_SOURCE_DIR ${SOURCE_DIR})
    SET(PORTAUDIO_BINARY_DIR ${BINARY_DIR})
    SET(PORTAUDIO_LIBRARIES ${PORTAUDIO_BINARY_DIR}/lib/.libs/libportaudio.dylib)
    INCLUDE_DIRECTORIES(${PORTAUDIO_SOURCE_DIR})
    SET(DEPENDENCIES ${DEPENDENCIES} PortAudio)
endif ()
SET(LIBS ${LIBS} ${PORTAUDIO_LIBRARIES})

FIND_PACKAGE(LibSndFile)
if(${LIBSNDFILE_FOUND})
    INCLUDE_DIRECTORIES(${LIBSNDFILE_INCLUDE_DIRS})
    SET(DEPENDENCIES ${DEPENDENCIES} LibSndFile)
else ()
    ExternalProject_Add(
        LibSndFile
        URL                 "http://www.mega-nerd.com/libsndfile/files/libsndfile-1.0.26.tar.gz"
        CONFIGURE_COMMAND   ${CMAKE_CURRENT_SOURCE_DIR}/lib/LibSndFile/configure --prefix=&lt;INSTALL_DIR&gt; --disable-external-libs
        BUILD_COMMAND       ${MAKE}
        SOURCE_DIR          ${CMAKE_CURRENT_SOURCE_DIR}/lib/LibSndFile
        UPDATE_COMMAND      ""
        INSTALL_COMMAND     make install
        BUILD_IN_SOURCE     ON
        LOG_DOWNLOAD        ON
        LOG_UPDATE          ON
        LOG_CONFIGURE       ON
        LOG_BUILD           ON
        LOG_TEST            ON
        LOG_INSTALL         ON
    )
    ExternalProject_Get_Property(LibSndFile SOURCE_DIR)
    ExternalProject_Get_Property(LibSndFile BINARY_DIR)
    SET(LIBSNDFILE_SOURCE_DIR ${SOURCE_DIR}/src)
    SET(LIBSNDFILE_BINARY_DIR ${BINARY_DIR})
    SET(LIBSNDFILE_LIBRARIES ${LIBSNDFILE_BINARY_DIR}/src/.libs/libsndfile.a)
    INCLUDE_DIRECTORIES(${LIBSNDFILE_SOURCE_DIR})
    SET(DEPENDENCIES ${DEPENDENCIES} LibSndFile)
endif ()
SET(LIBS ${LIBS} ${LIBSNDFILE_LIBRARIES})

# TODO: create FindTritium.cmake
ExternalProject_Add(
    tritium
    GIT_REPOSITORY  "https://github.com/syb0rg/tritium.git"
    GIT_TAG         "f6cd6a750945373b48c05c0f2d682e478e6a719d"
    SOURCE_DIR      ${CMAKE_CURRENT_SOURCE_DIR}/lib/tritium
    UPDATE_COMMAND  ""
    INSTALL_COMMAND make install
    BUILD_IN_SOURCE ON
    LOG_DOWNLOAD    ON
    LOG_UPDATE      ON
    LOG_CONFIGURE   ON
    LOG_BUILD       ON
    LOG_TEST        ON
    LOG_INSTALL     ON
)
ExternalProject_Get_Property(tritium SOURCE_DIR)
ExternalProject_Get_Property(tritium BINARY_DIR)
SET(TRITIUM_SOURCE_DIR ${SOURCE_DIR})
SET(TRITIUM_BINARY_DIR ${BINARY_DIR})
INCLUDE_DIRECTORIES(${TRITIUM_SOURCE_DIR}/include)
SET(TRITIUM_LIBRARIES ${TRITIUM_BINARY_DIR}/libtritium.a)
SET(LIBS ${LIBS} ${TRITIUM_LIBRARIES})
SET(DEPENDENCIES ${DEPENDENCIES} tritium)

INCLUDE_DIRECTORIES(include)
ADD_SUBDIRECTORY(src)

ADD_EXECUTABLE(${PROJECT_NAME}
        $&lt;TARGET_OBJECTS:audio&gt;
        $&lt;TARGET_OBJECTS:util&gt;
        $&lt;TARGET_OBJECTS:main&gt;
        )
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LIBS})
ADD_DEPENDENCIES(${PROJECT_NAME} ${DEPENDENCIES})
</code></pre>

<p>When run, it gives me the following output:</p>

<pre><code>$ cmake ..
-- The C compiler identification is AppleClang 7.3.0.7030029
-- The CXX compiler identification is AppleClang 7.3.0.7030029
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Doxygen: /usr/local/bin/doxygen (found version "1.8.11") 
-- Found sphinxbase: /usr/local/lib/libsphinxbase.dylib  
-- Found pocketsphinx: /usr/local/lib/libpocketsphinx.dylib  
-- Found Portaudio: /usr/local/lib/libportaudio.dylib
-- Found LibSndFile: /usr/local/lib/libsndfile.dylib  
-- Configuring done
CMake Error at CMakeLists.txt:189 (ADD_DEPENDENCIES):
  The dependency target "LibSndFile" of target "Khronos" does not exist.


CMake Error at CMakeLists.txt:189 (ADD_DEPENDENCIES):
  The dependency target "PortAudio" of target "Khronos" does not exist.


CMake Error at CMakeLists.txt:189 (ADD_DEPENDENCIES):
  The dependency target "pocketsphinx" of target "Khronos" does not exist.


CMake Error at CMakeLists.txt:189 (ADD_DEPENDENCIES):
  The dependency target "sphinxbase" of target "Khronos" does not exist.


-- Generating done
-- Build files have been written to: /Users/syb0rg/Dropbox/Development/Khronos/Khronos/build
</code></pre>

<p>Doing research on these errors didn't turn up any results. What is causing these errors in my script?  What should I change to fix them?</p>