|
|
@@ -196,13 +196,13 @@ if(WIN32 AND BUILD_SHARED_LIBS AND BUILD_TESTING)
|
|
|
endif()
|
|
|
|
|
|
if(NOT BUILD_SHARED_LIBS)
|
|
|
- add_definitions(-DRMLUI_STATIC_LIB)
|
|
|
+ list(APPEND CORE_PUBLIC_DEFS -DRMLUI_STATIC_LIB)
|
|
|
message("-- Building static libraries. Make sure to #define RMLUI_STATIC_LIB before including RmlUi in your project.")
|
|
|
endif()
|
|
|
|
|
|
option(NO_THIRDPARTY_CONTAINERS "Only use standard library containers." OFF)
|
|
|
if( NO_THIRDPARTY_CONTAINERS )
|
|
|
- add_definitions(-DRMLUI_NO_THIRDPARTY_CONTAINERS)
|
|
|
+ list(APPEND CORE_PUBLIC_DEFS -DRMLUI_NO_THIRDPARTY_CONTAINERS)
|
|
|
message("-- No third-party containers will be used: Make sure to #define RMLUI_NO_THIRDPARTY_CONTAINERS before including RmlUi in your project.")
|
|
|
endif()
|
|
|
|
|
|
@@ -210,7 +210,7 @@ option(CUSTOM_CONFIGURATION "Customize RmlUi configuration files for overriding
|
|
|
|
|
|
set(CUSTOM_CONFIGURATION_FILE "" CACHE STRING "Custom configuration file to be included in place of <RmlUi/Config/Config.h>.")
|
|
|
if( CUSTOM_CONFIGURATION AND CUSTOM_CONFIGURATION_FILE )
|
|
|
- add_definitions(-DRMLUI_CUSTOM_CONFIGURATION_FILE="${CUSTOM_CONFIGURATION_FILE}")
|
|
|
+ list(APPEND CORE_PUBLIC_DEFS -DRMLUI_CUSTOM_CONFIGURATION_FILE="${CUSTOM_CONFIGURATION_FILE}")
|
|
|
message("-- Including ${CUSTOM_CONFIGURATION_FILE} instead of <RmlUi/Config/Config.h>")
|
|
|
endif ()
|
|
|
|
|
|
@@ -250,7 +250,7 @@ if( ENABLE_TRACY_PROFILING )
|
|
|
message("-- Tracy profiling enabled in configuration 'Tracy'.")
|
|
|
else()
|
|
|
message("-- Tracy profiling enabled.")
|
|
|
- add_definitions(-DRMLUI_ENABLE_PROFILING)
|
|
|
+ list(APPEND CORE_PUBLIC_DEFS -DRMLUI_ENABLE_PROFILING)
|
|
|
endif()
|
|
|
elseif( CMAKE_CONFIGURATION_TYPES )
|
|
|
list(REMOVE_ITEM CMAKE_CONFIGURATION_TYPES Tracy)
|
|
|
@@ -261,7 +261,7 @@ option(ENABLE_SVG_PLUGIN "Enable plugin for SVG images. Requires the lunasvg lib
|
|
|
|
|
|
option(DISABLE_RTTI_AND_EXCEPTIONS "Build with rtti and exceptions disabled." OFF)
|
|
|
if(DISABLE_RTTI_AND_EXCEPTIONS)
|
|
|
- add_definitions(-DRMLUI_USE_CUSTOM_RTTI)
|
|
|
+ list(APPEND CORE_PUBLIC_DEFS -DRMLUI_USE_CUSTOM_RTTI)
|
|
|
message("-- C++ RTTI and exceptions will be disabled: Make sure to #define RMLUI_USE_CUSTOM_RTTI before including RmlUi in your project.")
|
|
|
endif()
|
|
|
|
|
|
@@ -297,6 +297,7 @@ macro(add_common_target_options NAME)
|
|
|
endif()
|
|
|
elseif(MSVC)
|
|
|
target_compile_options(${NAME} PRIVATE /MP /W4 /w44062 /permissive-)
|
|
|
+ target_compile_definitions(${NAME} PRIVATE _CRT_SECURE_NO_WARNINGS)
|
|
|
|
|
|
if(WARNINGS_AS_ERRORS)
|
|
|
target_compile_options(${NAME} PRIVATE /WX)
|
|
|
@@ -321,22 +322,16 @@ include(FileList)
|
|
|
|
|
|
# FreeType
|
|
|
if(NOT NO_FONT_INTERFACE_DEFAULT)
|
|
|
- find_package(Freetype REQUIRED)
|
|
|
-
|
|
|
- if(FREETYPE_FOUND)
|
|
|
- include_directories(${FREETYPE_INCLUDE_DIRS})
|
|
|
- link_directories(${FREETYPE_LINK_DIRS})
|
|
|
- list(APPEND CORE_LINK_LIBS ${FREETYPE_LIBRARY})
|
|
|
- endif()
|
|
|
+ find_package(Freetype REQUIRED)
|
|
|
+ list(APPEND CORE_LINK_LIBS ${FREETYPE_LIBRARIES})
|
|
|
+ list(APPEND CORE_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIRS})
|
|
|
endif()
|
|
|
|
|
|
# Lua
|
|
|
if(BUILD_LUA_BINDINGS)
|
|
|
find_package(Lua REQUIRED)
|
|
|
- if(LUA_FOUND)
|
|
|
- include_directories(${LUA_INCLUDE_DIR})
|
|
|
- list(APPEND LUA_BINDINGS_LINK_LIBS ${LUA_LIBRARIES})
|
|
|
- endif()
|
|
|
+ list(APPEND LUA_BINDINGS_INCLUDE_DIRS ${LUA_INCLUDE_DIR})
|
|
|
+ list(APPEND LUA_BINDINGS_LINK_LIBS ${LUA_LIBRARIES})
|
|
|
endif()
|
|
|
|
|
|
# rlottie
|
|
|
@@ -439,11 +434,8 @@ if( CUSTOM_CONFIGURATION )
|
|
|
endforeach(library ${CUSTOM_LINK_LIBRARIES})
|
|
|
endif()
|
|
|
|
|
|
-
|
|
|
-target_compile_definitions(RmlCore PRIVATE ${CORE_PRIVATE_DEFS})
|
|
|
-
|
|
|
if( MATRIX_ROW_MAJOR )
|
|
|
- target_compile_definitions(RmlCore PUBLIC -DRMLUI_MATRIX_ROW_MAJOR)
|
|
|
+ list(APPEND CORE_PUBLIC_DEFS -DRMLUI_MATRIX_ROW_MAJOR)
|
|
|
endif ()
|
|
|
if( CUSTOM_CONFIGURATION AND CUSTOM_LINK_LIBRARIES )
|
|
|
target_link_libraries(RmlCore PUBLIC ${CUSTOM_LINK_LIBRARIES})
|
|
|
@@ -512,8 +504,6 @@ else(NOT BUILD_FRAMEWORK)
|
|
|
set(RMLUI_EXPORTED_TARGETS ${RMLUI_EXPORTED_TARGETS} ${NAME})
|
|
|
endif(NOT BUILD_FRAMEWORK)
|
|
|
|
|
|
-# Add additional Core include directories
|
|
|
-target_include_directories(RmlCore PRIVATE ${CORE_INCLUDE_DIRS})
|
|
|
|
|
|
# Build Lua bindings
|
|
|
if(BUILD_LUA_BINDINGS)
|
|
|
@@ -566,17 +556,26 @@ endif()
|
|
|
#===================================
|
|
|
|
|
|
if(NOT BUILD_FRAMEWORK)
|
|
|
+ target_include_directories(RmlCore PRIVATE ${CORE_INCLUDE_DIRS})
|
|
|
+ target_include_directories(RmlCore INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/Include> $<INSTALL_INTERFACE:include>)
|
|
|
target_link_libraries(RmlCore ${CORE_LINK_LIBS})
|
|
|
target_link_libraries(RmlDebugger RmlCore)
|
|
|
+ target_compile_definitions(RmlCore PRIVATE ${CORE_PRIVATE_DEFS})
|
|
|
+ target_compile_definitions(RmlCore PUBLIC ${CORE_PUBLIC_DEFS})
|
|
|
else()
|
|
|
+ target_include_directories(RmlUi PRIVATE ${CORE_INCLUDE_DIRS})
|
|
|
target_link_libraries(RmlUi ${CORE_LINK_LIBS})
|
|
|
+ target_compile_definitions(RmlUi PRIVATE ${CORE_PRIVATE_DEFS})
|
|
|
+ target_compile_definitions(RmlUi PUBLIC ${CORE_PUBLIC_DEFS})
|
|
|
endif()
|
|
|
|
|
|
if(BUILD_LUA_BINDINGS)
|
|
|
if(NOT BUILD_FRAMEWORK)
|
|
|
target_link_libraries(RmlLua RmlCore ${LUA_BINDINGS_LINK_LIBS})
|
|
|
+ target_include_directories(RmlLua PRIVATE ${LUA_BINDINGS_INCLUDE_DIRS})
|
|
|
else()
|
|
|
- target_link_libraries(RmlLua RmlUi ${LUA_BINDINGS_LINK_LIBS})
|
|
|
+ target_link_libraries(RmlUi ${LUA_BINDINGS_LINK_LIBS})
|
|
|
+ target_include_directories(RmlUi PRIVATE ${LUA_BINDINGS_INCLUDE_DIRS})
|
|
|
endif()
|
|
|
endif()
|
|
|
|