logo
down
shadow

SFML Compilation with CMake. sh.exe not in my PATH


SFML Compilation with CMake. sh.exe not in my PATH

By : mehr naz
Date : November 14 2020, 04:48 PM
should help you out It's an (odd) limitation of CMake.
If you use MSYS with MinGW, you'll have an sh.exe in your bin/ directory which is added to PATH, thus you need to choose the MSYS Makefiles generator.
code :


Share : facebook icon twitter icon
SFML compilation libGLEW

SFML compilation libGLEW


By : Farhaan Mohammed
Date : March 29 2020, 07:55 AM
seems to work fine I reinstalled manually the library :
Go to http://glew.sourceforge.net/ Select 1.7.0 Go to ~/Downloads/ tar -xvf glew-1.7.0/ cd glew-1.7.0 make sudo cp /lib/* /usr/lib/
Cmake links multiple versions of boost/Cmake separate compilation of source files

Cmake links multiple versions of boost/Cmake separate compilation of source files


By : larry10
Date : March 29 2020, 07:55 AM
Setup CMake with SFML in VS2017

Setup CMake with SFML in VS2017


By : Roshan
Date : March 29 2020, 07:55 AM
I wish did fix the issue. Just like in CLion I want to use SFML with Visual Studio 2017, but I'm still learning cmake and I don't know the commands or the logic of how cmake works at all. I've just seen some posts and got this litle script. , Your script is perfectly fine, except three things I'd change:
code :
#sets up the minimum version of cmake
cmake_minimum_required(VERSION 3.9) # personally I'd set this version as low as required; you don't have to require the cutting edge version

#how the project will be called
project (space_impact)

#set the C++ standard to be used
set (CMAKE_CXX_STANDARD 11)

#set source files
set (SOURCE_FILES main.cpp)

#look for SFML and add it
set (CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/SFML/cmake-modules/")
find_package (SFML REQUIRED system window graphics network audio)

include_directories(${SFML_INCLUDE_DIR})

#we add the executable of the program
add_executable (space_impact ${SOURCE_FILES})
target_link_libraries(space_impact ${SFML_LIBRARIES} ${SFML_DEPENDENCIES})
cmake -G "Visual Studio 15 2017" -DSFML_ROOT=path/to/sfml path/to/source
Projects generated by cmake have absolute path, causing difficulty in compilation across different machines

Projects generated by cmake have absolute path, causing difficulty in compilation across different machines


By : JH231
Date : March 29 2020, 07:55 AM
I wish this help you The way CMake works is that you should regenerate it on every machine. You should not add generated projects to source control.
The absolute path is a CMake issue, not a FlatBuffers issue (you're using the wrong tag).
How do I use SFML with CMake FetchContent?

How do I use SFML with CMake FetchContent?


By : user3550029
Date : March 29 2020, 07:55 AM
This might help you The variables are wrong. https://cmake.org/cmake/help/v3.16/module/FetchContent.html states that has to be lower case. Also squareskittles is right, you shouldn't use ${SFML_LIBRARIES} / ${SFML_INCLUDE_DIR}, this is only valid if the old FindSFML.cmake is used.
code :
cmake_minimum_required(VERSION 3.10)

include(FetchContent)

project(2DComputerGraphics)

set(CMAKE_CXX_STANDARD 17)

set(SFML_VERSION "2.5.1")

FetchContent_Declare(
    sfml
    GIT_REPOSITORY "https://github.com/SFML/SFML.git"
    GIT_TAG        "${SFML_VERSION}"
)

FetchContent_GetProperties(sfml)
if(NOT sfml_POPULATED)
    FetchContent_Populate(sfml)
    add_subdirectory(${sfml_SOURCE_DIR} ${sfml_BINARY_DIR})
endif()

set(SOURCE
    main.cpp
)

add_executable(2DComputerGraphicsApp
    ${SOURCE}
)

target_link_libraries(2DComputerGraphicsApp
    PRIVATE
        sfml-audio
        sfml-graphics
        sfml-system
        sfml-window
)

target_compile_options(2DComputerGraphicsApp PRIVATE -Wall)
shadow
Privacy Policy - Terms - Contact Us © ourworld-yourmove.org