浏览代码

Fixed Python CMakeLists.txt for CMake 3.10.0

`target_link_libraries` creates an error in case one do not specify PUBLIC/PRIVATE for each use of `target_link_libraries` on a target

    -- LTO enabled
    CMake Error at CMakeLists.txt:134 (target_link_libraries):
      The keyword signature for target_link_libraries has already been used with
      the target "pyigl".  All uses of target_link_libraries with a target must
      be either all-keyword or all-plain.

Former-commit-id: 3b9ee80dc744649864f053c192eb7b6406c3ecb3
Guillaume Jacquenot 7 年之前
父节点
当前提交
84e7645d42
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      python/CMakeLists.txt

+ 2 - 2
python/CMakeLists.txt

@@ -131,7 +131,7 @@ if(WIN32)
   # Link against the Python shared library
   # Link against the Python shared library
   # message(FATAL_ERROR ${PYTHON_LIBRARY})
   # message(FATAL_ERROR ${PYTHON_LIBRARY})
   # target_link_libraries(igl ${PYTHON_LIBRARY})
   # target_link_libraries(igl ${PYTHON_LIBRARY})
-  target_link_libraries(pyigl ${PYTHON_LIBRARIES})
+  target_link_libraries(pyigl PRIVATE ${PYTHON_LIBRARIES})
 
 
 elseif(UNIX)
 elseif(UNIX)
   # It's quite common to have multiple copies of the same Python version
   # It's quite common to have multiple copies of the same Python version
@@ -166,7 +166,7 @@ elseif(UNIX)
   else()
   else()
 
 
     if(CHECK_UNDEFINED)
     if(CHECK_UNDEFINED)
-      target_link_libraries(pyigl ${PYTHON_LIBRARIES})
+      target_link_libraries(pyigl PRIVATE ${PYTHON_LIBRARIES})
       set_target_properties(pyigl PROPERTIES LINK_FLAGS "-Wl,--no-undefined")
       set_target_properties(pyigl PROPERTIES LINK_FLAGS "-Wl,--no-undefined")
     endif()
     endif()