slight restructure of CMakeLists
This commit is contained in:
parent
2126f3cddb
commit
08fd5970a1
@ -187,7 +187,9 @@ function(link_and_include_deps target)
|
||||
endfunction()
|
||||
|
||||
|
||||
function(use_townengine target)
|
||||
function(use_townengine target sources)
|
||||
add_executable(${target} ${sources})
|
||||
|
||||
# system libraries
|
||||
find_library(MATH_LIBRARY m)
|
||||
if(MATH_LIBRARY)
|
||||
@ -219,7 +221,9 @@ endfunction()
|
||||
give_options(${TOWNENGINE_TARGET})
|
||||
link_and_include_deps(${TOWNENGINE_TARGET})
|
||||
|
||||
add_subdirectory(apps/testgame)
|
||||
if (${CMAKE_PROJECT_NAME} MATCHES townengine)
|
||||
add_subdirectory(apps/testgame)
|
||||
endif ()
|
||||
|
||||
# zip up assets
|
||||
# currently, you must run cmake from the project root dir for this to work correctly
|
||||
|
@ -15,8 +15,7 @@ set(SOURCE_FILES
|
||||
game.c
|
||||
)
|
||||
|
||||
add_executable(${PROJECT_NAME} ${SOURCE_FILES})
|
||||
use_townengine(${PROJECT_NAME})
|
||||
use_townengine(${PROJECT_NAME} "${SOURCE_FILES}")
|
||||
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES
|
||||
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
|
@ -23,8 +23,7 @@ set(SOURCE_FILES
|
||||
scenes/ingame.c scenes/ingame.h
|
||||
)
|
||||
|
||||
add_executable(${PROJECT_NAME} ${SOURCE_FILES})
|
||||
use_townengine(${PROJECT_NAME})
|
||||
use_townengine(${PROJECT_NAME} "${SOURCE_FILES}")
|
||||
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES
|
||||
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
|
Loading…
Reference in New Issue
Block a user