diff options
author | LaG1924 <lag1924@gmail.com> | 2021-06-13 10:31:24 +0200 |
---|---|---|
committer | LaG1924 <lag1924@gmail.com> | 2021-06-13 10:31:24 +0200 |
commit | 32c0b8d65b9fde9077f05c1df656a03db6b8cbaf (patch) | |
tree | bc07c87c859dde733c86af6394fc37d1e16146ae | |
parent | Updated build instructions and added MacOS #49 (diff) | |
download | AltCraft-32c0b8d65b9fde9077f05c1df656a03db6b8cbaf.tar AltCraft-32c0b8d65b9fde9077f05c1df656a03db6b8cbaf.tar.gz AltCraft-32c0b8d65b9fde9077f05c1df656a03db6b8cbaf.tar.bz2 AltCraft-32c0b8d65b9fde9077f05c1df656a03db6b8cbaf.tar.lz AltCraft-32c0b8d65b9fde9077f05c1df656a03db6b8cbaf.tar.xz AltCraft-32c0b8d65b9fde9077f05c1df656a03db6b8cbaf.tar.zst AltCraft-32c0b8d65b9fde9077f05c1df656a03db6b8cbaf.zip |
-rw-r--r-- | CMakeLists.txt | 54 |
1 files changed, 37 insertions, 17 deletions
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 $<BUILD_INTERFACE:${lua_SOURCE_DIR}>) + 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) |