CMake: reorder Python detection
[libftdi] / python / CMakeLists.txt
index 4f758d5..5b6f420 100644 (file)
@@ -14,8 +14,8 @@ else ()
     set ( SWIG_FOUND TRUE )
   endif ()
 endif ()
-find_package ( PythonLibs REQUIRED )
 find_package ( PythonInterp REQUIRED )
+find_package ( PythonLibs REQUIRED )
 
 include ( UseSWIG )
 include_directories ( BEFORE ${CMAKE_SOURCE_DIR}/src )
@@ -24,6 +24,8 @@ link_directories ( ${CMAKE_CURRENT_BINARY_DIR}/../src )
 
 if ( DOCUMENTATION )
   set(CMAKE_SWIG_FLAGS -DDOXYGEN=${DOXYGEN_FOUND})
+  # manually add dependency for new cmake / swig versions
+  set_property(SOURCE ftdi1.i PROPERTY DEPENDS ftdi1_doc.i)
 endif()
 if(NOT CMAKE_VERSION VERSION_LESS 3.8.0)
   swig_add_library ( ftdi1 LANGUAGE python SOURCES ftdi1.i )