|
|
@@ -7,25 +7,31 @@ set(CMAKE_C_STANDARD 11) |
|
|
|
# |
|
|
|
if (WIN32) |
|
|
|
# TODO set arch on target instead of generator |
|
|
|
set(PLATFORM WINDOWS) |
|
|
|
set(IZ_PLATFORM WINDOWS) |
|
|
|
set(IZ_CRYPTO_LIBRARIES libcrypto libssl) |
|
|
|
add_definitions( |
|
|
|
-DIZ_WINDOWS |
|
|
|
) |
|
|
|
if (CMAKE_SIZEOF_VOID_P EQUAL 8) |
|
|
|
set(PROJECT_ARCH x64) |
|
|
|
set(IZ_PROJECT_ARCH x64) |
|
|
|
add_definitions( |
|
|
|
-DIZ_WIN64 |
|
|
|
) |
|
|
|
else () |
|
|
|
set(PROJECT_ARCH x86) |
|
|
|
set(IZ_PROJECT_ARCH x86) |
|
|
|
add_definitions( |
|
|
|
-DIZ_WIN32 |
|
|
|
) |
|
|
|
endif () |
|
|
|
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") |
|
|
|
set(PLATFORM MACOS) |
|
|
|
set(IZ_PLATFORM MACOS) |
|
|
|
set(IZ_CRYPTO_LIBRARIES crypto ssl) |
|
|
|
add_definitions( |
|
|
|
-DIZ_MACOS |
|
|
|
) |
|
|
|
else() |
|
|
|
set(PLATFORM UNIX) |
|
|
|
set(IZ_PLATFORM UNIX) |
|
|
|
set(IZ_CRYPTO_LIBRARIES crypto ssl) |
|
|
|
add_definitions( |
|
|
|
-DIZ_UNIX |
|
|
|
) |
|
|
@@ -64,20 +70,23 @@ include_directories( |
|
|
|
"${PROJECT_SOURCE_DIR}/dependencies/spine-runtimes/spine-c/spine-c/include" |
|
|
|
"${PROJECT_SOURCE_DIR}/dependencies/getopt-for-windows" |
|
|
|
"${PROJECT_SOURCE_DIR}/dependencies/libwebsockets/build/include" |
|
|
|
"${PROJECT_SOURCE_DIR}/dependencies/openssl/${PROJECT_ARCH}/include" |
|
|
|
"${PROJECT_SOURCE_DIR}/dependencies/openssl/${IZ_PROJECT_ARCH}/include" |
|
|
|
"${PROJECT_SOURCE_DIR}/dependencies/sqlite" |
|
|
|
) |
|
|
|
|
|
|
|
if (WIN32) |
|
|
|
if (IZ_PLATFORM STREQUAL "WINDOWS") |
|
|
|
link_directories( |
|
|
|
"${PROJECT_SOURCE_DIR}/dependencies/SDL2/lib/${PROJECT_ARCH}" |
|
|
|
"${PROJECT_SOURCE_DIR}/dependencies/SDL2_image/lib/${PROJECT_ARCH}" |
|
|
|
"${PROJECT_SOURCE_DIR}/dependencies/SDL2_ttf/lib/${PROJECT_ARCH}" |
|
|
|
"${PROJECT_SOURCE_DIR}/dependencies/SDL2/lib/${IZ_PROJECT_ARCH}" |
|
|
|
"${PROJECT_SOURCE_DIR}/dependencies/SDL2_image/lib/${IZ_PROJECT_ARCH}" |
|
|
|
"${PROJECT_SOURCE_DIR}/dependencies/SDL2_ttf/lib/${IZ_PROJECT_ARCH}" |
|
|
|
"${PROJECT_SOURCE_DIR}/dependencies/portmidi/Release" |
|
|
|
"${PROJECT_SOURCE_DIR}/dependencies/libwebsockets/build/lib/Release" |
|
|
|
"${PROJECT_SOURCE_DIR}/dependencies/openssl/${PROJECT_ARCH}/lib" |
|
|
|
"${PROJECT_SOURCE_DIR}/dependencies/openssl/${IZ_PROJECT_ARCH}/lib" |
|
|
|
) |
|
|
|
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") |
|
|
|
if (NOT ${CMAKE_BUILD_TYPE} STREQUAL "Debug") |
|
|
|
set(IZ_EXECUTABLE_TYPE WIN32) |
|
|
|
endif() |
|
|
|
elseif(IZ_PLATFORM STREQUAL "MACOS") |
|
|
|
include_directories( |
|
|
|
/usr/local/include |
|
|
|
/usr/local/include/SDL2 |
|
|
@@ -94,6 +103,7 @@ endif() |
|
|
|
# |
|
|
|
add_executable( |
|
|
|
game |
|
|
|
${IZ_EXECUTABLE_TYPE} |
|
|
|
dependencies/minIni/dev/minIni.h |
|
|
|
dependencies/minIni/dev/minIni.c |
|
|
|
dependencies/getopt-for-windows/getopt.h |
|
|
@@ -163,31 +173,16 @@ add_executable( |
|
|
|
src/packages/stdinc/IZ_stdlib.h |
|
|
|
) |
|
|
|
|
|
|
|
if (WIN32) |
|
|
|
target_link_libraries( |
|
|
|
game |
|
|
|
SDL2main |
|
|
|
SDL2 |
|
|
|
SDL2_image |
|
|
|
SDL2_ttf |
|
|
|
portmidi |
|
|
|
libcrypto |
|
|
|
libssl |
|
|
|
websockets |
|
|
|
) |
|
|
|
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") |
|
|
|
target_link_libraries( |
|
|
|
game |
|
|
|
SDL2main |
|
|
|
SDL2 |
|
|
|
SDL2_image |
|
|
|
SDL2_ttf |
|
|
|
portmidi |
|
|
|
crypto |
|
|
|
ssl |
|
|
|
websockets |
|
|
|
) |
|
|
|
endif() |
|
|
|
target_link_libraries( |
|
|
|
game |
|
|
|
SDL2main |
|
|
|
SDL2 |
|
|
|
SDL2_image |
|
|
|
SDL2_ttf |
|
|
|
portmidi |
|
|
|
${IZ_CRYPTO_LIBRARIES} |
|
|
|
websockets |
|
|
|
) |
|
|
|
|
|
|
|
add_executable( |
|
|
|
game-test-geometry |
|
|
@@ -331,25 +326,13 @@ add_executable( |
|
|
|
src/packages/timer/IZ_timer.h |
|
|
|
) |
|
|
|
|
|
|
|
if (WIN32) |
|
|
|
target_link_libraries( |
|
|
|
server |
|
|
|
SDL2main |
|
|
|
SDL2 |
|
|
|
libcrypto |
|
|
|
libssl |
|
|
|
websockets |
|
|
|
) |
|
|
|
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") |
|
|
|
target_link_libraries( |
|
|
|
server |
|
|
|
SDL2main |
|
|
|
SDL2 |
|
|
|
crypto |
|
|
|
ssl |
|
|
|
websockets |
|
|
|
) |
|
|
|
endif() |
|
|
|
target_link_libraries( |
|
|
|
server |
|
|
|
SDL2main |
|
|
|
SDL2 |
|
|
|
${IZ_CRYPTO_LIBRARIES} |
|
|
|
websockets |
|
|
|
) |
|
|
|
|
|
|
|
add_executable( |
|
|
|
asset-inv |
|
|
@@ -362,20 +345,20 @@ add_executable( |
|
|
|
# |
|
|
|
# Add DLLs and required assets to the build directory |
|
|
|
# |
|
|
|
if (WIN32) |
|
|
|
if (IZ_PLATFORM STREQUAL "WINDOWS") |
|
|
|
add_custom_command(TARGET game POST_BUILD |
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different |
|
|
|
"${PROJECT_SOURCE_DIR}/dependencies/SDL2/lib/${PROJECT_ARCH}/SDL2.dll" |
|
|
|
"${PROJECT_SOURCE_DIR}/dependencies/SDL2/lib/${IZ_PROJECT_ARCH}/SDL2.dll" |
|
|
|
$<TARGET_FILE_DIR:game>) |
|
|
|
|
|
|
|
add_custom_command(TARGET game POST_BUILD |
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different |
|
|
|
"${PROJECT_SOURCE_DIR}/dependencies/SDL2_image/lib/${PROJECT_ARCH}/SDL2_image.dll" |
|
|
|
"${PROJECT_SOURCE_DIR}/dependencies/SDL2_image/lib/${IZ_PROJECT_ARCH}/SDL2_image.dll" |
|
|
|
$<TARGET_FILE_DIR:game>) |
|
|
|
|
|
|
|
add_custom_command(TARGET game POST_BUILD |
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different |
|
|
|
"${PROJECT_SOURCE_DIR}/dependencies/SDL2_ttf/lib/${PROJECT_ARCH}/SDL2_ttf.dll" |
|
|
|
"${PROJECT_SOURCE_DIR}/dependencies/SDL2_ttf/lib/${IZ_PROJECT_ARCH}/SDL2_ttf.dll" |
|
|
|
$<TARGET_FILE_DIR:game>) |
|
|
|
|
|
|
|
add_custom_command(TARGET game POST_BUILD |
|
|
@@ -390,17 +373,17 @@ if (WIN32) |
|
|
|
|
|
|
|
add_custom_command(TARGET game POST_BUILD |
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different |
|
|
|
"${PROJECT_SOURCE_DIR}/dependencies/openssl/${PROJECT_ARCH}/bin/libssl-1_1-x64.dll" |
|
|
|
"${PROJECT_SOURCE_DIR}/dependencies/openssl/${IZ_PROJECT_ARCH}/bin/libssl-1_1-x64.dll" |
|
|
|
$<TARGET_FILE_DIR:game>) |
|
|
|
|
|
|
|
add_custom_command(TARGET game POST_BUILD |
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different |
|
|
|
"${PROJECT_SOURCE_DIR}/dependencies/openssl/${PROJECT_ARCH}/bin/libcrypto-1_1-x64.dll" |
|
|
|
"${PROJECT_SOURCE_DIR}/dependencies/openssl/${IZ_PROJECT_ARCH}/bin/libcrypto-1_1-x64.dll" |
|
|
|
$<TARGET_FILE_DIR:game>) |
|
|
|
|
|
|
|
add_custom_command(TARGET server POST_BUILD |
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different |
|
|
|
"${PROJECT_SOURCE_DIR}/dependencies/SDL2/lib/${PROJECT_ARCH}/SDL2.dll" |
|
|
|
"${PROJECT_SOURCE_DIR}/dependencies/SDL2/lib/${IZ_PROJECT_ARCH}/SDL2.dll" |
|
|
|
$<TARGET_FILE_DIR:server>) |
|
|
|
|
|
|
|
add_custom_command(TARGET server POST_BUILD |
|
|
@@ -410,12 +393,12 @@ if (WIN32) |
|
|
|
|
|
|
|
add_custom_command(TARGET server POST_BUILD |
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different |
|
|
|
"${PROJECT_SOURCE_DIR}/dependencies/openssl/${PROJECT_ARCH}/bin/libssl-1_1-x64.dll" |
|
|
|
"${PROJECT_SOURCE_DIR}/dependencies/openssl/${IZ_PROJECT_ARCH}/bin/libssl-1_1-x64.dll" |
|
|
|
$<TARGET_FILE_DIR:server>) |
|
|
|
|
|
|
|
add_custom_command(TARGET server POST_BUILD |
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different |
|
|
|
"${PROJECT_SOURCE_DIR}/dependencies/openssl/${PROJECT_ARCH}/bin/libcrypto-1_1-x64.dll" |
|
|
|
"${PROJECT_SOURCE_DIR}/dependencies/openssl/${IZ_PROJECT_ARCH}/bin/libcrypto-1_1-x64.dll" |
|
|
|
$<TARGET_FILE_DIR:server>) |
|
|
|
endif () |
|
|
|
|
|
|
|