2022-07-30 12:24:03 -04:00
|
|
|
if (NOT DEFINED GEODE_TARGET_PLATFORM)
|
|
|
|
if(APPLE)
|
|
|
|
if(IOS)
|
|
|
|
set(GEODE_TARGET_PLATFORM "iOS")
|
|
|
|
else()
|
|
|
|
set(GEODE_TARGET_PLATFORM "MacOS")
|
|
|
|
endif()
|
|
|
|
elseif(WIN32)
|
|
|
|
set(GEODE_TARGET_PLATFORM "Win32")
|
2023-06-05 20:42:22 -04:00
|
|
|
elseif(ANDROID)
|
2023-12-23 08:10:23 -05:00
|
|
|
if (ANDROID_ABI STREQUAL "arm64-v8a")
|
|
|
|
set(GEODE_TARGET_PLATFORM "Android64")
|
|
|
|
elseif(ANDROID_ABI STREQUAL "armeabi-v7a")
|
|
|
|
set(GEODE_TARGET_PLATFORM "Android32")
|
|
|
|
endif()
|
2022-07-30 12:24:03 -04:00
|
|
|
else()
|
|
|
|
message(FATAL_ERROR "Unable to detect platform, please set GEODE_TARGET_PLATFORM in the root CMake file.")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (NOT ${PROJECT_NAME} STREQUAL ${CMAKE_PROJECT_NAME})
|
|
|
|
set(GEODE_TARGET_PLATFORM GEODE_TARGET_PLATFORM PARENT_SCOPE)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (GEODE_TARGET_PLATFORM STREQUAL "iOS")
|
|
|
|
set_target_properties(${PROJECT_NAME} PROPERTIES
|
|
|
|
SYSTEM_NAME iOS
|
|
|
|
OSX_SYSROOT ${GEODE_IOS_SDK}
|
|
|
|
OSX_ARCHITECTURES arm64
|
|
|
|
)
|
|
|
|
|
2023-12-23 08:15:55 -05:00
|
|
|
set(GEODE_OUTPUT_NAME "GeodeIOS")
|
2022-07-30 12:24:03 -04:00
|
|
|
set(GEODE_PLATFORM_BINARY "GeodeIOS.dylib")
|
|
|
|
elseif (GEODE_TARGET_PLATFORM STREQUAL "MacOS")
|
|
|
|
set_target_properties(${PROJECT_NAME} PROPERTIES
|
|
|
|
SYSTEM_NAME MacOS
|
|
|
|
APPLE_SILICON_PROCESSOR x86_64
|
|
|
|
)
|
|
|
|
|
2023-03-20 17:23:32 -04:00
|
|
|
# this should be set globally
|
|
|
|
set(CMAKE_OSX_ARCHITECTURES "x86_64")
|
|
|
|
|
2023-01-31 05:11:31 -05:00
|
|
|
# only exists as a global property
|
2023-08-29 21:03:45 -04:00
|
|
|
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.13)
|
2023-01-31 05:11:31 -05:00
|
|
|
|
2023-08-04 14:22:09 -04:00
|
|
|
find_package(CURL REQUIRED)
|
|
|
|
|
|
|
|
target_include_directories(${PROJECT_NAME} INTERFACE
|
|
|
|
${CURL_INCLUDE_DIR}
|
|
|
|
)
|
|
|
|
|
2023-04-03 01:21:23 -04:00
|
|
|
target_link_libraries(${PROJECT_NAME} INTERFACE
|
2023-08-04 14:22:09 -04:00
|
|
|
"-framework Cocoa"
|
2023-09-10 08:53:34 -04:00
|
|
|
"-framework OpenGL"
|
2023-08-04 14:22:09 -04:00
|
|
|
${CURL_LIBRARIES}
|
2023-04-03 01:21:23 -04:00
|
|
|
${GEODE_LOADER_PATH}/include/link/libfmod.dylib
|
|
|
|
)
|
2022-07-30 12:24:03 -04:00
|
|
|
|
2023-11-21 12:10:19 -05:00
|
|
|
target_compile_definitions(${PROJECT_NAME} INTERFACE
|
|
|
|
-DCommentType=CommentTypeDummy
|
|
|
|
)
|
|
|
|
|
2023-12-23 08:15:55 -05:00
|
|
|
set(GEODE_OUTPUT_NAME "Geode")
|
2022-07-30 12:24:03 -04:00
|
|
|
set(GEODE_PLATFORM_BINARY "Geode.dylib")
|
|
|
|
|
|
|
|
elseif (GEODE_TARGET_PLATFORM STREQUAL "Win32")
|
|
|
|
set_target_properties(${PROJECT_NAME} PROPERTIES
|
|
|
|
SYSTEM_NAME Win32
|
|
|
|
GENERATOR_PLATFORM x86
|
|
|
|
)
|
|
|
|
|
2022-12-31 07:33:15 -05:00
|
|
|
target_compile_definitions(${PROJECT_NAME} INTERFACE NOMINMAX)
|
2022-07-30 12:24:03 -04:00
|
|
|
|
|
|
|
target_link_libraries(${PROJECT_NAME} INTERFACE
|
|
|
|
${GEODE_LOADER_PATH}/include/link/libcocos2d.lib
|
|
|
|
${GEODE_LOADER_PATH}/include/link/libExtensions.lib
|
|
|
|
${GEODE_LOADER_PATH}/include/link/libcurl.lib
|
2022-12-11 12:43:34 -05:00
|
|
|
${GEODE_LOADER_PATH}/include/link/glew32.lib
|
2023-02-01 17:03:01 -05:00
|
|
|
${GEODE_LOADER_PATH}/include/link/gdstring.lib
|
2022-12-11 12:43:34 -05:00
|
|
|
${GEODE_LOADER_PATH}/include/link/fmod.lib
|
2022-07-30 12:24:03 -04:00
|
|
|
)
|
|
|
|
|
2022-08-08 18:13:21 -04:00
|
|
|
# Windows links against .lib and not .dll
|
2023-12-23 08:15:55 -05:00
|
|
|
set(GEODE_OUTPUT_NAME "Geode")
|
2022-08-08 18:13:21 -04:00
|
|
|
set(GEODE_PLATFORM_BINARY "Geode.lib")
|
2023-12-23 08:10:23 -05:00
|
|
|
elseif (GEODE_TARGET_PLATFORM STREQUAL "Android32")
|
|
|
|
set_target_properties(${PROJECT_NAME} PROPERTIES
|
|
|
|
SYSTEM_NAME Android
|
|
|
|
)
|
|
|
|
|
|
|
|
target_link_libraries(${PROJECT_NAME} INTERFACE
|
|
|
|
${GEODE_LOADER_PATH}/include/link/android32/libcurl.a
|
|
|
|
${GEODE_LOADER_PATH}/include/link/android32/libssl.a
|
|
|
|
${GEODE_LOADER_PATH}/include/link/android32/libcrypto.a
|
|
|
|
${GEODE_LOADER_PATH}/include/link/android32/libcocos2dcpp.so
|
|
|
|
log
|
|
|
|
)
|
|
|
|
|
2023-12-23 09:28:42 -05:00
|
|
|
set(GEODE_OUTPUT_NAME "Geode.armeabi-v7a")
|
|
|
|
set(GEODE_PLATFORM_BINARY "Geode.armeabi-v7a.so")
|
2023-12-23 08:10:23 -05:00
|
|
|
|
|
|
|
elseif (GEODE_TARGET_PLATFORM STREQUAL "Android64")
|
2023-06-05 20:42:22 -04:00
|
|
|
set_target_properties(${PROJECT_NAME} PROPERTIES
|
|
|
|
SYSTEM_NAME Android
|
|
|
|
)
|
|
|
|
|
|
|
|
target_link_libraries(${PROJECT_NAME} INTERFACE
|
2023-12-23 09:28:42 -05:00
|
|
|
# ${GEODE_LOADER_PATH}/include/link/android64/libcurl.a
|
|
|
|
# ${GEODE_LOADER_PATH}/include/link/android64/libssl.a
|
|
|
|
# ${GEODE_LOADER_PATH}/include/link/android64/libcrypto.a
|
|
|
|
# ${GEODE_LOADER_PATH}/include/link/android64/libcocos2dcpp.so
|
2023-06-05 20:42:22 -04:00
|
|
|
log
|
|
|
|
)
|
|
|
|
|
2023-12-23 09:28:42 -05:00
|
|
|
set(GEODE_OUTPUT_NAME "Geode.arm64-v8a")
|
|
|
|
set(GEODE_PLATFORM_BINARY "Geode.arm64-v8a.so")
|
2023-12-23 08:10:23 -05:00
|
|
|
else()
|
|
|
|
message(FATAL_ERROR "Unknown platform ${GEODE_TARGET_PLATFORM}")
|
2022-07-30 12:24:03 -04:00
|
|
|
endif()
|