CMake Error

Started by onthestorm, 14 November 2018, 23:04:05

onthestorm

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

#1
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.

texus

I have recreated the 0.8.1 precompiled libraries. They now have the correct folder structure.