CMake: Replace link_directories with target_link_directories
This commit is contained in:
@@ -14,11 +14,6 @@ if(BUILD_FEM_NETGEN)
|
||||
add_definitions(-DFCWithNetgen ${NETGEN_DEFINITIONS})
|
||||
endif(BUILD_FEM_NETGEN)
|
||||
|
||||
|
||||
|
||||
link_directories(${SMESH_LIB_PATH})
|
||||
|
||||
|
||||
set(Fem_LIBS
|
||||
Part
|
||||
FreeCADApp
|
||||
@@ -213,6 +208,7 @@ target_include_directories(
|
||||
${VTK_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
target_link_directories(Fem PUBLIC ${SMESH_LIB_PATH})
|
||||
target_link_libraries(Fem ${Fem_LIBS} ${VTK_LIBRARIES})
|
||||
if (FREECAD_WARN_ERROR)
|
||||
target_compile_warn_error(Fem)
|
||||
|
||||
@@ -13,8 +13,6 @@ if(BUILD_FEM_NETGEN)
|
||||
add_definitions(-DFCWithNetgen)
|
||||
endif(BUILD_FEM_NETGEN)
|
||||
|
||||
link_directories(${SMESH_LIB_PATH})
|
||||
|
||||
set(FemGui_LIBS
|
||||
Fem
|
||||
FreeCADGui
|
||||
@@ -403,6 +401,8 @@ target_include_directories(
|
||||
${SMESH_INCLUDE_DIR}
|
||||
${VTK_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
target_link_directories(FemGui PUBLIC ${SMESH_LIB_PATH})
|
||||
target_link_libraries(FemGui ${FemGui_LIBS} ${VTK_LIBRARIES})
|
||||
if (FREECAD_WARN_ERROR)
|
||||
target_compile_warn_error(FemGui)
|
||||
|
||||
@@ -10,8 +10,6 @@ if(BUILD_MATERIAL_EXTERNAL)
|
||||
add_definitions(-DBUILD_MATERIAL_EXTERNAL)
|
||||
endif(BUILD_MATERIAL_EXTERNAL)
|
||||
|
||||
link_directories(${YAML_CPP_LIBRARY_DIR})
|
||||
|
||||
set(Materials_LIBS
|
||||
FreeCADApp
|
||||
)
|
||||
@@ -165,6 +163,7 @@ if(BUILD_MATERIAL_EXTERNAL)
|
||||
target_include_directories(Materials PUBLIC ${CMAKE_SOURCE_DIR}/src/3rdParty/lru-cache/include)
|
||||
endif(BUILD_MATERIAL_EXTERNAL)
|
||||
|
||||
target_link_directories(Materials PUBLIC ${YAML_CPP_LIBRARY_DIR})
|
||||
target_link_libraries(Materials ${Materials_LIBS})
|
||||
|
||||
if(FREECAD_WARN_ERROR)
|
||||
|
||||
@@ -9,8 +9,6 @@ if(BUILD_FEM_NETGEN)
|
||||
add_definitions(-DHAVE_NETGEN)
|
||||
endif(BUILD_FEM_NETGEN)
|
||||
|
||||
link_directories(${SMESH_LIB_PATH})
|
||||
|
||||
set(MeshPartGui_LIBS
|
||||
MeshPart
|
||||
PartGui
|
||||
@@ -75,6 +73,8 @@ target_include_directories(
|
||||
${CMAKE_SOURCE_DIR}/src
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
|
||||
target_link_directories(MeshPartGui PUBLIC ${SMESH_LIB_PATH})
|
||||
target_link_libraries(MeshPartGui ${MeshPartGui_LIBS})
|
||||
if (FREECAD_WARN_ERROR)
|
||||
target_compile_warn_error(MeshPartGui)
|
||||
|
||||
@@ -2,7 +2,6 @@ include_directories(
|
||||
SYSTEM
|
||||
${CMAKE_SOURCE_DIR}/src/3rdParty/json/single_include/nlohmann/
|
||||
)
|
||||
link_directories(${OCC_LIBRARY_DIR})
|
||||
|
||||
generate_from_py(Body)
|
||||
generate_from_py(Feature)
|
||||
@@ -143,6 +142,7 @@ target_include_directories(
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
|
||||
target_link_directories(PartDesign PUBLIC ${OCC_LIBRARY_DIR})
|
||||
target_link_libraries(PartDesign ${PartDesign_LIBS})
|
||||
if (FREECAD_WARN_ERROR)
|
||||
target_compile_warn_error(PartDesign)
|
||||
|
||||
@@ -73,7 +73,7 @@ endif(FREECAD_USE_PCH)
|
||||
target_sources(Points PRIVATE ${Points_SRCS} ${Points_Scripts})
|
||||
|
||||
if (NOT FREECAD_USE_EXTERNAL_E57FORMAT)
|
||||
link_directories(${CMAKE_BINARY_DIR}/src/3rdParty/libE57Format)
|
||||
target_link_directories(Points PUBLIC ${CMAKE_BINARY_DIR}/src/3rdParty/libE57Format)
|
||||
endif()
|
||||
|
||||
target_link_libraries(Points E57Format ${Points_LIBS})
|
||||
|
||||
@@ -52,7 +52,6 @@ if(FREECAD_USE_PCH)
|
||||
ADD_MSVC_PRECOMPILED_HEADER(Surface PreCompiled.h PreCompiled.cpp PCH_SRCS)
|
||||
endif(FREECAD_USE_PCH)
|
||||
|
||||
link_directories(${OCC_LIBRARY_DIR})
|
||||
add_library(Surface SHARED ${Surface_SRCS})
|
||||
target_include_directories(
|
||||
Surface
|
||||
@@ -71,6 +70,7 @@ target_include_directories(
|
||||
${FREETYPE_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
target_link_directories(Surface PUBLIC ${OCC_LIBRARY_DIR})
|
||||
target_link_libraries(Surface ${Surface_LIBS})
|
||||
if (FREECAD_WARN_ERROR)
|
||||
target_compile_warn_error(Surface)
|
||||
|
||||
@@ -58,7 +58,6 @@ if(FREECAD_USE_PCH)
|
||||
ADD_MSVC_PRECOMPILED_HEADER(SurfaceGui PreCompiled.h PreCompiled.cpp PCH_SRCS)
|
||||
endif(FREECAD_USE_PCH)
|
||||
|
||||
link_directories(${OCC_LIBRARY_DIR})
|
||||
add_library(SurfaceGui SHARED
|
||||
${SurfaceGui_SRCS}
|
||||
${SurfaceGuiIcon_SVG}
|
||||
@@ -74,6 +73,7 @@ target_include_directories(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
target_link_directories(SurfaceGui PUBLIC ${OCC_LIBRARY_DIR})
|
||||
target_link_libraries(SurfaceGui ${SurfaceGui_LIBS})
|
||||
if (FREECAD_WARN_ERROR)
|
||||
target_compile_warn_error(SurfaceGui)
|
||||
|
||||
Reference in New Issue
Block a user