Re: [cmake-developers] custom_command rebuild output file when depend files change?

2015-06-01 Thread Robert Goulet
 Are these absolute paths?

Yes. All absolute file paths.

 Where is the output file referenced?  It needs to be in a target somewhere.

Forgot to mention, we also do this after:
set_source_files_properties(${OUTPUT_FILE} PROPERTIES GENERATED 1)
list(APPEND SOURCE_FILES ${OUTPUT_FILE})
[...]
add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES})


-Original Message-
From: Brad King [mailto:brad.k...@kitware.com] 
Sent: Monday, June 1, 2015 1:33 PM
To: Robert Goulet
Cc: cmake-developers@cmake.org
Subject: Re: [cmake-developers] custom_command rebuild output file when depend 
files change?

On 06/01/2015 01:19 PM, Robert Goulet wrote:
 Does CMake custom_command rebuild the output file if the dependency 
 files change?

Yes, it should.  This is well tested.

 DEPENDS ${INPUT_FILES}

Are these absolute paths?

 OUTPUT ${OUTPUT_FILE}

Where is the output file referenced?  It needs to be in a target somewhere.

-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


Re: [cmake-developers] custom_command rebuild output file when depend files change?

2015-06-01 Thread Brad King
On 06/01/2015 02:03 PM, Robert Goulet wrote:
 Forgot to mention, we also do this after:
 set_source_files_properties(${OUTPUT_FILE} PROPERTIES GENERATED 1)

That shouldn't be necessary.  add_custom_command does that for you.

 list(APPEND SOURCE_FILES ${OUTPUT_FILE})
 [...]
 add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES})

Please post a complete example.

Thanks,
-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


Re: [cmake-developers] custom_command rebuild output file when depend files change?

2015-06-01 Thread Brad King
On 06/01/2015 01:19 PM, Robert Goulet wrote:
 Does CMake custom_command rebuild the output file if the
 dependency files change?

Yes, it should.  This is well tested.

 DEPENDS ${INPUT_FILES}

Are these absolute paths?

 OUTPUT ${OUTPUT_FILE}

Where is the output file referenced?  It needs to be in a target
somewhere.

-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


Re: [cmake-developers] custom_command rebuild output file when depend files change?

2015-06-01 Thread Robert Goulet
Removing the line

set_source_files_properties(${OUTPUT_FILE} PROPERTIES GENERATED 1)

...fixed it.

Indeed the documentation says Each output file will be marked with the 
GENERATED source file property automatically. However it does not mention that 
setting that property ourselves prevents the dependencies from functioning 
correctly. Perhaps it's a bug, I don't know.

But now it works, thanks for the pointer Brad !


-Original Message-
From: Brad King [mailto:brad.k...@kitware.com] 
Sent: Monday, June 1, 2015 2:11 PM
To: Robert Goulet
Cc: cmake-developers@cmake.org
Subject: Re: [cmake-developers] custom_command rebuild output file when depend 
files change?

On 06/01/2015 02:03 PM, Robert Goulet wrote:
 Forgot to mention, we also do this after:
 set_source_files_properties(${OUTPUT_FILE} PROPERTIES GENERATED 1)

That shouldn't be necessary.  add_custom_command does that for you.

 list(APPEND SOURCE_FILES ${OUTPUT_FILE}) [...] 
 add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES})

Please post a complete example.

Thanks,
-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers