MantisBT - CMake | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0014021 | CMake | CMake | public | 2013-03-18 07:39 | 2016-06-10 14:31 |
Reporter | Piotr Pietraszkiewicz | ||||
Assigned To | Kitware Robot | ||||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | moved | ||
Platform | MS Visual Studio 2008 | OS | Windows | OS Version | 7 |
Product Version | CMake 2.8.10.2 | ||||
Target Version | Fixed in Version | ||||
Summary | 0014021: Generated .sln files for MS Visual Studio 2008 do not apply Automoc to the top-level dependencies of a sub-folder (library) | ||||
Description | In a subdirectory of my project I build a library (sub) which depends on another library found in the top level directory (mainwindow). My subfolder's sub/CMakeLists.txt: ~~~~ project ( sub ) include_directories("${CMAKE_SOURCE_DIR}") add_library(sub SubWindow.h) target_link_libraries(sub ${Qt4_LIBRARIES} mainlib mainwindow) ~~~~ My top level CMakeLists.txt: ~~~~ [..] set(CMAKE_AUTOMOC TRUE) [..] ADD_SUBDIRECTORY(sub) include_directories(. sub) add_library(mainwindow MainWindow.h) target_link_libraries(mainwindow ${Qt4_LIBRARIES}) ~~~~ Both SubWindow.h and MainWindow.h are tagged with Q_OBJECT and thus need to be processed by automoc. SubWindow.h depends on MainWindow.h. Configuring the project on Cygwin/Linux environments and invoking "make" in the "sub" sub-folder yields: ~~~~ ~/src/caamtest/cygwin_build/sub: $ make Scanning dependencies of target mainwindow_automoc [ 14%] Automoc for target mainwindow Generating moc_MainWindow.cpp [ 14%] Built target mainwindow_automoc Scanning dependencies of target mainwindow [ 28%] Building CXX object CMakeFiles/mainwindow.dir/mainwindow_automoc.cpp.o Linking CXX static library libmainwindow.a [ 28%] Built target mainwindow Scanning dependencies of target sub_automoc [ 42%] Automoc for target sub Generating moc_SubWindow.cpp [ 42%] Built target sub_automoc Scanning dependencies of target mainlib_automoc [ 57%] Automoc for target mainlib [ 57%] Built target mainlib_automoc Scanning dependencies of target mainlib [ 71%] Building CXX object CMakeFiles/mainlib.dir/mainlib.cpp.o [ 85%] Building CXX object CMakeFiles/mainlib.dir/mainlib_automoc.cpp.o Linking CXX static library libmainlib.a [ 85%] Built target mainlib Scanning dependencies of target sub [100%] Building CXX object sub/CMakeFiles/sub.dir/sub_automoc.cpp.o Linking CXX static library libsub.a [100%] Built target sub ~~~~ All fine, note that Automoc was started for both "mainwindow" and "sub". In contrast, configuring the project on Windows environment (for MS VS 2008) and building "sub" with devenv yields: ~~~~ D:\[..]\src\caamtest\windows_build\sub>devenv sub.sln /build Microsoft (R) Visual Studio Version 9.0.30729.1. Copyright (C) Microsoft Corp. Alle Rechte vorbehalten. 1>------ Erstellen übersprungen: Projekt: mainwindow_automoc, Konfiguration: Debug Win32 ------ 1>Für diese Projektmappenkonfiguration wurde kein zu erstellendes Projekt ausgewählt. 2>------ Erstellen übersprungen: Projekt: mainlib_automoc, Konfiguration: Debug Win32 ------ 2>Für diese Projektmappenkonfiguration wurde kein zu erstellendes Projekt ausgewählt. 3>------ Erstellen gestartet: Projekt: sub_automoc, Konfiguration: Debug Win32 ------ 3>Automoc for target sub [..] ~~~~ "Erstellen übersprungen" means "Building skipped". The automoc for "mainwindow" is not started. Inspecting the configuration of the sub.sln with: devenv sub.sln -> right click on "Project map" (Projektmappe "sub") -> Configuration reveals that "mainlib_automoc" target is present but disabled (see screen-shot: subsln_config.png). I attach my sample project that helps to reproduce the problem. | ||||
Steps To Reproduce | |||||
Additional Information | |||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | ![]() https://public.kitware.com/Bug/file/4685/caamtest.tgz ![]() https://public.kitware.com/Bug/file/4686/subsln_config.png ![]() | ||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2013-03-18 07:39 | Piotr Pietraszkiewicz | New Issue | |||
2013-03-18 07:39 | Piotr Pietraszkiewicz | File Added: caamtest.tgz | |||
2013-03-18 07:40 | Piotr Pietraszkiewicz | File Added: subsln_config.png | |||
2013-03-18 08:49 | Rolf Eike Beer | Note Added: 0032653 | |||
2013-03-18 13:37 | Piotr Pietraszkiewicz | Note Added: 0032666 | |||
2013-03-19 11:06 | Piotr Pietraszkiewicz | Note Added: 0032674 | |||
2016-06-10 14:28 | Kitware Robot | Note Added: 0042252 | |||
2016-06-10 14:28 | Kitware Robot | Status | new => resolved | ||
2016-06-10 14:28 | Kitware Robot | Resolution | open => moved | ||
2016-06-10 14:28 | Kitware Robot | Assigned To | => Kitware Robot | ||
2016-06-10 14:31 | Kitware Robot | Status | resolved => closed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|