aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorAnderson Toshiyuki Sasaki <ansasaki@redhat.com>2018-08-29 18:00:45 +0200
committerAndreas Schneider <asn@cryptomilk.org>2018-08-29 19:04:44 +0200
commit2aeee5194c1b74e3043f069d35112b3b93a0c883 (patch)
tree005e07cd27fe56bfd98a41f4c2f7c00825d34e77 /cmake
parentca925588b0c0e397d44b3f907736f2943450bdbf (diff)
downloadlibssh-2aeee5194c1b74e3043f069d35112b3b93a0c883.tar.gz
libssh-2aeee5194c1b74e3043f069d35112b3b93a0c883.tar.xz
libssh-2aeee5194c1b74e3043f069d35112b3b93a0c883.zip
cmake: Fix target to make sure copy runs in the end
The target created to copy the file must be the one make dist is depending on. Otherwise it will not copy the generated files to the desired path. Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Modules/FindABIMap.cmake47
1 files changed, 30 insertions, 17 deletions
diff --git a/cmake/Modules/FindABIMap.cmake b/cmake/Modules/FindABIMap.cmake
index 9579f91e..e0520abd 100644
--- a/cmake/Modules/FindABIMap.cmake
+++ b/cmake/Modules/FindABIMap.cmake
@@ -300,7 +300,7 @@ function(get_file_list _TARGET_NAME)
ABSOLUTE)
add_custom_target(
- ${_TARGET_NAME} ALL
+ ${_TARGET_NAME}_int ALL
COMMAND ${CMAKE_COMMAND}
-DOUTPUT_PATH="${_get_files_list_OUTPUT_PATH}"
-DDIRECTORIES="${_get_files_list_DIRECTORIES}"
@@ -310,21 +310,25 @@ function(get_file_list _TARGET_NAME)
"Searching for files"
)
- set_target_properties(${_TARGET_NAME}
- PROPERTIES LIST_FILE ${_FILES_LIST_OUTPUT_PATH}
- )
-
if (DEFINED _get_files_list_COPY_TO)
# Copy the generated file back to the COPY_TO
- add_custom_target(copy_${_TARGET_NAME} ALL
+ add_custom_target(${_TARGET_NAME} ALL
COMMAND
${CMAKE_COMMAND} -E copy_if_different
${_FILES_LIST_OUTPUT_PATH} ${_get_files_list_COPY_TO}
- DEPENDS ${_TARGET_NAME}
+ DEPENDS ${_TARGET_NAME}_int
COMMENT "Copying ${_TARGET_NAME} to ${_get_files_list_COPY_TO}"
)
+ else()
+ add_custom_target(${_TARGET_NAME} ALL
+ DEPENDS ${_TARGET_NAME}_int
+ )
endif()
+ set_target_properties(${_TARGET_NAME}
+ PROPERTIES LIST_FILE ${_FILES_LIST_OUTPUT_PATH}
+ )
+
endfunction()
function(extract_symbols _TARGET_NAME)
@@ -363,7 +367,7 @@ function(extract_symbols _TARGET_NAME)
)
add_custom_target(
- ${_TARGET_NAME} ALL
+ ${_TARGET_NAME}_int ALL
COMMAND ${CMAKE_COMMAND}
-DOUTPUT_PATH="${_SYMBOLS_OUTPUT_PATH}"
-DHEADERS_LIST_FILE="${_HEADERS_LIST_FILE}"
@@ -373,20 +377,25 @@ function(extract_symbols _TARGET_NAME)
COMMENT "Extracting symbols from headers"
)
- set_target_properties(${_TARGET_NAME}
- PROPERTIES LIST_FILE ${_SYMBOLS_OUTPUT_PATH}
- )
-
if (DEFINED _extract_symbols_COPY_TO)
# Copy the generated file back to the COPY_TO
- add_custom_target(copy_${_TARGET_NAME} ALL
+ add_custom_target(${_TARGET_NAME} ALL
COMMAND
${CMAKE_COMMAND} -E copy_if_different
${_SYMBOLS_OUTPUT_PATH} ${_extract_symbols_COPY_TO}
- DEPENDS "${_TARGET_NAME}"
+ DEPENDS ${_TARGET_NAME}_int
COMMENT "Copying ${_TARGET_NAME} to ${_extract_symbols_COPY_TO}"
)
+ else()
+ add_custom_target(${_TARGET_NAME} ALL
+ DEPENDS ${_TARGET_NAME}_int
+ )
endif()
+
+ set_target_properties(${_TARGET_NAME}
+ PROPERTIES LIST_FILE ${_SYMBOLS_OUTPUT_PATH}
+ )
+
endfunction()
function(generate_map_file _TARGET_NAME)
@@ -437,7 +446,7 @@ function(generate_map_file _TARGET_NAME)
)
add_custom_target(
- ${_TARGET_NAME} ALL
+ ${_TARGET_NAME}_int ALL
COMMAND ${CMAKE_COMMAND}
-DABIMAP_EXECUTABLE=${ABIMAP_EXECUTABLE}
-DSYMBOLS="${_SYMBOLS_FILE}"
@@ -460,13 +469,17 @@ function(generate_map_file _TARGET_NAME)
if (DEFINED _generate_map_file_COPY_TO)
# Copy the generated map back to the COPY_TO
- add_custom_target(copy_${_TARGET_NAME} ALL
+ add_custom_target(${_TARGET_NAME} ALL
COMMAND
${CMAKE_COMMAND} -E copy_if_different ${_MAP_OUTPUT_PATH}
${_generate_map_file_COPY_TO}
- DEPENDS ${_TARGET_NAME}
+ DEPENDS ${_TARGET_NAME}_int
COMMENT "Copying ${_MAP_OUTPUT_PATH} to ${_generate_map_file_COPY_TO}"
)
+ else()
+ add_custom_target(${_TARGET_NAME} ALL
+ DEPENDS ${_TARGET_NAME}_int
+ )
endif()
endfunction()