27 lines
770 B
CMake
27 lines
770 B
CMake
# Examples CMakeLists.txt
|
|
|
|
# Collect all example source files
|
|
file(GLOB_RECURSE EXAMPLE_SOURCES "*.cpp" "*.cc" "*.cxx")
|
|
|
|
# Create example executables
|
|
foreach(EXAMPLE_SOURCE ${EXAMPLE_SOURCES})
|
|
get_filename_component(EXAMPLE_NAME ${EXAMPLE_SOURCE} NAME_WE)
|
|
add_executable(${EXAMPLE_NAME} ${EXAMPLE_SOURCE})
|
|
|
|
# Link with our library
|
|
target_link_libraries(${EXAMPLE_NAME}
|
|
PRIVATE
|
|
PokemonSim::pokemon_battle_sim
|
|
)
|
|
|
|
# Include directories
|
|
target_include_directories(${EXAMPLE_NAME}
|
|
PRIVATE
|
|
${CMAKE_SOURCE_DIR}/include
|
|
)
|
|
endforeach()
|
|
|
|
# Example of adding examples manually:
|
|
# add_executable(battle_example battle_example.cpp)
|
|
# target_link_libraries(battle_example PRIVATE PokemonSim::pokemon_battle_sim)
|