$NetBSD: patch-pcbnew_CMakeLists.txt,v 1.3 2016/09/08 09:32:28 bouyer Exp $

Don't use ${CMAKE_MODULE_PATH} directly as it will be changed
and containt multiple directories

Force proper LDFLAGS for MODULE, as cmake doens't set rpath for theses

--- pcbnew/CMakeLists.txt.orig	2018-07-13 19:53:52.000000000 +0000
+++ pcbnew/CMakeLists.txt
@@ -580,7 +580,7 @@ endif()
 
 
 # a very small program launcher for pcbnew_kiface
-add_executable( pcbnew WIN32 MACOSX_BUNDLE
+add_executable( pcbnew WIN32 
     ../common/single_top.cpp
     ${PCBNEW_RESOURCES}
     )
@@ -674,6 +674,9 @@ if( PCBNEW_LINK_MAPS )
         )
 endif()
 
+set_property(TARGET pcbnew_kiface APPEND_STRING
+	PROPERTY LINK_FLAGS " $ENV{LDFLAGS}")
+
 # if building pcbnew, then also build pcbnew_kiface if out of date.
 add_dependencies( pcbnew pcbnew_kiface )
 
