how to build dll by cmake in clion with qt
dear:
we have a project (eg . named Test ) which include some qt project files .
and now we want to build project Test to dll for other project use .
so we build project Test in clion by cmake .
here is the cmake file content:
cmake_minimum_required(VERSION 3.20)
project(untitled)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
IF(WIN32)
set(CMAKE_PREFIX_PATH "E:/Qt/Qt5.12.6/5.12.6/msvc2017_64")
ENDIF()
set(MYlIB ./library)
add_library(untitled SHARED library/library.cpp)
but in clion . it don't find any qt files , and a lot of error , like can not find include file QString , QVector and so on .
and actually it work fine in
add_executable(untitled SHARED library/library.cpp)
so what should we do if we want to build it successfully . thanks .
1 comment
Sort by
Date
Votes
![Avatar](https://secure.gravatar.com/avatar/ad1cace404efb1bd235c8f19ac7dcc50?default=https%3A%2F%2Fassets.zendesk.com%2Fhc%2Fassets%2Fdefault_avatar.png&r=g)
Please sign in to leave a comment.