[CMake] Fwd: Re: Compiler debug file, howto remove in clean?

David Cole david.cole at kitware.com
Tue Dec 13 10:15:40 EST 2011


RUNTIME_OUTPUT_DIRECTORY is a target property, not a variable. You'd
have to use get_property to retrieve its value, not
${RUNTIME_OUTPUT_DIRECTORY}...


HTH,
David


On Tue, Dec 13, 2011 at 10:04 AM, Totte Karlsson
<totte at dunescientific.com> wrote:
> not sure if the following was sent to the newsgroup?
> Sorry if posting double..
>
>>> set_property(DIRECTORY PROPERTY ADDITIONAL_MAKE_CLEAN_FILES
>>>
>>>                        ${RUNTIME_OUTPUT_DIRECTORY}/${target}.tds
>>>                        )
>>>
>>
>> Is your RUNTIME_OUTPUT_DIRECTORY variable set up correctly?
>
>
> In the top Cmake file I have
> set(EXECUTABLE_OUTPUT_PATH      ${PROJECT_BINARY_DIR}/bins)
> set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH})
> Not sure if that is best practice? I'm a cmake beginner
>
>
> Do you
>>
>> perhaps mean the target property of this name instead, and what's
>> the value of your "target" variable?
>
>
> In the 'target' cmake file, where the target is an application or a dll, it
> looks something like (for an application 'read_from_file'):
>
> set(target read_from_file)
> add_executable(${target} main.cpp)
>
> #MTK libraries
> target_link_libraries (${target} mtkCommon)
> ...
> #VTK libraries
> target_link_libraries(${target} vtkCommon)
> ....
> ADD_CUSTOM_COMMAND(
> TARGET ${target} POST_BUILD
> COMMAND echo ${target} and ${EXECUTABLE_OUTPUT_PATH}
> COMMAND ${CMAKE_COMMAND} -E copy_if_different
>    ${CMAKE_CURRENT_SOURCE_DIR}/ball.mtk ${EXECUTABLE_OUTPUT_PATH}
> COMMAND ${CMAKE_COMMAND} -E copy_if_different
>    ${CMAKE_CURRENT_SOURCE_DIR}/Alanine.mtk ${EXECUTABLE_OUTPUT_PATH}
> )
>
> set_property(DIRECTORY PROPERTY ADDITIONAL_MAKE_CLEAN_FILES
>                        ${EXECUTABLE_OUTPUT_PATH}/ball.mtk
>                        ${EXECUTABLE_OUTPUT_PATH}/Alanine.mtk
>
>                        ${RUNTIME_OUTPUT_DIRECTORY}/${target}.tds
>                        )
>
> #then comes installs, omitted...
> install (TARGETS ${target}                              DESTINATION bins)
> ...
>
> In the set_property command, the cleaning works for the text files, ball and
> Alanine.mtk. Interestingly, if I change it to
>                        ${EXCECUTABLE_PATH}/${target}.tds
>
> So I guess the RUNTIME_OUTPUT_DIRECTORY variable is not set correctly? I
> thought
> I read somewhere it is setup when the CMAKE_RUNTIME_OUTPUT_DIRECTORY is
> setup?
>
> Any feedback appreciated!
> totte
>
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake


More information about the CMake mailing list