#-----------------------------------------------------------------------------
# 头文件搜索路径
#-----------------------------------------------------------------------------
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)

# boost
include_directories(D:/vcpkg/installed/x64-windows/include)

# pcl
include_directories(C:/PCL/3rdParty/FLANN/include)    
include_directories(C:/PCL/3rdParty/VTK/include/vtk-9.3)
include_directories(C:/PCL/include/pcl-1.14) 

# qt5
include_directories(C:/Qt/5.15.2/msvc2019_64/include/QtQml)   

# json
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../json)

# qscintilla2
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../qscintilla2)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../qscintilla2/lexers)    
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../qscintilla2/include)    
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../qscintilla2/lexlib)    
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../qscintilla2/Qt4Qt5)    
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../qscintilla2/src)   

# lamptool
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../LAMPTool)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../LAMPTool/include)

# qcustomplot
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../qcustomplot)

# qhexedit
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../qhexedit)

# 内部结构
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/SqliteDBProcess/src)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/modelProcess)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/EchoShowProcess)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/OCCViewer)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/PointCloudProcess)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/SharedModuleLib)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/TableProcess)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/TaskXml)

#-----------------------------------------------------------------------------
# 链接库
#-----------------------------------------------------------------------------

# pcl
link_directories("C:/PCL/3rdParty/FLANN/lib")    
link_directories("C:/VTK/lib") 
link_directories("C:/PCL/lib") 

# 


#-----------------------------------------------------------------------------
# 自动添加include目录
#-----------------------------------------------------------------------------
set(CMAKE_INCLUDE_CURRENT_DIR ON)
find_package(Qt5 REQUIRED COMPONENTS Core Quick Sql Core Xml Opengl Gui Svg Xmlpatterns Uitools Widgets Qml Printsupport Sensors Quickwidgets Quick Concurrent Openglextensions Charts Datavisualization)
find_package(PCL )     
include_directories(${PCL_INCLUDE_DIRS})                
link_directories(${PCL_LIBRARY_DIRS})                   
add_definitions(${PCL_DEFINITIONS})       



#-----------------------------------------------------------------------------
# 添加资源文件
#-----------------------------------------------------------------------------
set(_qrc "${CMAKE_CURRENT_SOURCE_DIR}/../qrc/WBCLFZSystemModule.qrc")

qt5_add_resources(_resource ${_qrc} ${_lang})

#-----------------------------------------------------------------------------
# 源码扫描
#-----------------------------------------------------------------------------
file(GLOB_RECURSE  _ui "*.ui")
file(GLOB_RECURSE  _header "*.h" "*.hxx")
file(GLOB_RECURSE  _source "*.cpp")
qt5_wrap_ui(_interface ${_ui})

#-----------------------------------------------------------------------------
# 添加动态库目标
#-----------------------------------------------------------------------------
add_library(WBCLFZSystemModule STATIC
	${_resource}
	${_interface}
	${_header}
	${_source}
)	

#-----------------------------------------------------------------------------
# 添加接口声明宏
#-----------------------------------------------------------------------------
target_compile_definitions(WBCLFZSystemModule PRIVATE "WBCLFZSystemModule_API")


#-----------------------------------------------------------------------------
# 安装Qt的依赖文件
#-----------------------------------------------------------------------------
get_target_property(_qmake_executable Qt5::qmake IMPORTED_LOCATION)
get_filename_component(_qt_bin_dir "${_qmake_executable}" DIRECTORY)

#-----------------------------------------------------------------------------
# 链接依赖库
#-----------------------------------------------------------------------------
list(APPEND _depend_library qcustomplot  LAMPTool qscintilla2 qhexedit)



list(APPEND _runtimes_libraries
Qt5::DBus  Qt5::Core Qt5::Xml  Qt5::OpenGL Qt5::Gui Qt5::Svg   Qt5::Widgets Qt5::Qml Qt5::DataVisualization Qt5::Charts Qt5::PrintSupport
)

target_include_directories(WBCLFZSystemModule PUBLIC ${Qwt_INCLUDE_DIRS})


target_link_libraries(WBCLFZSystemModule PUBLIC
	${_runtimes_libraries}
	${_depend_library}
	${PCL_LIBRARIES}
)

#-----------------------------------------------------------------------------
# 添加依赖关系
#-----------------------------------------------------------------------------
add_dependencies(WBCLFZSystemModule ${_depend_library})

#-----------------------------------------------------------------------------
# 添加运行时依赖关系
#-----------------------------------------------------------------------------
set(LAMPCAE_WBCLFZSystemModule_Runtimes_Libraries ${_runtimes_libraries} PARENT_SCOPE)



