Rename the SixtyFPS CMake interface

This commit is contained in:
Simon Hausmann 2022-02-02 09:52:37 +01:00
parent c333b4de2b
commit b1a70f9e58
31 changed files with 161 additions and 152 deletions

View file

@ -3,18 +3,18 @@
cmake_minimum_required(VERSION 3.14)
if (NOT TARGET SixtyFPS::SixtyFPS)
find_package(SixtyFPS REQUIRED)
if (NOT TARGET Slint::Slint)
find_package(Slint REQUIRED)
endif()
add_executable(memory_tutorial_initial main_initial.cpp)
target_link_libraries(memory_tutorial_initial PRIVATE SixtyFPS::SixtyFPS)
sixtyfps_target_60_sources(memory_tutorial_initial memory.60)
target_link_libraries(memory_tutorial_initial PRIVATE Slint::Slint)
slint_target_sources(memory_tutorial_initial memory.60)
add_executable(memory_tutorial_tiles_from_cpp main_tiles_from_cpp.cpp)
target_link_libraries(memory_tutorial_tiles_from_cpp PRIVATE SixtyFPS::SixtyFPS)
sixtyfps_target_60_sources(memory_tutorial_tiles_from_cpp memory_tiles_from_cpp.60)
target_link_libraries(memory_tutorial_tiles_from_cpp PRIVATE Slint::Slint)
slint_target_sources(memory_tutorial_tiles_from_cpp memory_tiles_from_cpp.60)
add_executable(memory_tutorial_game_logic main_game_logic.cpp)
target_link_libraries(memory_tutorial_game_logic PRIVATE SixtyFPS::SixtyFPS)
sixtyfps_target_60_sources(memory_tutorial_game_logic memory_game_logic.60)
target_link_libraries(memory_tutorial_game_logic PRIVATE Slint::Slint)
slint_target_sources(memory_tutorial_game_logic memory_game_logic.60)

View file

@ -27,13 +27,13 @@ FetchContent_Declare(
FetchContent_MakeAvailable(SixtyFPS)
add_executable(memory_game main.cpp)
target_link_libraries(memory_game PRIVATE SixtyFPS::SixtyFPS)
sixtyfps_target_60_sources(memory_game memory.60)
target_link_libraries(memory_game PRIVATE Slint::Slint)
slint_target_sources(memory_game memory.60)
```
This should look familiar to people familiar with CMake. We see that this CMakeLists.txt
references a `main.cpp`, which we will add later, and it also has a line
`sixtyfps_target_60_sources(memory_game memory.60)`, which is a SixtyFPS function used to
`slint_target_sources(memory_game memory.60)`, which is a SixtyFPS function used to
add the `memory.60` file to the target. We must then create, in the same directory,
the `memory.60` file. Let's just fill it with a hello world for now: