“Could NOT find SFML” error in CLion/CMake on Windows 10?
I'm currently trying to integrate SFML into CLion on Windows 10 (I'm not very familiar with SFML or CMake). I've tried a few different things and combinations in my CMakeLists.txt, but I keep getting the same error:
CMake Error at cmake_modules/FindSFML.cmake:199 (message):
Could NOT find SFML (missing: SFML_SYSTEM_LIBRARY SFML_WINDOW_LIBRARY
SFML_GRAPHICS_LIBRARY SFML_NETWORK_LIBRARY SFML_AUDIO_LIBRARY)
Call Stack (most recent call first):
CMakeLists.txt:12 (find_package)
This is my CMakeLists.txt:
cmake_minimum_required(VERSION 3.10)
project(P3)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(SOURCE_FILES main.cpp)
add_executable(P3 ${SOURCE_FILES})
set(SFML_ROOT "C:/SFML-2.5.1")
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})
link_directories("C:/SFML-2.5.1")
target_link_libraries(P3 ${SFML_LIBRARIES})
endif()
I'm not really sure what I'm doing wrong here. I've been at it for a fairly long while and despite countless Google searches and research, I can't seem to find a solution. Any help would be greatly appreciated and thank you in advance.
Also, my FindSFML.cmake file is located in a cmake_modules folder that I created within my project folder that is within my CLionProjects folder if that's useful information.
windows c++11 cmake sfml clion
add a comment |
I'm currently trying to integrate SFML into CLion on Windows 10 (I'm not very familiar with SFML or CMake). I've tried a few different things and combinations in my CMakeLists.txt, but I keep getting the same error:
CMake Error at cmake_modules/FindSFML.cmake:199 (message):
Could NOT find SFML (missing: SFML_SYSTEM_LIBRARY SFML_WINDOW_LIBRARY
SFML_GRAPHICS_LIBRARY SFML_NETWORK_LIBRARY SFML_AUDIO_LIBRARY)
Call Stack (most recent call first):
CMakeLists.txt:12 (find_package)
This is my CMakeLists.txt:
cmake_minimum_required(VERSION 3.10)
project(P3)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(SOURCE_FILES main.cpp)
add_executable(P3 ${SOURCE_FILES})
set(SFML_ROOT "C:/SFML-2.5.1")
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})
link_directories("C:/SFML-2.5.1")
target_link_libraries(P3 ${SFML_LIBRARIES})
endif()
I'm not really sure what I'm doing wrong here. I've been at it for a fairly long while and despite countless Google searches and research, I can't seem to find a solution. Any help would be greatly appreciated and thank you in advance.
Also, my FindSFML.cmake file is located in a cmake_modules folder that I created within my project folder that is within my CLionProjects folder if that's useful information.
windows c++11 cmake sfml clion
add a comment |
I'm currently trying to integrate SFML into CLion on Windows 10 (I'm not very familiar with SFML or CMake). I've tried a few different things and combinations in my CMakeLists.txt, but I keep getting the same error:
CMake Error at cmake_modules/FindSFML.cmake:199 (message):
Could NOT find SFML (missing: SFML_SYSTEM_LIBRARY SFML_WINDOW_LIBRARY
SFML_GRAPHICS_LIBRARY SFML_NETWORK_LIBRARY SFML_AUDIO_LIBRARY)
Call Stack (most recent call first):
CMakeLists.txt:12 (find_package)
This is my CMakeLists.txt:
cmake_minimum_required(VERSION 3.10)
project(P3)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(SOURCE_FILES main.cpp)
add_executable(P3 ${SOURCE_FILES})
set(SFML_ROOT "C:/SFML-2.5.1")
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})
link_directories("C:/SFML-2.5.1")
target_link_libraries(P3 ${SFML_LIBRARIES})
endif()
I'm not really sure what I'm doing wrong here. I've been at it for a fairly long while and despite countless Google searches and research, I can't seem to find a solution. Any help would be greatly appreciated and thank you in advance.
Also, my FindSFML.cmake file is located in a cmake_modules folder that I created within my project folder that is within my CLionProjects folder if that's useful information.
windows c++11 cmake sfml clion
I'm currently trying to integrate SFML into CLion on Windows 10 (I'm not very familiar with SFML or CMake). I've tried a few different things and combinations in my CMakeLists.txt, but I keep getting the same error:
CMake Error at cmake_modules/FindSFML.cmake:199 (message):
Could NOT find SFML (missing: SFML_SYSTEM_LIBRARY SFML_WINDOW_LIBRARY
SFML_GRAPHICS_LIBRARY SFML_NETWORK_LIBRARY SFML_AUDIO_LIBRARY)
Call Stack (most recent call first):
CMakeLists.txt:12 (find_package)
This is my CMakeLists.txt:
cmake_minimum_required(VERSION 3.10)
project(P3)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(SOURCE_FILES main.cpp)
add_executable(P3 ${SOURCE_FILES})
set(SFML_ROOT "C:/SFML-2.5.1")
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})
link_directories("C:/SFML-2.5.1")
target_link_libraries(P3 ${SFML_LIBRARIES})
endif()
I'm not really sure what I'm doing wrong here. I've been at it for a fairly long while and despite countless Google searches and research, I can't seem to find a solution. Any help would be greatly appreciated and thank you in advance.
Also, my FindSFML.cmake file is located in a cmake_modules folder that I created within my project folder that is within my CLionProjects folder if that's useful information.
windows c++11 cmake sfml clion
windows c++11 cmake sfml clion
asked Nov 22 '18 at 4:19
99sp99sp
11
11
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
It seems that cmake cannot find the SFML component.
According to this link(https://en.sfml-dev.org/forums/index.php?topic=24070.0), you can try:
set(SFML_DIR "C:/SFML-2.5.1")
find_package(SFML 2.5 COMPONENTS graphics audio REQUIRED)
Would I still include 'system window network' in the find_package line?
– 99sp
Nov 22 '18 at 21:43
It depens. If you need those components then include it.
– Wei Guo
Nov 23 '18 at 1:40
I tried making those changes, but cmake is still failing to find the SFML components.
– 99sp
Nov 23 '18 at 4:06
Maybe you can replaceFindSFML.cmakewith the latestSFMLConfig.cmakefile. As the post link points out.
– Wei Guo
Nov 23 '18 at 4:23
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53423845%2fcould-not-find-sfml-error-in-clion-cmake-on-windows-10%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
It seems that cmake cannot find the SFML component.
According to this link(https://en.sfml-dev.org/forums/index.php?topic=24070.0), you can try:
set(SFML_DIR "C:/SFML-2.5.1")
find_package(SFML 2.5 COMPONENTS graphics audio REQUIRED)
Would I still include 'system window network' in the find_package line?
– 99sp
Nov 22 '18 at 21:43
It depens. If you need those components then include it.
– Wei Guo
Nov 23 '18 at 1:40
I tried making those changes, but cmake is still failing to find the SFML components.
– 99sp
Nov 23 '18 at 4:06
Maybe you can replaceFindSFML.cmakewith the latestSFMLConfig.cmakefile. As the post link points out.
– Wei Guo
Nov 23 '18 at 4:23
add a comment |
It seems that cmake cannot find the SFML component.
According to this link(https://en.sfml-dev.org/forums/index.php?topic=24070.0), you can try:
set(SFML_DIR "C:/SFML-2.5.1")
find_package(SFML 2.5 COMPONENTS graphics audio REQUIRED)
Would I still include 'system window network' in the find_package line?
– 99sp
Nov 22 '18 at 21:43
It depens. If you need those components then include it.
– Wei Guo
Nov 23 '18 at 1:40
I tried making those changes, but cmake is still failing to find the SFML components.
– 99sp
Nov 23 '18 at 4:06
Maybe you can replaceFindSFML.cmakewith the latestSFMLConfig.cmakefile. As the post link points out.
– Wei Guo
Nov 23 '18 at 4:23
add a comment |
It seems that cmake cannot find the SFML component.
According to this link(https://en.sfml-dev.org/forums/index.php?topic=24070.0), you can try:
set(SFML_DIR "C:/SFML-2.5.1")
find_package(SFML 2.5 COMPONENTS graphics audio REQUIRED)
It seems that cmake cannot find the SFML component.
According to this link(https://en.sfml-dev.org/forums/index.php?topic=24070.0), you can try:
set(SFML_DIR "C:/SFML-2.5.1")
find_package(SFML 2.5 COMPONENTS graphics audio REQUIRED)
answered Nov 22 '18 at 6:56
Wei GuoWei Guo
391212
391212
Would I still include 'system window network' in the find_package line?
– 99sp
Nov 22 '18 at 21:43
It depens. If you need those components then include it.
– Wei Guo
Nov 23 '18 at 1:40
I tried making those changes, but cmake is still failing to find the SFML components.
– 99sp
Nov 23 '18 at 4:06
Maybe you can replaceFindSFML.cmakewith the latestSFMLConfig.cmakefile. As the post link points out.
– Wei Guo
Nov 23 '18 at 4:23
add a comment |
Would I still include 'system window network' in the find_package line?
– 99sp
Nov 22 '18 at 21:43
It depens. If you need those components then include it.
– Wei Guo
Nov 23 '18 at 1:40
I tried making those changes, but cmake is still failing to find the SFML components.
– 99sp
Nov 23 '18 at 4:06
Maybe you can replaceFindSFML.cmakewith the latestSFMLConfig.cmakefile. As the post link points out.
– Wei Guo
Nov 23 '18 at 4:23
Would I still include 'system window network' in the find_package line?
– 99sp
Nov 22 '18 at 21:43
Would I still include 'system window network' in the find_package line?
– 99sp
Nov 22 '18 at 21:43
It depens. If you need those components then include it.
– Wei Guo
Nov 23 '18 at 1:40
It depens. If you need those components then include it.
– Wei Guo
Nov 23 '18 at 1:40
I tried making those changes, but cmake is still failing to find the SFML components.
– 99sp
Nov 23 '18 at 4:06
I tried making those changes, but cmake is still failing to find the SFML components.
– 99sp
Nov 23 '18 at 4:06
Maybe you can replace
FindSFML.cmake with the latest SFMLConfig.cmake file. As the post link points out.– Wei Guo
Nov 23 '18 at 4:23
Maybe you can replace
FindSFML.cmake with the latest SFMLConfig.cmake file. As the post link points out.– Wei Guo
Nov 23 '18 at 4:23
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53423845%2fcould-not-find-sfml-error-in-clion-cmake-on-windows-10%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown