Process files with the same name as an autocom

The following source tree exists:

*-source
*----subsource
*--------Source1.hpp
*----Source1.hpp

Both files. / Source 1.hpp and. / Subsource / Source1.hpp should be handled by moc. When using automoc, it puts the moc output files in the same directory with the same name, since it is not possible to overwrite the file.

Qt - 5.2

CMake - 2.8.12

The CMake files are quite large, but here is a quick example:

# Main CMakeLists.txt
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)


add_subdirectory("${CMAKE_SOURCE_DIR}/components/Com1" ./Com1)


# Com1 CMakeLists.txt in components/Com1

file(GLOB_RECURSE CPP_FILES source/*.cpp)
add_library(Com1 SHARED ${CPP_FILES})

Any solutions?

+4
source share
1 answer

The tracker claims this has been fixed in CMake 3.6:

http://public.kitware.com/Bug/view.php?id=12873

+1
source

Source: https://habr.com/ru/post/1538129/


All Articles