2021-11-28 10:19:13 +00:00
|
|
|
cmake_minimum_required (VERSION 3.8)
|
2021-09-26 15:24:15 +00:00
|
|
|
|
2022-04-20 15:38:29 +00:00
|
|
|
# Set module name
|
|
|
|
string (REGEX REPLACE ".*/(.*)" "\\1" MODULE_NAME ${CMAKE_CURRENT_SOURCE_DIR})
|
2021-11-28 10:19:13 +00:00
|
|
|
message (STATUS "Configuring module: " ${MODULE_NAME})
|
2021-09-26 15:24:15 +00:00
|
|
|
|
2022-04-20 15:38:29 +00:00
|
|
|
# Add target
|
2021-09-26 15:24:15 +00:00
|
|
|
file (GLOB_RECURSE MODULE_SOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/Source/*")
|
|
|
|
add_library (${MODULE_NAME} ${MODULE_SOURCE_FILES})
|
|
|
|
target_compile_definitions (${MODULE_NAME} PRIVATE "MODULE_NAME=${MODULE_NAME}")
|
|
|
|
|
2022-04-20 15:38:29 +00:00
|
|
|
# Add include directories
|
2021-09-26 15:24:15 +00:00
|
|
|
target_include_directories (${MODULE_NAME} PUBLIC "Source/Public")
|
|
|
|
target_include_directories (${MODULE_NAME} PRIVATE "Source/Private")
|
|
|
|
|
2022-04-20 15:38:29 +00:00
|
|
|
# Define API macro
|
2021-09-26 15:24:15 +00:00
|
|
|
string (TOUPPER ${MODULE_NAME} MODULE_API)
|
|
|
|
string (REGEX REPLACE "[^A-Z ^0-1]" "" MODULE_API ${MODULE_API})
|
|
|
|
set (MODULE_API "${MODULE_API}_API")
|
|
|
|
target_compile_definitions (${MODULE_NAME} PRIVATE "${MODULE_API}=DLLEXPORT")
|
|
|
|
target_compile_definitions (${MODULE_NAME} INTERFACE "${MODULE_API}=DLLIMPORT")
|
|
|
|
|
|
|
|
# Add project dependencies
|
2021-11-28 10:19:13 +00:00
|
|
|
#target_link_libraries (${MODULE_NAME} PRIVATE Redcraft.Utility)
|