diff -r 2b4f361e3891 -r 629d5123a979 CMakeLists.txt --- a/CMakeLists.txt Sat Sep 28 22:27:13 2024 +0200 +++ b/CMakeLists.txt Tue Dec 31 15:19:43 2024 +0100 @@ -1,9 +1,7 @@ -cmake_minimum_required(VERSION 2.6.4) - -project(hedgewars) +cmake_minimum_required(VERSION 3.12.0) #initialise cmake environment -foreach(hwpolicy CMP0003 CMP0012 CMP0017 CMP0018) +foreach(hwpolicy CMP0003 CMP0012 CMP0017 CMP0018 CMP0048) if(POLICY ${hwpolicy}) cmake_policy(SET ${hwpolicy} NEW) endif() @@ -15,6 +13,8 @@ endif() endforeach() +project(hedgewars VERSION 1.1.0) + set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules") include(${CMAKE_MODULE_PATH}/utils.cmake) @@ -89,14 +89,11 @@ set(FONTS_DIRS "" CACHE STRING "Additional paths to folders where required fonts can be found ( ; is separator)") #versioning -set(CPACK_PACKAGE_VERSION_MAJOR 1) -set(CPACK_PACKAGE_VERSION_MINOR 1) -set(CPACK_PACKAGE_VERSION_PATCH 0) set(HEDGEWARS_PROTO_VER 60) if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")) - set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") + set(HEDGEWARS_VERSION "${CMAKE_PROJECT_VERSION_MAJOR}.${CMAKE_PROJECT_VERSION_MINOR}.${CMAKE_PROJECT_VERSION_PATCH}") else() - set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-dev") + set(HEDGEWARS_VERSION "${CMAKE_PROJECT_VERSION_MAJOR}.${CMAKE_PROJECT_VERSION_MINOR}.${CMAKE_PROJECT_VERSION_PATCH}-dev") endif() include(${CMAKE_MODULE_PATH}/revinfo.cmake) @@ -109,7 +106,6 @@ #platform specific init code include(${CMAKE_MODULE_PATH}/platform.cmake) - #when build type is not specified, assume Debug/Release according to build version information if(CMAKE_BUILD_TYPE) if(NOT((CMAKE_BUILD_TYPE STREQUAL "Release") OR @@ -139,10 +135,10 @@ add_flag_append(CMAKE_CXX_FLAGS_DEBUG "/Od") else() add_flag_append(CMAKE_C_FLAGS "-Wall -pipe") - add_flag_append(CMAKE_C_FLAGS_RELEASE "-O2") + add_flag_append(CMAKE_C_FLAGS_RELEASE "-O3") add_flag_append(CMAKE_C_FLAGS_DEBUG "-Wextra -O0") add_flag_append(CMAKE_CXX_FLAGS "-Wall -pipe") - add_flag_append(CMAKE_CXX_FLAGS_RELEASE "-O2") + add_flag_append(CMAKE_CXX_FLAGS_RELEASE "-O3") add_flag_append(CMAKE_CXX_FLAGS_DEBUG "-Wextra -O0") endif() @@ -265,9 +261,17 @@ find_package_or_disable_msg(LIBAV NOVIDEOREC "Video recording will not be built") + #physfs helper library add_subdirectory(misc/libphyslayer) + +#rust libraries +add_subdirectory(tools/corrosion) +corrosion_import_crate(MANIFEST_PATH rust/lib-hwengine-future/Cargo.toml) +corrosion_install(TARGETS hwengine_future EXPORT hwengine_future_install_target) +install(EXPORT hwengine_future_install_target DESTINATION ${target_library_install_dir}) + #maybe this could be merged inside hedgewars/CMakeLists.txt if(BUILD_ENGINE_C) #pascal to c converter