title: PCL 1.8.1 CMake Problems on windows
body: <p>I have followed the instructions on <a href="http://unanancyowen.com/en/pcl181" rel="nofollow noreferrer">this</a> page to install PCL 1.8.1 on my Windows 10 computer. No errors occured during the installation process and the installer quit successfully. My <code>CMakeLists.txt</code> looks like this:</p>
  
  <pre><code>cmake_minimum_required(VERSION 3.8)
  project(MyProject)
  
  set(CMAKE_CXX_STANDARD 11)
  
  find_package(PCL 1.8 REQUIRED)
  include_directories(${PCL_INCLUDE_DIRS})
  link_directories(${PCL_LIBRARY_DIRS})
  add_definitions(${PCL_DEFINITIONS})
  
  set(SOURCE_FILES source/main.cpp)
  add_executable(MyProject ${SOURCE_FILES})
  target_link_libraries(MyProject ${PCL_LIBRARIES})
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>CMake Error at /cygdrive/c/Program Files/PCL 1.8.1/cmake/PCLConfig.cmake:44 (message):
    PCL can not be found on this machine
  Call Stack (most recent call first):
    /cygdrive/c/Program Files/PCL 1.8.1/cmake/PCLConfig.cmake:768 (pcl_report_not_found)
    CMakeLists.txt:6 (find_package)
  </code></pre>
  
  <p>I am using Jetbrains CLion for development and CygWin for GCC, CMake and GDB. When I look into the <code>PCLConfig.cmake</code> file at lines 744-769 I find something strange:</p>
  
  <pre><code># check whether PCLConfig.cmake is found into a PCL installation or in a build tree
  if(EXISTS "${PCL_ROOT}/include/pcl-${PCL_VERSION_MAJOR}.${PCL_VERSION_MINOR}/pcl/pcl_config.h")
      # Found a PCL installation
      # pcl_message("Found a PCL installation")
      set(PCL_INCLUDE_DIRS "${PCL_ROOT}/include/pcl-${PCL_VERSION_MAJOR}.${PCL_VERSION_MINOR}")
      set(PCL_LIBRARY_DIRS "${PCL_ROOT}/lib")
      if(EXISTS "${PCL_ROOT}/3rdParty")
          set(PCL_ALL_IN_ONE_INSTALLER ON)
      endif(EXISTS "${PCL_ROOT}/3rdParty")
  
   elseif(EXISTS "${PCL_ROOT}/include/pcl/pcl_config.h")
      # Found a non-standard (likely ANDROID) PCL installation
      # pcl_message("Found a PCL installation")
      ... 
  
   elseif(EXISTS "${PCL_DIR}/include/pcl/pcl_config.h")
      # Found PCLConfig.cmake in a build tree of PCL
      # pcl_message("PCL found into a build tree.")
      ...
  
   else(EXISTS "${PCL_ROOT}/include/pcl-${PCL_VERSION_MAJOR}.${PCL_VERSION_MINOR}/pcl/pcl_config.h")
      pcl_report_not_found("PCL can not be found on this machine")  
   endif(EXISTS "${PCL_ROOT}/include/pcl-${PCL_VERSION_MAJOR}.${PCL_VERSION_MINOR}/pcl/pcl_config.h")
  </code></pre>
  
  <p>The first if-condition <code>if(EXISTS "${PCL_ROOT}/include/pcl-${PCL_VERSION_MAJOR}.${PCL_VERSION_MINOR}/pcl/pcl_config.h")</code> is true. I have checked it. In the directory <code>C:/Program Files/PCL 1.8.1//include/pcl-1.8/pcl/</code> exists a file named <code>pcl_config.h</code>, but for some reason the last condition <code>else(EXISTS "${PCL_ROOT}/include/pcl-${PCL_VERSION_MAJOR}.${PCL_VERSION_MINOR}/pcl/pcl_config.h")</code> is exactly the same, and therefore also true. That's where the error comes from. I have no idea, what I should do now. Should I change the CMake file, so that only the first condition is true? Please help me.</p>
  
  <p>Best regards, YpsilonZett</p>