From 75aeecb0cf1300683f70d5f14f4033ba2f12cc57 Mon Sep 17 00:00:00 2001 From: Samuel Nicholas Date: Wed, 23 Oct 2024 16:42:31 +1030 Subject: [PATCH] preliminary cmake file --- CMakeLists.txt | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..481219d --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,38 @@ +cmake_minimum_required(VERSION 3.28) + +# The name of the project is used for the build target +project( godot-cpp-template + VERSION 1.0 + DESCRIPTION "" + LANGUAGES CXX) + +if( CMAKE_C_COMPILER ) + #Silence unused variable when specified from toolchain +endif () + +add_subdirectory( godot-cpp ) + +add_library( ${PROJECT_NAME} SHARED ) + +target_sources( ${PROJECT_NAME} + PRIVATE + src/register_types.cpp + src/register_types.h +) + +target_link_libraries( ${PROJECT_NAME} PRIVATE godot-cpp ) + +set( ARCH_NAME_AMD64 x86_64 ) + +set( PLATFORM_NAME "$>") +set( TARGET_NAME "$>") +set( DOUBLE "$<$:.double>") +set( ARCH_NAME ${ARCH_NAME_${CMAKE_SYSTEM_PROCESSOR}}) + +set_target_properties( ${PROJECT_NAME} + PROPERTIES + #The generator expression here prevents a subdir from being created. + RUNTIME_OUTPUT_DIRECTORY "$<$:${CMAKE_RUNTIME_OUTPUT_DIRECTORY}>" + # godot..[.dev][.double].[.custom_suffix][.console].exe + OUTPUT_NAME "${PROJECT_NAME}.${PLATFORM_NAME}.${TARGET_NAME}${DOUBLE}.${ARCH_NAME}" +)