[cmake-developers] [CMake 0012873]: AUTOMOC produces same output moc file if target has two source files resides in different sub-directory

Mantis Bug Tracker mantis at public.kitware.com
Thu Jan 12 23:09:36 EST 2012


The following issue has been SUBMITTED. 
====================================================================== 
http://www.cmake.org/Bug/view.php?id=12873 
====================================================================== 
Reported By:                joseph2002
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   12873
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2012-01-12 23:09 EST
Last Modified:              2012-01-12 23:09 EST
====================================================================== 
Summary:                    AUTOMOC produces same output moc file if target has
two source files resides in different sub-directory
Description: 
consider following directory structure:

src
src/CMakeLists.txt
src/sub1
src/sub1/test.h
src/sub1/test.cpp
src/sub2
src/sub2/test.h
src/sub2/test.cpp

src/CMakeLists.txt:
ADD_LIBRARY( testsrc sub1/test.cpp sub2/test.cpp )

Then AUTOMOC will produce the same moc_test.cpp in the binary folder of src:
${BINARY_DIR}/src/moc_test.cpp
${BINARY_DIR}/src/testsrc_automoc.cpp Which contains two lines of #include
"moc_test.cpp"

This is not desired. CMake should keep directory structure when automocing, and
produces:
${BINARY_DIR}/src/sub1/moc_test.cpp
${BINARY_DIR}/src/sub2/moc_test.cpp


====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-01-12 23:09 joseph2002     New Issue                                    
======================================================================




More information about the cmake-developers mailing list