Skip to content

Commit

Permalink
Split CMakeLists.txt into several smaller files by subdirectory
Browse files Browse the repository at this point in the history
  • Loading branch information
davidstone committed Oct 12, 2024
1 parent c91e20a commit 66bd0c0
Show file tree
Hide file tree
Showing 10 changed files with 782 additions and 735 deletions.
736 changes: 1 addition & 735 deletions CMakeLists.txt

Large diffs are not rendered by default.

570 changes: 570 additions & 0 deletions source/tm/CMakeLists.txt

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions source/tm/ai/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright David Stone 2024.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)

add_executable(ai
main.cpp
)
target_sources(ai PRIVATE
FILE_SET CXX_MODULES
BASE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}"
FILES
parse_args.cpp
print_sizes.cpp
)
target_link_libraries(ai
tm_pokemon_showdown
TBB::tbb
)
set_target_properties(ai PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
)
41 changes: 41 additions & 0 deletions source/tm/clients/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Copyright David Stone 2024.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)

add_library(tm_clients STATIC)
target_sources(tm_clients PUBLIC
FILE_SET CXX_MODULES
BASE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}"
FILES
battle_already_finished.cpp
battle_continues.cpp
battle_finished.cpp
battle_response_error.cpp
check_weathers_match.cpp
client_battle.cpp
determine_selection.cpp
get_team.cpp
invalid_team_file_format.cpp
load_team_from_file.cpp
make_client_battle.cpp
party.cpp
should_accept_challenge.cpp
teams.cpp
turn_count.cpp
)
target_sources(tm_clients PRIVATE
get_team_impl.cpp
make_client_battle_impl.cpp
)
target_link_libraries(tm_clients
PUBLIC
tm_common
tm_netbattle
tm_pokemon_lab
tm_pokemon_online
tm_shoddy_battle
strict_defaults_interface
PRIVATE
strict_defaults
)
26 changes: 26 additions & 0 deletions source/tm/clients/netbattle/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright David Stone 2024.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)

add_library(tm_netbattle STATIC)
target_sources(tm_netbattle PUBLIC
FILE_SET CXX_MODULES
BASE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}"
FILES
file_version.cpp
game_version_to_generation.cpp
id_to_ability.cpp
id_to_gender.cpp
id_to_item.cpp
id_to_move.cpp
id_to_species.cpp
read_team_file.cpp
)
target_link_libraries(tm_netbattle
PUBLIC
tm_common
strict_defaults_interface
PRIVATE
strict_defaults
)
22 changes: 22 additions & 0 deletions source/tm/clients/pokemon_lab/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright David Stone 2024.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)

add_library(tm_pokemon_lab STATIC)
target_sources(tm_pokemon_lab PUBLIC
FILE_SET CXX_MODULES
BASE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}"
FILES
read_team_file.cpp
)
target_sources(tm_pokemon_lab PRIVATE
read_team_file_impl.cpp
)
target_link_libraries(tm_pokemon_lab
PUBLIC
tm_common
strict_defaults_interface
PRIVATE
strict_defaults
)
21 changes: 21 additions & 0 deletions source/tm/clients/pokemon_online/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright David Stone 2024.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)

add_library(tm_pokemon_online STATIC)
target_sources(tm_pokemon_online PUBLIC
FILE_SET CXX_MODULES
BASE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}"
FILES
conversion.cpp
invalid_team_file.cpp
read_team_file.cpp
)
target_link_libraries(tm_pokemon_online
PUBLIC
tm_common
strict_defaults_interface
PRIVATE
strict_defaults
)
22 changes: 22 additions & 0 deletions source/tm/clients/shoddy_battle/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright David Stone 2024.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)

add_library(tm_shoddy_battle STATIC)
target_sources(tm_shoddy_battle PUBLIC
FILE_SET CXX_MODULES
BASE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}"
FILES
read_team_file.cpp
)
target_sources(tm_shoddy_battle PRIVATE
read_team_file_impl.cpp
)
target_link_libraries(tm_shoddy_battle
PUBLIC
tm_common
strict_defaults_interface
PRIVATE
strict_defaults
)
14 changes: 14 additions & 0 deletions source/tm/file_converter/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright David Stone 2024.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)

add_executable(file_converter
main.cpp
)
set_target_properties(file_converter PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
)
target_link_libraries(file_converter
tm_clients
)
43 changes: 43 additions & 0 deletions source/tm/ps_usage_stats/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Copyright David Stone 2024.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)

add_executable(create_selection_weights
create_selection_weights.cpp
)
target_link_libraries(create_selection_weights
tm_pokemon_showdown
)

add_executable(ps_usage_stats_create_teams_file
create_teams_file.cpp
)
target_link_libraries(ps_usage_stats_create_teams_file
tm_pokemon_showdown
)

add_executable(ps_usage_stats
main.cpp
)
target_link_libraries(ps_usage_stats
tm_pokemon_showdown
)

add_executable(ps_usage_stats_create_derivative_stats
create_derivative_stats.cpp
)
target_link_libraries(ps_usage_stats_create_derivative_stats
tm_pokemon_showdown
)

foreach(app
create_selection_weights
ps_usage_stats_create_teams_file
ps_usage_stats
ps_usage_stats_create_derivative_stats
)
set_target_properties(${app} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
)
endforeach()

0 comments on commit 66bd0c0

Please sign in to comment.