Google Tests
This commit is contained in:
26
examples/CMakeLists.txt
Normal file
26
examples/CMakeLists.txt
Normal file
@@ -0,0 +1,26 @@
|
||||
# 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)
|
||||
Reference in New Issue
Block a user