“Could NOT find SFML” error in CLion/CMake on Windows 10?
up vote
0
down vote
favorite
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 |
up vote
0
down vote
favorite
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 |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
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 at 4:19
99sp
11
11
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
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 at 21:43
It depens. If you need those components then include it.
– Wei Guo
Nov 23 at 1:40
I tried making those changes, but cmake is still failing to find the SFML components.
– 99sp
Nov 23 at 4:06
Maybe you can replaceFindSFML.cmake
with the latestSFMLConfig.cmake
file. As the post link points out.
– Wei Guo
Nov 23 at 4:23
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
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 at 21:43
It depens. If you need those components then include it.
– Wei Guo
Nov 23 at 1:40
I tried making those changes, but cmake is still failing to find the SFML components.
– 99sp
Nov 23 at 4:06
Maybe you can replaceFindSFML.cmake
with the latestSFMLConfig.cmake
file. As the post link points out.
– Wei Guo
Nov 23 at 4:23
add a comment |
up vote
0
down vote
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 at 21:43
It depens. If you need those components then include it.
– Wei Guo
Nov 23 at 1:40
I tried making those changes, but cmake is still failing to find the SFML components.
– 99sp
Nov 23 at 4:06
Maybe you can replaceFindSFML.cmake
with the latestSFMLConfig.cmake
file. As the post link points out.
– Wei Guo
Nov 23 at 4:23
add a comment |
up vote
0
down vote
up vote
0
down vote
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 at 6:56
Wei Guo
381212
381212
Would I still include 'system window network' in the find_package line?
– 99sp
Nov 22 at 21:43
It depens. If you need those components then include it.
– Wei Guo
Nov 23 at 1:40
I tried making those changes, but cmake is still failing to find the SFML components.
– 99sp
Nov 23 at 4:06
Maybe you can replaceFindSFML.cmake
with the latestSFMLConfig.cmake
file. As the post link points out.
– Wei Guo
Nov 23 at 4:23
add a comment |
Would I still include 'system window network' in the find_package line?
– 99sp
Nov 22 at 21:43
It depens. If you need those components then include it.
– Wei Guo
Nov 23 at 1:40
I tried making those changes, but cmake is still failing to find the SFML components.
– 99sp
Nov 23 at 4:06
Maybe you can replaceFindSFML.cmake
with the latestSFMLConfig.cmake
file. As the post link points out.
– Wei Guo
Nov 23 at 4:23
Would I still include 'system window network' in the find_package line?
– 99sp
Nov 22 at 21:43
Would I still include 'system window network' in the find_package line?
– 99sp
Nov 22 at 21:43
It depens. If you need those components then include it.
– Wei Guo
Nov 23 at 1:40
It depens. If you need those components then include it.
– Wei Guo
Nov 23 at 1:40
I tried making those changes, but cmake is still failing to find the SFML components.
– 99sp
Nov 23 at 4:06
I tried making those changes, but cmake is still failing to find the SFML components.
– 99sp
Nov 23 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 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 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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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