[CMake] New warnings in CMake 2.8.4-rc2
David Cole
david.cole at kitware.com
Mon Mar 28 07:33:04 EDT 2011
See the cmake command line help for:
--no-warn-unused-cli = Don't warn about command line options.
I would just add "--no-warn-unused-cli" to the ExternalProject_Add calls and
require CMake 2.8.4. (There is no ExternalProject_Add in CMake 2.6...)
On Sat, Mar 26, 2011 at 9:22 AM, Johnson, Hans J <hans-johnson at uiowa.edu>wrote:
> David,
>
> I am trying to remove all warnings from my Cmake build process: During a
> "-DCMAKE_BUILD_TYPE:STRING=Debug" build I get the following warning:
> *
>
> CMake Warning: The variable, 'CMAKE_CXX_FLAGS_RELEASE', specified manually, was not used during the generation.
>
> I believe that I get an alternate warning when building in Release mode that
>
> CMAKE_CXX_FLAGS_DEBUG is specified manually.
>
> *
> I was reading this thread:
> http://www.cmake.org/pipermail/cmake/2011-February/042474.html
>
> Here is my situation, and I'd like your advice on how to resolve it:
>
> I am using ExternalProject_Add feature of cmake, and I want all external
> packages to be built with the same compiler options:
>
> set(EXTERNAL_PACKAGES BRAINSMultiModeSegment BRAINSFit BRAINSDemonWarp BRAINSCut BRAINSResample
> BRAINSABC BRAINSConstellationDetector BRAINSMush BRAINSROIAuto GTRACT ${DicomToNrrdConverter} ${DicomSignature} ${BRAINSImageEval} BRAINSInitilizedControlPoints )
>
> foreach(proj ${EXTERNAL_PACKAGES})
> # message(STATUS "Building ExternalProject ${proj}")
> # message(STATUS "BRAINSCommonLib_DIR = ${BRAINSCommonLib_DIR}")
> ExternalProject_Add(${proj}
> DOWNLOAD_COMMAND ""
> SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/${proj}
> BINARY_DIR ${proj}-build
> # DEPENDS BRAINSCommonLib SlicerExecutionModel
> CMAKE_GENERATOR ${gen}
> CMAKE_ARGS
> -DCMAKE_CXX_FLAGS_RELEASE:STRING=${CMAKE_CXX_FLAGS_RELEASE}
> -DCMAKE_CXX_FLAGS_DEBUG:STRING=${CMAKE_CXX_FLAGS_DEBUG}
> -DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
> -DCMAKE_C_FLAGS_RELEASE:STRING=${CMAKE_C_FLAGS_RELEASE}
> -DCMAKE_C_FLAGS_DEBUG:STRING=${CMAKE_C_FLAGS_DEBUG}
> -DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}
> -DITK_DIR:PATH=${ITK_DIR}
> INSTALL_COMMAND ""
> )
> endforeach()
>
> =========================================
> Is there a way inside the CMakeLists.txt file to avoid these warnings?
>
> The only solution I can think of is to add a tremendous amount of
> if/then/else logic to explicitly handle all permutations of options so that
> only the minimal set of options is sent. That is going to be a maintenance
> nightmare.
>
> This code needs to compile similarly under cmake 2.6.4 and 2.8.4, or I'll
> need to again add build logic to our testing scripts.
>
> Thanks,
> Hans
>
>
>
> ------------------------------
> Notice: This UI Health Care e-mail (including attachments) is covered by
> the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is
> confidential and may be legally privileged. If you are not the intended
> recipient, you are hereby notified that any retention, dissemination,
> distribution, or copying of this communication is strictly prohibited.
> Please reply to the sender that you have received the message in error, then
> delete it. Thank you.
> ------------------------------
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110328/76e95567/attachment.htm>
More information about the CMake
mailing list