1+ # Configuration can be used as a template for custom project, read comments
12cmake_minimum_required (VERSION 3.6)
2- project (gdexample)
3+ project (gdexample LANGUAGES CXX)
4+
5+ set (CMAKE_CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo;MinSizeRel" )
6+ set (GODOT_CPP_PATH ../) # path to godot-cpp repository
37
48add_subdirectory (
5- ../ # path to godot-cpp
9+ ${GODOT_CPP_PATH}
610 ${CMAKE_CURRENT_BINARY_DIR} /godot-cpp # needed because godot-cpp is top directory
711)
812
913# Get Sources
1014file (GLOB_RECURSE SOURCES src/*.c**)
11- file (GLOB_RECURSE HEADERS include /*.h**)
15+ file (GLOB_RECURSE HEADERS src /*.h**)
1216
1317# Define our godot-cpp library
1418if (${PLATFORM} STREQUAL "WEB" )
@@ -18,6 +22,7 @@ if(${PLATFORM} STREQUAL "WEB")
1822 PROPERTIES
1923 PREFIX "lib"
2024 SUFFIX ".wasm"
25+ RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR} /project/bin"
2126 RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_CURRENT_SOURCE_DIR} /project/bin"
2227 RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_CURRENT_SOURCE_DIR} /project/bin"
2328 RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_CURRENT_SOURCE_DIR} /project/bin"
@@ -41,20 +46,21 @@ endif()
4146
4247target_link_libraries (${PROJECT_NAME} PUBLIC godot-cpp)
4348
44- get_directory_property (GODOT_CC_FLAGS DIRECTORY ../ DEFINITION GODOT_CC_FLAGS)
45- get_directory_property (GODOT_CXX_FLAGS DIRECTORY ../ DEFINITION GODOT_CXX_FLAGS)
49+ get_directory_property (GODOT_CC_FLAGS DIRECTORY ${GODOT_CPP_PATH} DEFINITION GODOT_CC_FLAGS)
50+ get_directory_property (GODOT_CXX_FLAGS DIRECTORY ${GODOT_CPP_PATH} DEFINITION GODOT_CXX_FLAGS)
4651target_compile_options (${PROJECT_NAME} PRIVATE
4752 ${GODOT_CC_FLAGS}
4853 ${GODOT_CXX_FLAGS}
4954)
5055
51- get_directory_property (GODOT_LINK_FLAGS DIRECTORY ../ DEFINITION GODOT_LINK_FLAGS)
56+ get_directory_property (GODOT_LINK_FLAGS DIRECTORY ${GODOT_CPP_PATH} DEFINITION GODOT_LINK_FLAGS)
5257target_link_options (${PROJECT_NAME} PRIVATE ${GODOT_LINK_FLAGS} )
5358
5459
55- get_directory_property (LIBRARY_SUFFIX DIRECTORY ../ DEFINITION LIBRARY_SUFFIX)
60+ get_directory_property (LIBRARY_SUFFIX DIRECTORY ${GODOT_CPP_PATH} DEFINITION LIBRARY_SUFFIX)
5661set_target_properties (${PROJECT_NAME}
5762 PROPERTIES
63+ LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR} /project/bin"
5864 LIBRARY_OUTPUT_DIRECTORY_DEBUG "${CMAKE_CURRENT_SOURCE_DIR} /project/bin"
5965 LIBRARY_OUTPUT_DIRECTORY_RELEASE "${CMAKE_CURRENT_SOURCE_DIR} /project/bin"
6066 LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_CURRENT_SOURCE_DIR} /project/bin"
0 commit comments