eco2d/code/apps/client/CMakeLists.txt

56 lines
1.2 KiB
CMake
Raw Normal View History

2021-01-10 16:42:01 +00:00
find_package(raylib 3.5 QUIET)
if (NOT raylib_FOUND)
include(FetchContent)
FetchContent_Declare(
raylib
URL https://github.com/raysan5/raylib/archive/master.tar.gz
)
FetchContent_GetProperties(raylib)
if (NOT raylib_POPULATED)
set(FETCHCONTENT_QUIET NO)
FetchContent_Populate(raylib)
set(BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
add_subdirectory(${raylib_SOURCE_DIR} ${raylib_BINARY_DIR})
endif()
endif()
2021-01-11 20:08:16 +00:00
add_library(client-common STATIC
2021-01-10 16:42:01 +00:00
source/network.c
source/game.c
2021-01-11 20:35:43 +00:00
source/main.c
2021-01-11 21:12:26 +00:00
source/signal_handling.c
2021-01-10 16:42:01 +00:00
2021-01-11 21:12:26 +00:00
header/signal_handling.h
2021-01-10 16:42:01 +00:00
header/network.h
2021-01-11 20:11:03 +00:00
header/platform.h
2021-01-10 16:42:01 +00:00
header/game.h
)
2021-01-11 20:08:16 +00:00
add_executable(eco2d-client
2021-01-11 20:11:03 +00:00
source/platform_raylib.c
2021-01-11 20:08:16 +00:00
)
add_executable(eco2d-cli
2021-01-11 20:11:03 +00:00
source/platform_text.c
2021-01-11 20:08:16 +00:00
)
2021-01-10 16:42:01 +00:00
include_directories(header/)
2021-01-11 20:08:16 +00:00
target_link_libraries(eco2d-client raylib client-common)
target_link_libraries(eco2d-cli client-common)
if (WIN32)
2021-01-16 15:49:45 +00:00
target_link_libraries(eco2d-cli winmm)
target_link_libraries(eco2d-client winmm)
elseif (APPLE)
target_link_libraries(eco2d-cli pthread m dl)
target_link_libraries(eco2d-client pthread m dl)
2021-01-11 20:08:16 +00:00
elseif (UNIX)
2021-01-16 15:49:45 +00:00
target_link_libraries(eco2d-cli pthread m dl atomic)
target_link_libraries(eco2d-client pthread m dl atomic)
2021-01-11 20:08:16 +00:00
endif()