Readded the Linux linker settings I forgot, updated readme
This commit is contained in:
parent
eda2b5b1d5
commit
13285fa7b4
|
@ -5,7 +5,7 @@ project(FROSTBITE)
|
||||||
|
|
||||||
enable_testing()
|
enable_testing()
|
||||||
|
|
||||||
set(PROJECT_NAME "Frostbite")
|
set(PROJECT_NAME "FROSTBITE")
|
||||||
set(PROJECT_Version 0.1)
|
set(PROJECT_Version 0.1)
|
||||||
set(PROJECT_LIBS)
|
set(PROJECT_LIBS)
|
||||||
|
|
||||||
|
@ -117,12 +117,19 @@ set(CUTTOWN_SRC_FILES
|
||||||
CuttownTest/mainWindow.h
|
CuttownTest/mainWindow.h
|
||||||
)
|
)
|
||||||
|
|
||||||
add_library(snowlib STATIC ${SNOWLIB_SRC_FILES})
|
add_library(snowlib SHARED ${SNOWLIB_SRC_FILES})
|
||||||
|
|
||||||
add_executable(testApp ${TESTAPP_SRC_FILES})
|
add_executable(testApp ${TESTAPP_SRC_FILES})
|
||||||
target_link_libraries(testApp snowlib ${Boost_LIBRARIES} ${GLEW_LIBRARIES} SDL2::SDL2 SDL2::SDL2main opengl32.lib)
|
if(WIN32)
|
||||||
|
target_link_libraries(testApp snowlib ${Boost_LIBRARIES} ${GLEW_LIBRARIES} SDL2::SDL2 SDL2::SDL2main OpenGL32.lib)
|
||||||
|
else()
|
||||||
|
target_link_libraries(testApp snowlib ${Boost_LIBRARIES} ${GLEW_LIBRARIES} SDL2::SDL2 SDL2::SDL2main GL)
|
||||||
|
endif()
|
||||||
|
|
||||||
add_executable(cuttownTest ${CUTTOWN_SRC_FILES})
|
add_executable(cuttownTest ${CUTTOWN_SRC_FILES})
|
||||||
target_link_libraries(cuttownTest snowlib ${Boost_LIBRARIES} ${GLEW_LIBRARIES} SDL2::SDL2 SDL2::SDL2main opengl32.lib Qt6::Widgets)
|
if(WIN32)
|
||||||
|
target_link_libraries(cuttownTest snowlib ${Boost_LIBRARIES} ${GLEW_LIBRARIES} SDL2::SDL2 SDL2::SDL2main OpenGL32.lib Qt6::Widgets)
|
||||||
|
else()
|
||||||
|
target_link_libraries(cuttownTest snowlib ${Boost_LIBRARIES} ${GLEW_LIBRARIES} SDL2::SDL2 SDL2::SDL2main GL Qt6::Widgets)
|
||||||
|
endif()
|
||||||
set_target_properties(cuttownTest PROPERTIES VS_DEBUGGER_ENVIRONMENT "PATH=${Qt6Core_DIR}\\..\\..\\..\\bin;${Qt6Core_DIR}\\..\\..\\..\\plugins\\platforms")
|
set_target_properties(cuttownTest PROPERTIES VS_DEBUGGER_ENVIRONMENT "PATH=${Qt6Core_DIR}\\..\\..\\..\\bin;${Qt6Core_DIR}\\..\\..\\..\\plugins\\platforms")
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
|
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <QMainWindow>
|
#include <QMainWindow>
|
||||||
|
|
34
README.md
34
README.md
|
@ -1,7 +1,9 @@
|
||||||
Building
|
# Building
|
||||||
========
|
|
||||||
|
|
||||||
For windows, I use vcpkg to install packages. See https://github.com/Microsoft/vcpkg
|
## Windows
|
||||||
|
|
||||||
|
### Visual Studio with vcpkg
|
||||||
|
Use `vcpkg` to install packages. See https://github.com/Microsoft/vcpkg
|
||||||
|
|
||||||
```
|
```
|
||||||
> git clone https://github.com/Microsoft/vcpkg.git
|
> git clone https://github.com/Microsoft/vcpkg.git
|
||||||
|
@ -13,21 +15,21 @@ Linux:~/$ ./bootstrap-vcpkg.sh
|
||||||
.\vcpkg integrate install
|
.\vcpkg integrate install
|
||||||
```
|
```
|
||||||
|
|
||||||
you will want to install the following packages as follows:
|
You will want to install the following packages as follows:
|
||||||
|
|
||||||
```
|
```
|
||||||
vcpkg install sdl2:x64-windows glm:x64-windows glew:x64-windows boost:x64-windows
|
vcpkg install sdl2:x64-windows glm:x64-windows glew:x64-windows boost:x64-windows
|
||||||
```
|
```
|
||||||
|
|
||||||
Then you can open the directory in visual studio and it will be recognised as a cmake project.
|
Then you can open the directory in Visual Studio and it will be recognised as a CMake project.
|
||||||
Whether you use the open folder functionality or call cmake on the command line you will need to
|
Whether you use the open folder functionality or call `cmake` on the command line you will need to
|
||||||
set the toolchain file to the vcpkg one. This lives in the vcpkg directory under `scripts\buildsystems\vcpkg.cmake`
|
set the toolchain file to the `vcpkg` one. This lives in the `vcpkg` directory under `scripts\buildsystems\vcpkg.cmake`
|
||||||
|
|
||||||
https://github.com/microsoft/vcpkg/blob/master/docs/examples/installing-and-using-packages.md#cmake-toolchain-file
|
https://github.com/microsoft/vcpkg/blob/master/docs/examples/installing-and-using-packages.md#cmake-toolchain-file
|
||||||
|
|
||||||
note that if you do `vcpkg integrate install` then you don't need to set the toolchain when using visual studio 2019
|
Note that if you do `vcpkg integrate install` then you don't need to set the toolchain when using visual studio 2019
|
||||||
|
|
||||||
## Qt specifics
|
### Qt specifics
|
||||||
|
|
||||||
Installing Qt from the installer requires some mods to work. The path to Qt is hardcoded in the cmake file for the moment
|
Installing Qt from the installer requires some mods to work. The path to Qt is hardcoded in the cmake file for the moment
|
||||||
and when running from Visual Studio Code you need something like the following in the launch config so that the
|
and when running from Visual Studio Code you need something like the following in the launch config so that the
|
||||||
|
@ -37,4 +39,16 @@ DLLs are found.
|
||||||
"env": {
|
"env": {
|
||||||
"path": "C:\\Qt\\6.0.2\\msvc2019_64\\bin;%PATH%"
|
"path": "C:\\Qt\\6.0.2\\msvc2019_64\\bin;%PATH%"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Linux
|
||||||
|
|
||||||
|
### CMake
|
||||||
|
|
||||||
|
From the base directory:
|
||||||
|
```
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
cmake ..
|
||||||
|
make -j$(nproc)
|
||||||
|
```
|
||||||
|
|
Reference in a new issue