godot-cpp-template/CMakeLists.txt

41 lines
1.3 KiB
CMake
Raw Normal View History

2024-10-23 06:12:31 +00:00
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::editor )
2024-10-23 06:12:31 +00:00
get_target_property( GODOT_PLATFORM godot-cpp::editor GODOT_PLATFORM )
get_target_property( GODOT_TARGET godot-cpp::editor GODOT_TARGET )
get_target_property( GODOT_ARCH godot-cpp::editor GODOT_ARCH )
#get_target_property( GODOT_DEV godot-cpp::editor GODOT_DEV )
#get_target_property( GODOT_DOUBLE godot-cpp::editor GODOT_DOUBLE )
2024-10-23 06:12:31 +00:00
#set( DEV ".${GODOT_DEV}" )
#set( DOUBLE ".${GODOT_DOUBLE}" )
2024-10-23 06:12:31 +00:00
set_target_properties( ${PROJECT_NAME}
PROPERTIES
#The generator expression here prevents a subdir from being created.
RUNTIME_OUTPUT_DIRECTORY "$<1:${CMAKE_RUNTIME_OUTPUT_DIRECTORY}>"
# name format project.<platform>.<target>[.dev][.double].<arch>[.custom_suffix]
OUTPUT_NAME "${PROJECT_NAME}.${GODOT_PLATFORM}.${GODOT_TARGET}${DEV}${DOUBLE}.${GODOT_ARCH}"
2024-10-23 06:12:31 +00:00
)