aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2015-11-25 11:08:16 +0100
committerGuy Harris <guy@alum.mit.edu>2015-11-25 11:01:10 +0000
commit12b2e3d4e211aa10fe8b2cb42847869f3378fd39 (patch)
tree117219366c45eff99adc3326fb5cbbc64806becb /CMakeLists.txt
parent6181045bc161678496d557d61f7665c04b2e2ba2 (diff)
cmake: fix dependencies for copy_data_files
Ensure that files from INSTALL_FILES depend on html_docs, not the parent target copy_data_files (that would not help at all). Ensure that lua scripts are generated before copying them (another moved dependency). Explicitly track the help files that have to be textified for Windows (this finalizes the addition of proper dependencies to copy_data_files targets). Since there is no compelling reason for the extra copy_data_files_depends target now, remove it and move copy_data_files a bit further in the file such that the dependencies can be set. While at it, remove the unnecessary make_directory, the copy_data_files target will create it automatically when copying a file into it. Should fix the problem reported at https://code.wireshark.org/review/12028 Change-Id: I81e56c93ac0fc85e7385605b9c780a80b3d43c85 Reviewed-on: https://code.wireshark.org/review/12130 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt44
1 files changed, 21 insertions, 23 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index edde0bcbe4..755a981740 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1536,19 +1536,8 @@ if(WIN32)
endif()
endif(WIN32)
-# Copy ${INSTALL_FILES} and ${INSTALL_DIRS} to ${DATAFILE_DIR}
-add_custom_target(copy_data_files ALL DEPENDS ${INSTALL_FILES})
-set_target_properties(copy_data_files PROPERTIES FOLDER "Copy Tasks")
-add_dependencies(copy_data_files html_docs)
-# List of extra dependencies that for "copy_data_files" that cannot be added
-# above because the "copy_data_files" target needs to be defined for some
-# other commands later in this file.
+# List of extra dependencies for the "copy_data_files" target
set(copy_data_files_depends)
-if(ENABLE_APPLICATION_BUNDLE)
- add_custom_command(OUTPUT "${DATAFILE_DIR}"
- COMMAND ${CMAKE_COMMAND} -E make_directory "${DATAFILE_DIR}"
- )
-endif()
# glob patterns relative to the source directory that should be copied to
# ${DATAFILE_DIR} (including directory prefixes)
@@ -1577,6 +1566,7 @@ foreach(_install_file ${INSTALL_FILES})
"${_output_file}"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
DEPENDS
+ html_docs
"${_install_file}"
)
list(APPEND copy_data_files_depends "${_output_file}")
@@ -1591,13 +1581,19 @@ if(ENABLE_EXTCAP)
list(APPEND copy_data_files_depends "${DATAFILE_DIR}/extcap")
endif()
if(WIN32)
- file(TO_NATIVE_PATH ${DATAFILE_DIR}/help _help_dest_dir)
- add_custom_command(TARGET copy_data_files PRE_BUILD
- COMMAND ${CMAKE_COMMAND} -E make_directory "${DATAFILE_DIR}/help"
- COMMAND ${POWERSHELL_COMMAND} "${CMAKE_SOURCE_DIR}/tools/textify.ps1"
- -Destination ${_help_dest_dir}
- ${CMAKE_SOURCE_DIR}/help/*.txt
- )
+ file(TO_NATIVE_PATH "${DATAFILE_DIR}/help" _help_dest_dir)
+ file(GLOB _help_files RELATIVE "${CMAKE_SOURCE_DIR}" "help/*.txt")
+ foreach(_help_file IN LISTS _help_files)
+ add_custom_command(OUTPUT "${DATAFILE_DIR}/${_help_file}"
+ COMMAND ${CMAKE_COMMAND} -E make_directory "${DATAFILE_DIR}/help"
+ COMMAND ${POWERSHELL_COMMAND} "${CMAKE_SOURCE_DIR}/tools/textify.ps1"
+ -Destination "${_help_dest_dir}"
+ "${CMAKE_SOURCE_DIR}/${_help_file}"
+ DEPENDS
+ "${CMAKE_SOURCE_DIR}/${_help_file}"
+ )
+ list(APPEND copy_data_files_depends "${DATAFILE_DIR}/${_help_file}")
+ endforeach()
else()
list(APPEND DATA_FILES_SRC "help/*.txt")
endif(WIN32)
@@ -1609,7 +1605,8 @@ add_custom_command(OUTPUT "${DATAFILE_DIR}/help/faq.txt"
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/html2text.py
faq.tmp.html > "${DATAFILE_DIR}/help/faq.txt"
COMMAND ${CMAKE_COMMAND} -E remove faq.tmp.html
- DEPENDS "${CMAKE_SOURCE_DIR}/help/faq.py"
+ DEPENDS
+ "${CMAKE_SOURCE_DIR}/help/faq.py"
"${CMAKE_SOURCE_DIR}/tools/html2text.py"
)
list(APPEND copy_data_files_depends "${DATAFILE_DIR}/help/faq.txt")
@@ -1632,10 +1629,10 @@ if(LUA_FOUND)
"${_lua_file}"
"${DATAFILE_DIR}/${_lua_filename}"
DEPENDS
+ wsluaauxiliary
"${_lua_file}"
)
endforeach()
- add_dependencies(copy_data_files wsluaauxiliary)
endif(LUA_FOUND)
# doc/*.html handled elsewhere.
@@ -1670,8 +1667,9 @@ foreach(_data_file ${_data_files})
list(APPEND copy_data_files_depends "${DATAFILE_DIR}/${_data_file}")
endforeach()
-add_custom_target(copy_data_files_depends DEPENDS ${copy_data_files_depends})
-add_dependencies(copy_data_files copy_data_files_depends)
+# Copy files including ${INSTALL_FILES} and ${INSTALL_DIRS} to ${DATAFILE_DIR}
+add_custom_target(copy_data_files ALL DEPENDS ${copy_data_files_depends})
+set_target_properties(copy_data_files PROPERTIES FOLDER "Copy Tasks")
if( (BUILD_wireshark AND QT_FOUND) OR (BUILD_wireshark_gtk AND GTK_FOUND) )
set(WIRESHARK_SRC