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 - InterdimensionalCat

Pages: [1]
1
General / Re: Issues migrating an SFML project from Visual Studio to CMake
« on: November 01, 2020, 04:33:08 am »
Thanks for the info. I figured out all of this when testing the program on linux over the past two days except the part about setting the SFML_DIR in the CMake cache. I am pretty new to cmake and I am not sure exactly how to do that. Is there any documentation explaining it?

2
General / Issues migrating an SFML project from Visual Studio to CMake
« on: October 24, 2020, 05:35:49 am »
I have been working on a relatively large project using SFML in Windows (Visual Studio) for a couple years, and I now potential developers who are using linux machines, and I want to make my project cross platform. I am using very few or no windows dependencies, but it seems like migrating the project over to Cmake is the best/only way to make the project cross platform.

I have been working on migrating the project and everything seems set up correctly, but I am getting an error saying "Cannot open include file: 'SFML\Graphics.hpp': No such file or directory", I assume this is an issue with linking the library through CMake, but I cannot figure out what I am doing wrong.

Here is my CMakeLists.txt:
# CMakeList.txt : CMake project for GameEngine2020, include source and define
# project specific logic here.
#
# set minimum version required for CMake
cmake_minimum_required (VERSION 3.8)

set(PROJECT_NAME "GameEngine2020")

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)

project(${PROJECT_NAME})

## If you want to link SFML statically
#set(SFML_STATIC_LIBRARIES TRUE)

## In most cases better set in the CMake cache
set(SFML_DIR "${CMAKE_CURRENT_LIST_DIR}/SFML/lib/cmake/SFML")

#file(GLOB ALL_REQUIRED_DLL "${CMAKE_CURRENT_LIST_DR}/SFML/bin/*.dll")
#file(COPY ${ALL_REQUIRED_DLL} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})

set(SOURCE_FILES
ActionState.h
...
...(all the program files)...
...
TileSet.h
)

find_package(SFML 2.5 COMPONENTS graphics audio main network system window REQUIRED)
add_executable(${PROJECT_NAME} GameEngine2020.cpp GameEngine2020.h)
target_link_libraries(${PROJECT_NAME} sfml-graphics-d sfml-audio-d sfml-system-d sfml-window-d)

The rest of the code is on github here, but I think the issue is something within the CMakeLists.txt: https://github.com/InterdimensionalCat/2020GameEngine.git

EDIT: Solved, I was using ${CMAKE_CURRENT_LIST_DIR} when I should have been using ${PROJECT_SOURCE_DIR} not sure how I made that mistake



Pages: [1]
anything