From 32c0b8d65b9fde9077f05c1df656a03db6b8cbaf Mon Sep 17 00:00:00 2001 From: LaG1924 Date: Sun, 13 Jun 2021 13:31:24 +0500 Subject: Added RmlUi to CMakeLists.txt --- CMakeLists.txt | 54 +++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 37 insertions(+), 17 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 3343b7e..9f16e78 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -114,23 +114,9 @@ CPMAddPackage( NAME zlib GITHUB_REPOSITORY madler/zlib VERSION 1.2.11 - DOWNLOAD_ONLY ON ) -if(zlib_ADDED) - file(GLOB zlib_sources ${zlib_SOURCE_DIR}/*.c) - add_library(zlib STATIC ${zlib_sources}) - - include(CheckIncludeFile) - check_include_file(unistd.h Z_HAVE_UNISTD_H) - if(Z_HAVE_UNISTD_H) - target_compile_definitions(zlib PRIVATE Z_HAVE_UNISTD_H) - endif() - - if(MSVC) - target_compile_definitions(zlib PRIVATE _CRT_SECURE_NO_DEPRECATE _CRT_NONSTDC_NO_DEPRECATE) - endif() - target_include_directories(zlib PUBLIC ${zlib_SOURCE_DIR}) -endif() +target_include_directories(zlib PUBLIC ${zlib_SOURCE_DIR}) +target_include_directories(zlib PUBLIC ${zlib_BINARY_DIR}) CPMAddPackage( @@ -144,6 +130,14 @@ if(lua_ADDED) list(REMOVE_ITEM lua_sources "${lua_SOURCE_DIR}/lua.c" "${lua_SOURCE_DIR}/luac.c" "${lua_SOURCE_DIR}/onelua.c") add_library(lua STATIC ${lua_sources}) target_include_directories(lua SYSTEM PUBLIC $) + install(TARGETS lua + EXPORT lua-targets + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ) + install(EXPORT lua-targets DESTINATION ${LIB_INSTALL_DIR}/lua_ac/cmake) + export(EXPORT lua-targets) endif() @@ -160,6 +154,28 @@ if(sol2_ADDED) endif() +CPMAddPackage( + NAME freetype + GITHUB_REPOSITORY aseprite/freetype2 + VERSION 2.10.0 + GIT_TAG VER-2-10-0 +) +export(EXPORT freetype-targets) + +CPMAddPackage( + NAME RmlUi + GITHUB_REPOSITORY mikke89/RmlUi + VERSION 4.0 + GIT_TAG 4.0 + OPTIONS + "BUILD_SHARED_LIBS OFF" + "BUILD_TESTING OFF" + "BUILD_SAMPLES OFF" + "BUILD_LUA_BINDINGS ON" +) +target_link_libraries(RmlCore freetype lua) +target_compile_definitions(RmlCore PUBLIC RMLUI_STATIC_LIB) + ########### # AltCraft ########### @@ -186,9 +202,11 @@ target_link_libraries(AltCraft OptickCore zlib sol2 + RmlLua + RmlDebugger ) -set_target_properties(AltCraft SDL2 OptickCore PROPERTIES +set_target_properties(AltCraft SDL2 OptickCore zlib PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} ) @@ -198,6 +216,8 @@ set_target_properties(AltCraft PROPERTIES CXX_STANDARD_REQUIRED ON ) +target_include_directories(AltCraft PRIVATE ${RmlUi_SOURCE_DIR}/Include) + set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT AltCraft) if(MSVC AND CMAKE_BUILD_TYPE MATCHES Release) -- cgit v1.2.3 From e5da79b7bb1f0db50085df8eef905502d98617aa Mon Sep 17 00:00:00 2001 From: LaG1924 Date: Sun, 13 Jun 2021 13:53:13 +0500 Subject: Removed ImGui --- CMakeLists.txt | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 9f16e78..a26b8f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -78,19 +78,6 @@ if(stb_ADDED) endif() -CPMAddPackage( - NAME imgui - GITHUB_REPOSITORY ocornut/imgui - VERSION 1.52 - DOWNLOAD_ONLY TRUE -) -if(imgui_ADDED) - file(GLOB imgui_sources ${imgui_SOURCE_DIR}/*.cpp) - add_library(imgui STATIC ${imgui_sources}) - target_include_directories(imgui SYSTEM PUBLIC $) -endif() - - CPMAddPackage( NAME SDL2_net GITHUB_REPOSITORY libsdl-org/SDL_net @@ -195,7 +182,6 @@ target_link_libraries(AltCraft easyloggingpp libglew_static nlohmann_json::nlohmann_json - imgui SDL2 SDL2main SDL2_net -- cgit v1.2.3 From 124f0b9c54f7dc394809d9244d7c7896c108135b Mon Sep 17 00:00:00 2001 From: LaG1924 Date: Sun, 13 Jun 2021 15:50:43 +0500 Subject: Fixed Linux build of RmlUi --- CMakeLists.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index a26b8f8..ac3c254 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -107,16 +107,16 @@ target_include_directories(zlib PUBLIC ${zlib_BINARY_DIR}) CPMAddPackage( - NAME lua + NAME Lua GITHUB_REPOSITORY lua/lua VERSION 5.4.3 DOWNLOAD_ONLY YES ) -if(lua_ADDED) - file(GLOB lua_sources ${lua_SOURCE_DIR}/*.c) - list(REMOVE_ITEM lua_sources "${lua_SOURCE_DIR}/lua.c" "${lua_SOURCE_DIR}/luac.c" "${lua_SOURCE_DIR}/onelua.c") - add_library(lua STATIC ${lua_sources}) - target_include_directories(lua SYSTEM PUBLIC $) +if(Lua_ADDED) + file(GLOB Lua_sources ${Lua_SOURCE_DIR}/*.c) + list(REMOVE_ITEM Lua_sources "${Lua_SOURCE_DIR}/lua.c" "${Lua_SOURCE_DIR}/luac.c" "${Lua_SOURCE_DIR}/onelua.c") + add_library(lua STATIC ${Lua_sources}) + target_include_directories(lua SYSTEM PUBLIC $) install(TARGETS lua EXPORT lua-targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} @@ -142,7 +142,7 @@ endif() CPMAddPackage( - NAME freetype + NAME Freetype GITHUB_REPOSITORY aseprite/freetype2 VERSION 2.10.0 GIT_TAG VER-2-10-0 -- cgit v1.2.3 From 94b3b6b32bc8b996c9689fb89a381cf216353641 Mon Sep 17 00:00:00 2001 From: LaG1924 Date: Thu, 17 Jun 2021 01:56:25 +0500 Subject: Implemented main menu in Rml and improved RmlUi support --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index ac3c254..e7d166a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -206,6 +206,9 @@ target_include_directories(AltCraft PRIVATE ${RmlUi_SOURCE_DIR}/Include) set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT AltCraft) +if (MSVC) + target_compile_options(AltCraft PRIVATE /bigobj) +endif() if(MSVC AND CMAKE_BUILD_TYPE MATCHES Release) set_target_properties(AltCraft PROPERTIES WIN32_EXECUTABLE ON) endif() -- cgit v1.2.3