Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - MS07112

Pages: [1]
1
Here is a cleaner version of the CMakeLists.txt file:

Quote
cmake_minimum_required(VERSION 3.7)
project(Game)

set(CMAKE_CXX_STANDARD 11)

set(SOURCE_FILES main.cpp)
add_executable(Game ${SOURCE_FILES})


# Detect and add SFML
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules" ${CMAKE_MODULE_PATH})
find_package(SFML 2 REQUIRED system window graphics network audio)
if(SFML_FOUND)
    include_directories(${SFML_INCLUDE_DIR})
    target_link_libraries(${PROJECT_NAME} ${SFML_LIBRARIES})
endif()

2
Thank you very much for the advice on CMake, as I'm still very new to its usage.

I tried to use the invocation order listed in the example file you linked, but unfortunately the compiler/linker/??? freaked out (again) and told me this time that it couldn't find SFML. I went back to the old order (which was based on someone's StackOverflow post -- see my GitHub page's README for the link) and it worked (I have no clue).

TBH: I have a limited understanding as to what is going on with CMake, and am basically 'walking on eggshells' whilst hoping that the compiler will have mercy on me and let me write a simple HelloWorld program so I can start learning SFML (instead of how to debug whatever terrible creature lies beneath the IDE  ;D).

The CMake file should definitely be fixed up, but I'm not versed enough in its usage to know what to do. I'd definitely be thankful if  someone could write and upload a suitable example project; as that's what I've been after this whole time.

Thanks

3
:D Hello Everyone, 

I have been trying to successfully compile and run the SFML HelloWorld program in CLion, but was constantly bombarded by CMake linker errors and other problems.

Thankfully though, I have been able to modify the CMake and other settings to get the CLion IDE to successfully compile and run the executable. And have now uploaded the whole project folder to my GitHub so that users trying to develop SFML with CLion can get started easily.

Here's the GitHub page:
https://github.com/MS07112/CLion_SFML_HelloWorld

YouTube video about the CLion project:
https://www.youtube.com/watch?v=SbBz_94bk1Y&feature=youtu.be


This project was done on an Arch-based Linux OS (Manjaro 17.0.2 Gellivara), using the CLion package from the AUR (Arch User Repository).

CPU Architecture:  x86_64
Linux Kernel:  4.9.37

Thanks!

Pages: [1]