CMake and Qt5 AUTOMOC error
问题 I have a project which uses Qt5 and I have a CMakeLists.txt file that I use for creating the Visual Studio Solution. This is an excerpt of my CMakeLists.txt cmake_policy(SET CMP0020 NEW) set(CMAKE_AUTOMOC ON) find_package(Qt5 REQUIRED COMPONENTS core widgets) set(COMMON_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/src) include_directories( ${Boost_INCLUDE_DIRS} ${COMMON_INCLUDE_DIR} ) file(GLOB_RECURSE COMMON_SOURCE "*.hpp" "*.cpp") add_library(${PROJECT_NAME} ${COMMON_SOURCE}) qt5_use_modules(${PROJECT