--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -19,7 +19,7 @@ option(WITH_SWIG   "Build all swig bindings"   OFF)
 option(WITH_PYTHON "Build python bindings" OFF)
 option(WITH_JAVA   "Build java bindings"   OFF)
 
-set(LIBKML_DATA_DIR  ${CMAKE_SOURCE_DIR}/testdata CACHE "Directory containing test data" PATH)
+set(LIBKML_DATA_DIR  ${CMAKE_CURRENT_SOURCE_DIR}/testdata CACHE "Directory containing test data" PATH)
 
 #AM_CXXFLAGS = -Wall -Wextra -Wno-unused-parameter -pedantic -fno-rtti
 #AM_TEST_CXXFLAGS = -Wall -Wextra -Wno-unused-parameter -Werror -fno-rtti -DGTEST_HAS_RTTI=0
@@ -30,7 +30,6 @@ set(TEST_FLAGS "-Wall -Wextra -Wno-unused-parameter -fno-rtti -DGTEST_HAS_RTTI=0
 else()
  if(MSVC)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /DUNICODE /D_UNICODE")
-   set(BUILD_SHARED_LIBS OFF)
  endif()
 endif()
 
@@ -80,7 +79,7 @@ set(INSTALL_DIR "${CMAKE_INSTALL_PREFIX}" CACHE "install directory " PATH)
 
 # Path to additional CMake modules
 set(CMAKE_MODULE_PATH
-    ${CMAKE_SOURCE_DIR}/cmake
+    ${CMAKE_CURRENT_SOURCE_DIR}/cmake
     ${CMAKE_MODULE_PATH})
 
 include(LibKMLHelper)
@@ -93,49 +92,7 @@ set(MINIZIP_DEPENDS "" CACHE INTERNAL "MINIZIP_DEPENDS")
 
 set(LIBKML_TARGETS)
 
-find_package(EXPAT)
-if(EXPAT_FOUND)
-  include_directories(${EXPAT_INCLUDE_DIR})
-else()
-  include(External_expat)
-  list(APPEND KMLBASE_DEPENDS EXPAT)
-endif()
-
-find_package(ZLIB 1.2.8)
-if(ZLIB_FOUND)
-  include_directories(${ZLIB_INCLUDE_DIR})
-else()
-  include(External_zlib)
-  list(APPEND KMLBASE_DEPENDS ZLIB)
-  list(APPEND MINIZIP_DEPENDS ZLIB)
-endif()
-
-find_package(MiniZip)
-if(MINIZIP_FOUND)
-  include_directories(${MINIZIP_INCLUDE_DIR})
-else()
-  include(External_minizip)
-  list(APPEND KMLBASE_DEPENDS MINIZIP)
-endif()
-
-find_package(UriParser)
-if(URIPARSER_FOUND)
-  include_directories(${URIPARSER_INCLUDE_DIR})
-else()
-  include(External_uriparser)
-  list(APPEND KMLBASE_DEPENDS URIPARSER)
-endif()
-
-find_package(Boost)
-if(Boost_FOUND)
-  message(STATUS "Found Boost: ${Boost_VERSION}")
-else()
-  include(External_boost)
-  list(APPEND KMLBASE_DEPENDS BOOST)
-  message(STATUS "Found Boost includes: ${Boost_INCLUDE_DIRS}")
-endif()
-
-include_directories(${Boost_INCLUDE_DIRS})
+include_directories(${CONAN_INCLUDE_DIRS_BOOST})
 
 if(WITH_SWIG)
   find_package(SWIG)
@@ -149,16 +106,16 @@ if(WITH_SWIG)
   endif()
 endif()
 
-list(APPEND KMLBASE_LINK_LIBS ${EXPAT_LIBRARY})
-list(APPEND KMLBASE_LINK_LIBS ${ZLIB_LIBRARY})
-list(APPEND KMLBASE_LINK_LIBS ${MINIZIP_LIBRARY})
-list(APPEND KMLBASE_LINK_LIBS ${URIPARSER_LIBRARY})
+list(APPEND KMLBASE_LINK_LIBS "CONAN_PKG::expat")
+list(APPEND KMLBASE_LINK_LIBS "CONAN_PKG::zlib")
+list(APPEND KMLBASE_LINK_LIBS "CONAN_PKG::minizip")
+list(APPEND KMLBASE_LINK_LIBS "CONAN_PKG::uriparser")
 
-include_directories(${CMAKE_SOURCE_DIR}/src)
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)
 
 add_subdirectory(src)
 
-configure_file("${CMAKE_SOURCE_DIR}/cmake/libkml.pc.in"
+configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/libkml.pc.in"
   "${CMAKE_BINARY_DIR}/libkml.pc" @ONLY)
 
 install(FILES ${CMAKE_BINARY_DIR}/libkml.pc
@@ -168,7 +125,7 @@ if(BUILD_TESTING)
   enable_testing()
   find_package(GoogleTest REQUIRED)
   include_directories(${GTEST_INCLUDE_DIR})
-  include_directories(${CMAKE_SOURCE_DIR}/tests)
+  include_directories(${CMAKE_CURRENT_SOURCE_DIR}/tests)
   add_definitions("-DDATADIR=\"${LIBKML_DATA_DIR}\"")
   add_subdirectory(tests)
 endif()
@@ -195,7 +152,7 @@ file(RELATIVE_PATH REL_INCLUDE_DIR "${CMAKE_INSTALL_DIR}"
   "${INCLUDE_INSTALL_DIR}")
 
 # ... for the build tree
-set(CONF_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/src")
+set(CONF_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
 configure_file(cmake/LibKMLConfig.cmake.in
   "${PROJECT_BINARY_DIR}/LibKMLConfig.cmake" @ONLY)
 
