diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
index 303b8d55f77cd36bc597ddfc406bc5fe7c2992e5..e25948fa14664d9a8b758586a75369ecde111ddb 100644
--- a/tools/CMakeLists.txt
+++ b/tools/CMakeLists.txt
@@ -4,23 +4,23 @@ foreach(file ${srcs_lib})
         set(src "${CMAKE_BINARY_DIR}/lib/build/mc_${file}")
         set_source_files_properties(${src} PROPERTIES GENERATED TRUE)
     else()
-        set(src "${CMAKE_SOURCE_DIR}/lib/${file}")
+        set(src "${PROJECT_SOURCE_DIR}/lib/${file}")
     endif()
     set(srcs_tools ${srcs_tools} ${src})
 endforeach()
 
 add_executable(dmake EXCLUDE_FROM_ALL
         dmake.cpp
-        ${CMAKE_SOURCE_DIR}/cli/filelister.cpp
+        ${PROJECT_SOURCE_DIR}/cli/filelister.cpp
         ${srcs_tools}
-        ${CMAKE_SOURCE_DIR}/lib/utils.cpp
-        ${CMAKE_SOURCE_DIR}/externals/simplecpp/simplecpp
+        ${PROJECT_SOURCE_DIR}/lib/utils.cpp
+        ${PROJECT_SOURCE_DIR}/externals/simplecpp/simplecpp
 )
-target_include_directories(dmake PRIVATE ${CMAKE_SOURCE_DIR}/cli ${CMAKE_SOURCE_DIR}/lib ${CMAKE_SOURCE_DIR}/externals/simplecpp)
+target_include_directories(dmake PRIVATE ${PROJECT_SOURCE_DIR}/cli ${PROJECT_SOURCE_DIR}/lib ${PROJECT_SOURCE_DIR}/externals/simplecpp)
 if (WIN32 AND NOT BORLAND)
     target_link_libraries(dmake Shlwapi.lib)
 endif()
 
 add_custom_target(run-dmake $<TARGET_FILE:dmake>
-        WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+        WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
         DEPENDS dmake)
\ No newline at end of file
