1
- cmake_minimum_required (VERSION 3.18 )
1
+ cmake_minimum_required (VERSION 3.20 FATAL_ERROR )
2
2
project (sfml-widgets VERSION 1.1.0)
3
3
4
4
# ##############################################################################
@@ -14,11 +14,10 @@ set(DEMO_EXE "demo_widgets")
14
14
##### (MACOS)
15
15
# set(SFML_HOME "/Library/Frameworks/SFML.framework/")
16
16
17
- # set(SFML_DIR ${SFML_HOME}/lib/cmake/SFML)
18
-
19
17
set (ENABLE_DEMO TRUE )
20
18
21
- # FIND SFML precompiled libs
19
+ # FIND SFML precompiled libs & headers
20
+ # set(SFML_DIR ${SFML_HOME}/lib/cmake/SFML)
22
21
find_package (SFML 2.6 REQUIRED COMPONENTS "graphics" "window" "system" )
23
22
find_package (OpenGL REQUIRED)
24
23
@@ -32,7 +31,7 @@ endif()
32
31
33
32
# ##############################################################################
34
33
# Configure build for SFML Widgets library
35
- file (GLOB_RECURSE SFML_WIDGETS_SRC src/Gui/*.cpp src/Gui/**/*.cpp )
34
+ file (GLOB_RECURSE SFML_WIDGETS_SRC src/Gui/*.cpp)
36
35
add_library (sfml-widgets ${SFML_WIDGETS_SRC} )
37
36
target_link_libraries (sfml-widgets PUBLIC sfml-graphics sfml-window sfml-system )
38
37
target_include_directories (sfml-widgets PUBLIC ${CMAKE_SOURCE_DIR} /src/)
@@ -52,7 +51,7 @@ if(ENABLE_DEMO)
52
51
file (GLOB DEMO_SRC demo/*.cpp demo/*.mm)
53
52
54
53
if (WIN32 )
55
- add_executable (${DEMO_EXE} WIN32 ${DEMO_SRC} )
54
+ add_executable (${DEMO_EXE} WIN32 ${DEMO_SRC} ${CMAKE_SOURCE_DIR} /demo/resources/win-icon.rc )
56
55
target_link_libraries (${DEMO_EXE} PRIVATE sfml-widgets sfml-main OpenGL::GL sfml-graphics
57
56
sfml-window sfml-system )
58
57
@@ -75,8 +74,7 @@ if(ENABLE_DEMO)
75
74
#####################################################
76
75
if (NOT APPLE )
77
76
add_custom_command (TARGET ${DEMO_EXE}
78
- POST_BUILD
79
- COMMAND
77
+ POST_BUILD COMMAND
80
78
${CMAKE_COMMAND} -E copy_directory ${PROJECT_SOURCE_DIR} /demo/resources
81
79
$<TARGET_FILE_DIR:${DEMO_EXE} >/resources)
82
80
endif ()
0 commit comments