File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,9 +30,9 @@ ELSEIF(WIN32)
3030 # 本工程也支持在windows平台上的mingw环境使用
3131ENDIF ()
3232
33- include_directories (${CGRAPH_PROJECT_ROOT_DIR} /src/ ) # 直接加入"CGraph.h"文件对应的位置
34-
3533# 以下三选一,本地编译执行,推荐OBJECT方式
3634add_library (CGraph OBJECT ${CGRAPH_PROJECT_SRC_LIST} ) # 通过代码编译
3735# add_library(CGraph SHARED ${CGRAPH_PROJECT_SRC_LIST}) # 编译libCGraph动态库
3836# add_library(CGraph STATIC ${CGRAPH_PROJECT_SRC_LIST}) # 编译libCGraph静态库
37+
38+ target_include_directories (CGraph PUBLIC ${CGRAPH_PROJECT_ROOT_DIR} /src/ ) # 直接加入"CGraph.h"文件对应的位置
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ set(CGRAPH_EXAMPLE_LIST
88
99foreach (example ${CGRAPH_EXAMPLE_LIST} )
1010 add_executable (${example}
11- $<TARGET_OBJECTS :CGraph >
1211 ${example} .cpp
1312 )
14- endforeach ()
13+ target_link_libraries (${example} PRIVATE CGraph )
14+ endforeach ()
Original file line number Diff line number Diff line change @@ -34,7 +34,8 @@ set(CGRAPH_TUTORIAL_LIST
3434foreach (tut ${CGRAPH_TUTORIAL_LIST} )
3535 add_executable (${tut}
3636 # 在自己的工程中引入CGraph功能,仅需引入 CGraph-env-include.cmake 后,加入这一句话即可
37- $<TARGET_OBJECTS :CGraph >
3837 ${tut} .cpp
3938 )
39+ target_link_libraries (${tut} PRIVATE CGraph )
40+
4041endforeach ()
You can’t perform that action at this time.
0 commit comments