Hi,<br><br>I have an issue and I do not know if there is a solution to it...<br><br>I have two CMakeLists.txt files as described below (just the important parts):<br><br>=== root/src/CMakeLists.txt === (build a shared library)<br>
<br># Compilation<br>add_library(<br>  ${CMAKE_PROJECT_NAME} SHARED <br>  ${CMAKE_BINARY_DIR}/xsd/mapping_file.cxx)<br><br># XML mapping source files are generated<br>set_source_files_properties(<br>  ${CMAKE_BINARY_DIR}/xsd/mapping_file.cxx<br>
  PROPERTIES GENERATED 1)<br><br># Make sure the source files are generated before the executable builds.<br>add_dependencies(${CMAKE_PROJECT_NAME} cxx_xml_mapping)<br><br>=== root/xsd/CMakeLists.txt === (generates C++ / XML mapping files using code synthesis XSD)<br>
<br># Add a custom target to manage dependencies<br>add_custom_target(cxx_xml_mapping DEPENDS xml_mapping)<br><br>add_custom_command(<br>  OUTPUT cxx_xml_mapping<br>  COMMAND ${XSD_EXECUTABLE} ARGS ${XSD_ARGS} ${CMAKE_CURRENT_SOURCE_DIR}/*.xsd<br>
  DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/*.xsd<br>  COMMENT &quot;Generating C++ / XML mapping files&quot;)<br><br><br>What happens is that when I build my library with &quot;make&quot; , it compiles and works fine. If I do a &quot;make install&quot;, it will compile again due to the add_custom_target (which is always considered out of date and hence built every time, cf. documentation).<br>
<br>Is there anyway to not compile again when running the make install???<br><br>Thank you for your help.<br><br>Romain Chanu<br>