View Issue Details [ Jump to Notes ] | [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0014646 | CMake | CMake | public | 2013-12-12 23:29 | 2014-06-02 08:37 | ||||
Reporter | Richard Shaw | ||||||||
Assigned To | Brad King | ||||||||
Priority | normal | Severity | text | Reproducibility | always | ||||
Status | closed | Resolution | fixed | ||||||
Platform | Linux 64-bit | OS | Fedora | OS Version | 19 | ||||
Product Version | CMake 2.8.12 | ||||||||
Target Version | CMake 3.0 | Fixed in Version | CMake 3.0 | ||||||
Summary | 0014646: Clarify if(TARGET) documentation | ||||||||
Description | I believe this is a regression from 2.8.11. I had this working although there have been changes to the cmake configuration so it's impossible to be sure. I have a project that uses wxWidgets. Because wxWidgets uses a custom script to generate linker and include flags it must be built before my project can even be configured. I worked around this by adding a bootstrap option that will download and build static libraries of wxWidgets, then cmake/make is run again after the needed configuration script is available. Ever since updating to 2.8.12 (currently 2.8.12.1), cmake skips the configuration and build of wxWidgets. | ||||||||
Additional Information | Here is a summarized version of the logic in my cmake configuration but also includes some debug info I added to verify the problem: if(BOOTSTRAP_WXWIDGETS) message(STATUS "Adding wxWidgets build target...") include(cmake/BuildWxWidgets.cmake) if(TARGET wxWidgets) message(STATUS "wxWidgets target exists.") endif() endif(BOOTSTRAP_WXWIDGETS) The externalproject target is added in BuildWxWidgets.cmake. Per the documentation "if(TARGET wxWidgets)" should only test TRUE once the target is built but the cmake output includes output indicating it's testing TRUE once the target is added. For reference, here is the contents of BuildWxWidgets.cmake: set(WXWIDGETS_TARBALL "wxWidgets-2.9.4") include(ExternalProject) ExternalProject_Add(wxWidgets URL http://downloads.sourceforge.net/wxwindows/${WXWIDGETS_TARBALL}.tar.bz2 [^] BUILD_IN_SOURCE 1 INSTALL_DIR external/dist CONFIGURE_COMMAND ./configure --disable-shared --prefix=${CMAKE_BINARY_DIR}/external/dist BUILD_COMMAND $(MAKE) INSTALL_COMMAND $(MAKE) install ) set(WXCONFIG "${CMAKE_BINARY_DIR}/external/dist/bin/wx-config") set(WXRC "${CMAKE_BINARY_DIR}/external/dist/bin/wxrc") | ||||||||
Tags | No tags attached. | ||||||||
Attached Files | |||||||||
Relationships | |
Relationships |
Notes | |
(0034787) Brad King (manager) 2013-12-18 11:20 |
The meaning of if(TARGET) has always been whether the target exists. The documentation wording as of 2.8.12: http://www.cmake.org/cmake/help/v2.8.12/cmake.html#command:if [^] " if(TARGET target-name) True if the given name is an existing target, built or imported." The ", built or imported" part is trying to say that "existing" does not distinguish between targets declared to be built by the current project or imported from elsewhere. It has nothing to do with whether the files actually exist on disk. Perhaps better wording is: True if the given name is an existing logical target name such as those created by the add_executable, add_library, or add_custom_target commands. |
(0034791) Richard Shaw (developer) 2013-12-18 11:41 |
Ok, that would be good to clairify... I have already updated my config to check for the existence of wx-config in ${install_dir}. |
(0034798) Brad King (manager) 2013-12-18 15:06 |
Okay, I've updated the docs: Help: Clarify if(TARGET) behavior http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6b8662e6 [^] |
(0036057) Robert Maynard (manager) 2014-06-02 08:37 |
Closing resolved issues that have not been updated in more than 4 months. |
Notes |
Issue History | |||
Date Modified | Username | Field | Change |
2013-12-12 23:29 | Richard Shaw | New Issue | |
2013-12-18 11:20 | Brad King | Note Added: 0034787 | |
2013-12-18 11:41 | Richard Shaw | Note Added: 0034791 | |
2013-12-18 15:06 | Brad King | Note Added: 0034798 | |
2013-12-18 15:06 | Brad King | Assigned To | => Brad King |
2013-12-18 15:06 | Brad King | Severity | major => text |
2013-12-18 15:06 | Brad King | Status | new => resolved |
2013-12-18 15:06 | Brad King | Resolution | open => fixed |
2013-12-18 15:06 | Brad King | Fixed in Version | => CMake 3.0 |
2013-12-18 15:06 | Brad King | Target Version | => CMake 3.0 |
2013-12-18 15:06 | Brad King | Summary | Test for TARGET return TRUE if it exists rather than if it has been built or imported. => Clarify if(TARGET) documentation |
2014-06-02 08:37 | Robert Maynard | Note Added: 0036057 | |
2014-06-02 08:37 | Robert Maynard | Status | resolved => closed |
Issue History |
Copyright © 2000 - 2018 MantisBT Team |