-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQSFML_EditorWidget.cmake
34 lines (27 loc) · 1.48 KB
/
QSFML_EditorWidget.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
## description: SFML based Game Engine designed to use in Qt applications
include(FetchContent)
function(dep LIBRARY_MACRO_NAME SHARED_LIB STATIC_LIB STATIC_PROFILE_LIB)
# Define the git repository and tag to download from
set(LIB_NAME QSFML_EditorWidget)
set(LIB_MACRO_NAME QSFML_EDITOR_WIDGET_LIBRARY_AVAILABLE)
set(GIT_REPO https://github.com/KROIA/QSFML_EditorWidget.git)
set(GIT_TAG main)
FetchContent_Declare(
${LIB_NAME}
GIT_REPOSITORY ${GIT_REPO}
GIT_TAG ${GIT_TAG}
)
set(${LIB_NAME}_NO_EXAMPLES True)
set(${LIB_NAME}_NO_UNITTESTS True)
message("Downloading dependency: ${LIB_NAME} from: ${GIT_REPO} tag: ${GIT_TAG}")
FetchContent_MakeAvailable(${LIB_NAME})
# Add this library to the specific profiles of this project
list(APPEND DEPS_FOR_SHARED_LIB ${LIB_NAME}_shared)
list(APPEND DEPS_FOR_STATIC_LIB ${LIB_NAME}_static)
list(APPEND DEPS_FOR_STATIC_PROFILE_LIB ${LIB_NAME}_static_profile) # only use for static profiling profile
set(${LIBRARY_MACRO_NAME} "${${LIBRARY_MACRO_NAME}};${LIB_MACRO_NAME}" PARENT_SCOPE)
set(${SHARED_LIB} "${${SHARED_LIB}};${DEPS_FOR_SHARED_LIB}" PARENT_SCOPE)
set(${STATIC_LIB} "${${STATIC_LIB}};${DEPS_FOR_STATIC_LIB}" PARENT_SCOPE)
set(${STATIC_PROFILE_LIB} "${${STATIC_PROFILE_LIB}};${DEPS_FOR_STATIC_PROFILE_LIB}" PARENT_SCOPE)
endfunction()
dep(DEPENDENCY_NAME_MACRO DEPENDENCIES_FOR_SHARED_LIB DEPENDENCIES_FOR_STATIC_LIB DEPENDENCIES_FOR_STATIC_PROFILE_LIB)