提问人:Mannat Aggarwal 提问时间:11/14/2023 最后编辑:Abderrahmene Rayene MihoubMannat Aggarwal 更新时间:11/14/2023 访问量:29
cmakelist:错误:没有将目标设置为“all”的规则。停
cmakelist: error: No rule to make target 'all'. Stop
问:
我收到此错误:
No rule to make target 'all'. Stop.
这是我的CMake文件,我在Qt上运行它。
cmake_minimum_required(VERSION 3.0)
project(sorting-visualizer)
set(SFML_DIR "C:\\SFML-2.5.1\\lib\\cmake\\SFML")
set(SFML_ROOT "C:/SFML-2.5.1")
list(APPEND CMAKE_MODULE_PATH "C:\\SFML-2.5.1\\lib\\cmake\\SFML")
find_package(SFML COMPONENTS graphics window REQUIRED)
# Add your source files
add_executable(sorting-visualizer src/main.cpp src/Sortable.cpp src/SortAlgorithms.cpp src/SortController.cpp src/Utils.cpp)
include_directories("C:/SFML/include")
link_directories("C:/SFML/lib")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMake/Modules")
target_link_libraries(sorting-visualizer sfml-graphics)
add_custom_command(TARGET sorting-visualizer POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
"${SFML_ROOT}/bin" $<TARGET_FILE_DIR:sorting-visualizer>)
如何解决这个错误?
答: 暂无答案
评论