# CMakeList.txt: 顶层 CMake 项目文件，在此处执行全局配置
# 并包含子项目。
#
cmake_minimum_required (VERSION 3.8)

# 项目名称
set(PROJECT_NAME "after_service")

# 如果支持，请为 MSVC 编译器启用热重载。
if (POLICY CMP0141)
  cmake_policy(SET CMP0141 NEW)
  set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<IF:$<AND:$<C_COMPILER_ID:MSVC>,$<CXX_COMPILER_ID:MSVC>>,$<$<CONFIG:Debug,RelWithDebInfo>:EditAndContinue>,$<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>>")
endif()

project ("${PROJECT_NAME}")

# 添加宏定义
add_definitions(-DASIO2_USE_SSL)

if (MSVC)
    # 添加预处理定义
    add_compile_definitions(_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR=1)
endif()

# 判断平台
if (WIN32)
	#release 链接库生成pdb
	set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi")
	#lib的 release链接库生成pdb
	set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF")
	#exe的 release生成pdb
	set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF")

    set(LIB_PATH "F:/linux/robot/lib/windows/")
    set(INCLUDE_PATH "F:/linux/robot/")
    set(GENERATOR_PATH "D:/generator/")
    add_definitions(-DWINDOWS_BUILD)
elseif(IOS)
    add_definitions(-DIOS_BUILD)
elseif(UNIX)
    set(LIB_PATH "/home/zxw/vscode_project/robot/lib/linux/")
    set(INCLUDE_PATH "/home/zxw/vscode_project/robot/")
    set(GENERATOR_PATH "/home/zxw/tools/generator/")
    add_definitions(-DLINUX_BUILD)
endif()

# 包含子项目。
add_subdirectory ("src")
