Utils example
This commit is contained in:
@@ -15,24 +15,29 @@ add_compile_definitions(
|
||||
)
|
||||
|
||||
# Do initial set up depending on the build target type.
|
||||
if(TARGET_TYPE STREQUAL tool)
|
||||
set(TARGET_NAME tool)
|
||||
elseif(TARGET_TYPE STREQUAL test)
|
||||
if(TARGET_TYPE STREQUAL test)
|
||||
set(TARGET_NAME test)
|
||||
else()
|
||||
elseif(TARGET_TYPE STREQUAL game)
|
||||
set(TARGET_NAME ${TARGET_GAME})
|
||||
else()
|
||||
message(FATAL_ERROR "Missing or invalid definition of TARGET_TYPE")
|
||||
endif()
|
||||
|
||||
# Set up the project
|
||||
project(${TARGET_NAME} VERSION 1.0)
|
||||
add_executable(${PROJECT_NAME})
|
||||
|
||||
# Now change sources depending on the target type
|
||||
if(TARGET_TYPE STREQUAL tool)
|
||||
# Variables
|
||||
SET(ROOT_DIR "${CMAKE_SOURCE_DIR}")
|
||||
set(TOOLS_DIR "${ROOT_DIR}/tools")
|
||||
|
||||
elseif(TARGET_TYPE STREQUAL test)
|
||||
# Include tools
|
||||
add_subdirectory(tools)
|
||||
|
||||
# Now change sources depending on the target type
|
||||
if(TARGET_TYPE STREQUAL test)
|
||||
add_subdirectory(test)
|
||||
else()
|
||||
elseif(TARGET_TYPE STREQUAL game)
|
||||
if(TARGET_GAME STREQUAL poker)
|
||||
add_compile_definitions(
|
||||
GAME_NAME="Penny's Poker"
|
||||
@@ -43,8 +48,13 @@ else()
|
||||
GAME_DISPOSE=pokerGameDispose
|
||||
GAME_VERSION=1.0
|
||||
)
|
||||
endif()
|
||||
|
||||
set(DIR_CHARS assets/poker/characters/penny)
|
||||
|
||||
tool_vn_character(penny ${DIR_CHARS}/character.xml ${DIR_CHARS}/bruh.png)
|
||||
|
||||
add_dependencies(${PROJECT_NAME} penny)
|
||||
endif()
|
||||
add_subdirectory(client)
|
||||
endif()
|
||||
|
||||
|
Reference in New Issue
Block a user