title: Error LNK1104: cannot open file 'Debug\MyProjectLib.lib'
body: <p>I have the following <code>CMakeLists.txt</code> file to generate my project based on Qt:</p>
  
  <pre><code>cmake_minimum_required(VERSION 2.8.12)
  project(MyProject)
  
  find_package(Qt5Widgets)
  
  set(MyProjectLib_src ${PROJECT_SOURCE_DIR}/gui.cpp)
  set(MyProjectLib_hdr ${PROJECT_SOURCE_DIR}/gui.h)
  set(MyProjectLib_ui  ${PROJECT_SOURCE_DIR}/gui.ui)
  set(MyProjectBin_src ${PROJECT_SOURCE_DIR}/main.cpp)
  
  qt5_wrap_cpp(MyProjectLib_hdr_moc ${MyProjectLib_hdr})
  qt5_wrap_ui (MyProjectLib_ui_moc  ${MyProjectLib_ui})
  
  include_directories(${PROJECT_SOURCE_DIR})
  include_directories(${PROJECT_BINARY_DIR})
  
  add_library(MyProjectLib SHARED 
      ${MyProjectLib_src}
      ${MyProjectLib_hdr_moc}
      ${MyProjectLib_ui_moc}
  )
  target_link_libraries(MyProjectLib Qt5::Widgets)
  
  add_executable(MyProject ${MyProjectBin_src})
  target_link_libraries(MyProject MyProjectLib)
  </code></pre>
  
  <p>When I try to compile the generated project, I got the following error:</p>
  
  <blockquote>
    <p>error LNK1104: cannot open file 'Debug\MyProjectLib.lib'</p>
  </blockquote>
  
  <p>The corresponding directory <code>Debug</code> contains: </p>
  
  <pre><code>MyPtojectLib.dll
  MyProjectLib.ilk
  MyProjectLib.pdb
  </code></pre>