On Wed, 2019-10-02 at 10:25 +0100, Stuart Dootson wrote:
> On Wed, 2 Oct 2019 at 10:23, Stuart Dootson <stuart.doot...@gmail.com
> > wrote:
> > There's no problem with the tests per-se - the problem is that the
> > sigc dll is not in the same directory as the test executables. The
> > DLL is in <cmake-build-dir>/sigc++/<Debug/Release>, while the EXEs
> > are in <cmake-build-dir>/tests/<Debug/Release>.
> > 
> > So, options are:
> > 
> > 1. Change the PATH to include the DLL directory before running the
> > tests
> > 2. Copy the DLL to the EXE directory as a post-build action - that
> > can be done with CMake, something like adding this bit of CMake to
> > the function add_sigcpp_test:
> > 
> >   add_custom_command(
> >     TARGET ${test_name}
> >     POST_BUILD
> >     COMMAND ${CMAKE_COMMAND} -E copy
> >         $<TARGET_FILE:sigc-${SIGCXX_API_VERSION}>
> >         ${CMAKE_CURRENT_BINARY_DIR}
> >     VERBATIM
> >   )
> > 
> > 3. Build all targets (DLL & test executables) into the same output
> > directory with something like this bit of CMake:
> > if(MSVC)
> >     set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
> > endif()
> > 
> > 
> 
> I ought to clarify that this should be added to the root
> CMakeList.txt, just after the "project (sigc++)" line.
>  
> > Hope that's of some help...

Thanks. Trying option 3 (putting everything in one bin/ directory)
seems to work, but I find the changes a bit messy:
https://github.com/libsigcplusplus/libsigcplusplus/pull/31

Option 1 (changing the PATH) seems to be the simplest and most correct
way to do it, but I haven't found quite the correct CMake incantation:
https://github.com/libsigcplusplus/libsigcplusplus/pull/32

If you have a Windows system, maybe you could checkout out that branch
and try it out, please.

-- 
Murray Cumming
murr...@murrayc.com
www.murrayc.com


_______________________________________________
libsigc-list mailing list
libsigc-list@gnome.org
https://mail.gnome.org/mailman/listinfo/libsigc-list

Reply via email to