CMake Error
« on: 14 November 2018, 23:04:05 »
Hi,
I'm use CLion on Windows, and i want to use tgui, but i have this cmake error :
The imported target "tgui" references the file "F:/dev/sfml/TGUI-0.8/bin/tgui-d.dll"
There is no error if I make bin directory and put .dll to it, but  then #include <QTGUI/TGUI.hpp> not working. Here is my CMakeLists file :
cmake_minimum_required(VERSION 3.12)
project(newtest)

set(CMAKE_CXX_STANDARD 11)

add_executable(newtest main.cpp)

set(SFML_DIR "F:/dev/sfml/SFML-2.5.1/lib/cmake/SFML")
set(TGUI_DIR "F:/dev/sfml/TGUI-0.8/lib/cmake/TGUI")

find_package(SFML REQUIRED COMPONENTS system window graphics network audio)
find_package(TGUI REQUIRED)

target_link_libraries(newtest PRIVATE tgui sfml-graphics)


How can I solve this problem?

*

texus

  • *****
  • 1280
    • View Profile
    • Texus's Blog
Re: CMake Error
« Reply #1 on: 15 November 2018, 07:59:23 »
The shipped TGUISharedTargets-debug (and the ones for release and static libs) have only recently been added (in 0.8.1), but it was never tested that they work when shipped with my precompiled libraries (since they can contain hardcoded paths). It seems that due to a misconfiguration in the build server they aren't even included in all downloads on the website.

The error is that the files try to get the dll files from a bin folder (which is how things normally get installed when running cmake), but I ship my dlls in a lib folder. So creating the bin folder yourself and copying the dll fildes from the lib folder there is the correct solution.

I'll make sure to place the files in the bin folder next time I create the downloadable libraries.
« Last Edit: 15 November 2018, 08:07:51 by texus »

*

texus

  • *****
  • 1280
    • View Profile
    • Texus's Blog
Re: CMake Error
« Reply #2 on: 17 November 2018, 09:41:13 »
I have recreated the 0.8.1 precompiled libraries. They now have the correct folder structure.