Skip to content

Commit 82faca4

Browse files
remove unused commands in CmakeLists.txt
1 parent e917255 commit 82faca4

File tree

5 files changed

+35
-23
lines changed

5 files changed

+35
-23
lines changed

.vscode/settings.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"githubPullRequests.ignoredPullRequestBranches": [
3+
"master"
4+
]
5+
}

CMakeLists.txt

+12-8
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ option(ENABLE_DEMO "build demo program.(Default:ON)" ON)
77
set(DEMO_EXE "demo_widgets")
88

99
# ##############################################################################
10-
# IMPORTANT HINT: Tell CMake where you installed SFML libs & headers (root folder)
10+
# IMPORTANT HINT: Tell CMake absolute directory you installed SFML libs
1111
###############################################################################
1212
##### (WINDOWS)
1313
# set(SFML_HOME "C:/SFML/SFML-2.6.1")
@@ -18,7 +18,7 @@ set(DEMO_EXE "demo_widgets")
1818

1919
set(ENABLE_DEMO TRUE)
2020

21-
# FIND SFML libs
21+
# FIND SFML precompiled libs
2222
find_package(SFML 2.6 REQUIRED COMPONENTS "graphics" "window" "system")
2323
find_package(OpenGL REQUIRED)
2424

@@ -35,7 +35,7 @@ endif()
3535
file(GLOB_RECURSE SFML_WIDGETS_SRC src/Gui/*.cpp src/Gui/**/*.cpp)
3636
add_library(sfml-widgets ${SFML_WIDGETS_SRC})
3737
target_link_libraries(sfml-widgets PUBLIC sfml-graphics sfml-window sfml-system)
38-
target_include_directories(sfml-widgets PUBLIC ${SFML_HOME}/include ${CMAKE_SOURCE_DIR}/src/)
38+
target_include_directories(sfml-widgets PUBLIC ${CMAKE_SOURCE_DIR}/src/)
3939

4040
# show warnings (depending on C++ compiler)
4141
if(MSVC)
@@ -46,6 +46,8 @@ endif()
4646

4747
# ##############################################################################
4848
# Configure build for Sample program
49+
############################ START OF DEMO ###############################
50+
4951
if(ENABLE_DEMO)
5052
file(GLOB DEMO_SRC demo/*.cpp demo/*.mm)
5153

@@ -65,10 +67,14 @@ if(ENABLE_DEMO)
6567
sfml-system)
6668
endif(WIN32)
6769

68-
# COPY resources folder to destination (Windows & Linux)
70+
71+
# INCLUDE SFML Headers
72+
# include_directories(${SFML_HOME}/include)
73+
74+
# COPY RESOURCES TO BUILD FOLDER (Windows & Linux)
75+
#####################################################
6976
if(NOT APPLE)
70-
add_custom_command(
71-
TARGET ${DEMO_EXE}
77+
add_custom_command(TARGET ${DEMO_EXE}
7278
POST_BUILD
7379
COMMAND
7480
${CMAKE_COMMAND} -E copy_directory ${PROJECT_SOURCE_DIR}/demo/resources
@@ -77,6 +83,4 @@ if(ENABLE_DEMO)
7783
endif(ENABLE_DEMO)
7884
############################ END OF DEMO PROGRAM ###############################
7985

80-
# include SFML headers
81-
include_directories(${SFML_HOME}/include)
8286

README.md

+16-13
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,18 @@ A simple GUI module for SFML.
1313
- License: [MIT License](http://opensource.org/licenses/MIT) (See LICENSE file)
1414

1515
## Requirements:
16-
- Download SFML 2.6.x latest stable
16+
- [Download SFML 2.6.x](https://www.sfml-dev.org/download.php) for your platform
1717
- Download latest [CMake Installer](https://cmake.org/download/)
1818

1919
### Windows:
20-
- Visual Studio 2019 or later (select complete "**Desktop C++ Dev**" workload)
21-
- Windows SDK (download using Visual Studio).
20+
- Visual Studio 2022 or later (select complete "**Desktop C++ Development**" workload)
21+
- Windows SDK.
22+
- CMake for VS2022 (download using Visual Studio installer).
2223

2324
### MacOS
2425
- XCode latest with MacOS SDK.
25-
- Extra Apple Developer Tools. After Xcode installs, simply run this in terminal:
26+
- Follow [official guide](https://www.sfml-dev.org/tutorials/2.6/start-osx.php) on installing SFML on MacOS
27+
- Extra Apple Developer Tools. After Xcode installs, run this in Terminal:
2628
```bash
2729
sudo xcode-select --install
2830
```
@@ -32,21 +34,22 @@ A simple GUI module for SFML.
3234
```
3335

3436
### Linux Desktop
35-
- Use your package manager (`apt-get` or `yum`) to download dependencies listed [in official docs](https://www.sfml-dev.org/tutorials/2.6/compile-with-cmake.php#installing-dependencies)
37+
- Use your package manager (`apt-get` or `yum`) to download SFML dev dependencies listed [in official docs](https://www.sfml-dev.org/tutorials/2.6/compile-with-cmake.php#installing-dependencies)
3638

3739
## Building locally
3840

39-
- On Windows, simply open this project in Visual Studio 2019 or later, choose "Release" or "Debug" from top toolbar. Then click "Build".
40-
- If using CMake GUI (all platforms), set "Source Folder" to this project root. Then set "Build Folder" to new _relative_ folder `/build` or `/out`. See image below. Then click "Configure", choose **Unix Makefiles**, then click Generate. Finally, open build folder, then run `make all` in Terminal
41+
- On Windows, open this project in Visual Studio 2022 or later, choose "Release" or "Debug" from top toolbar. Then click "Build" > "Build All".
42+
- If using CMake GUI (all platforms), set "Source Folder" to this project root. Then set "Build Folder" to new _relative_ folder `/build` or `/out`. See image below. Then click "Configure", choose **Unix Makefiles**, then click Generate. Finally, open build folder, then run `make all` in Terminal.
43+
4144
![cmake_screenshot](doc/cmake_gui.png)
4245

43-
- Alternatively, using the CMake CLI on your terminal:
46+
- Alternatively, you can use the CMake CLI on your Terminal:
4447

4548
```bash
4649
mkdir build
4750
cd build
48-
cmake . . -G "Unix MakeFiles"
49-
cmake --build . --config Release --target all -j 10
51+
cmake . .
52+
cmake --build . --config Release --target all
5053
```
5154

5255

@@ -73,8 +76,8 @@ int main()
7376
// Declare menu
7477
gui::Menu menu(app);
7578

76-
gui::Theme::loadFont("resources/tahoma.ttf");
77-
gui::Theme::loadTexture("resources/texture-default.png");
79+
gui::Theme::loadFont("resources/tahoma.ttf"); //TODO handle error
80+
gui::Theme::loadTexture("resources/texture-default.png"); //TODO handle error
7881

7982
// Create some button widget
8083
gui::Button* button = new gui::Button("My button");
@@ -111,7 +114,7 @@ int main()
111114
app.display();
112115
}
113116

114-
return 0;
117+
return EXIT_SUCCESS;
115118
}
116119
```
117120

apple_cmake/MacBundle.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# icon
1+
# app icon
22
set(MACOSX_BUNDLE_ICON_FILE "SfmlWidgets.icns")
33
set(application_icon "${CMAKE_SOURCE_DIR}/demo/resources/${MACOSX_BUNDLE_ICON_FILE}")
44
set_source_files_properties(${application_icon}

apple_cmake/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
## What's this file for?
22

3-
This contains CMake instructions to build MacOS GUI `.app` bundle for the demo. It embeds the icon to the app bundle. It also copies all assets/resources into the bundle at build time. And adds an important `Info.plist` file which contains metadata about the application.
3+
This contains specific CMake instructions to build MacOS GUI `.app` Bundle for the demo. It embeds the icon to the app bundle. It also copies all assets/resources into the Bundle at build time. It additionally adds an important `Info.plist` file which contains metadata about the application.
44

0 commit comments

Comments
 (0)