使用Clion和SFML设置项目是可行的,但这只是第一次

时间:2018-09-23 19:43:29

标签: c++ sfml clion

因此,我像这样建立我的Cloin / SFML项目:configure SFML for clion (windows)

并添加了SFML_ROOT变量,然后它仅工作一次,并且每次我尝试在第一次运行后也都运行它时,出现此错误(gam是项目名称,已在CMakeLists.txt文件中正确设置) :

mingw32-make.exe:***没有使目标“ gam”成为规则。停止。

我如何使它不止一次地工作?(这可能是我愚蠢的事情,因为我单击了错误的按钮来运行该程序。我是Clion和cmake的新手)

CMakeLists.txt:

 func createDirectory(atPath path: String, 
   withIntermediateDirectories createIntermediates: Bool, 
      attributes: [FileAttributeKey : Any]? = nil) throws

项目首次初始化时CMake的输出:

cmake_minimum_required(VERSION 3.12)
project(gam)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(SOURCE_FILES main.cpp)

add_executable(gam ${SOURCE_FILES})

set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake_modules")
find_package(SFML REQUIRED system window graphics network audio)
if (SFML_FOUND)
    include_directories(${SFML_INCLUDE_DIR})
    target_link_libraries(gam ${SFML_LIBRARIES})
endif()

重新加载项目时CMake的输出:

"C:\Program Files\JetBrains\CLion 2018.2.4\bin\cmake\win\bin\cmake.exe" -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - MinGW Makefiles" D:\programierzeug\c++\test
-- The C compiler identification is GNU 8.1.0
-- The CXX compiler identification is GNU 8.1.0
-- Check for working C compiler: C:/Program Files (x86)/mingw-w64/i686-8.1.0-posix-dwarf-rt_v6-rev0/mingw32/bin/gcc.exe
-- Check for working C compiler: C:/Program Files (x86)/mingw-w64/i686-8.1.0-posix-dwarf-rt_v6-rev0/mingw32/bin/gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files (x86)/mingw-w64/i686-8.1.0-posix-dwarf-rt_v6-rev0/mingw32/bin/g++.exe
-- Check for working CXX compiler: C:/Program Files (x86)/mingw-w64/i686-8.1.0-posix-dwarf-rt_v6-rev0/mingw32/bin/g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: D:/programierzeug/c++/test/cmake-build-debug

[Finished]

0 个答案:

没有答案