cmake add_custom_command(TARGET) examples

86Box/86Box src/CMakeLists.txt :268

add_custom_command(TARGET 86Box POST_BUILD COMMAND paxctl ARGS +m $<TARGET_FILE:86Box> COMMENT "Disable PaX MPROTECT")

antlr/antlr4 runtime/Cpp/runtime/CMakeLists.txt :162

add_custom_command(
    TARGET antlr4_shared
    POST_BUILD
    COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_HOME_DIRECTORY}/dist
    COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:antlr4_shared> ${CMAKE_HOME_DIRECTORY}/dist
    COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_LINKER_FILE:antlr4_shared> ${CMAKE_HOME_DIRECTORY}/dist)

assimp/assimp CMakeLists.txt :915

ADD_CUSTOM_COMMAND(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/Release/assimp-${ASSIMP_MSVC_VERSION}-mt.dll	${BIN_DIR}assimp-${ASSIMP_MSVC_VERSION}-mt.dll VERBATIM)

assimp/assimp CMakeLists.txt :920

ADD_CUSTOM_COMMAND(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/Debug/assimp-${ASSIMP_MSVC_VERSION}-mtd.ilk		${LIB_DIR}assimp-${ASSIMP_MSVC_VERSION}-mtd.ilk VERBATIM)

assimp/assimp CMakeLists.txt :924

ADD_CUSTOM_COMMAND(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/assimp-${ASSIMP_MSVC_VERSION}-mt.dll	${BIN_DIR}assimp-${ASSIMP_MSVC_VERSION}-mt.dll VERBATIM)

assimp/assimp CMakeLists.txt :926

ADD_CUSTOM_COMMAND(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/assimp-${ASSIMP_MSVC_VERSION}-mt.lib	${LIB_DIR}assimp-${ASSIMP_MSVC_VERSION}-mt.lib VERBATIM)

assimp/assimp CMakeLists.txt :927

ADD_CUSTOM_COMMAND(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/assimp-${ASSIMP_MSVC_VERSION}-mtd.dll		${BIN_DIR}assimp-${ASSIMP_MSVC_VERSION}-mtd.dll  VERBATIM)

assimp/assimp CMakeLists.txt :928

ADD_CUSTOM_COMMAND(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/assimp-${ASSIMP_MSVC_VERSION}-mtd.exp		${LIB_DIR}assimp-${ASSIMP_MSVC_VERSION}-mtd.exp VERBATIM)

assimp/assimp CMakeLists.txt :930

ADD_CUSTOM_COMMAND(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/assimp-${ASSIMP_MSVC_VERSION}-mtd.lib		${LIB_DIR}assimp-${ASSIMP_MSVC_VERSION}-mtd.lib VERBATIM)

assimp/assimp CMakeLists.txt :931

ADD_CUSTOM_COMMAND(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/assimp-${ASSIMP_MSVC_VERSION}-mtd.pdb		${LIB_DIR}assimp-${ASSIMP_MSVC_VERSION}-mtd.pdb VERBATIM)

BinomialLLC/basis_universal CMakeLists.txt :228

add_custom_command(TARGET basisu POST_BUILD COMMAND strip -X -x ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/basisu)

mono/boringssl util/android-cmake/AndroidNdkGdb.cmake :94

add_custom_command(TARGET NDK_GDB POST_BUILD COMMAND ${CMAKE_STRIP} ${TARGET_LOCATION})

bulletphysics/bullet3 examples/SharedMemory/CMakeLists.txt :324

	ADD_CUSTOM_COMMAND(
                TARGET App_PhysicsServer_SharedMemory_VR
                POST_BUILD
                COMMAND ${CMAKE_COMMAND} ARGS -E copy_directory ${BULLET_PHYSICS_SOURCE_DIR}/data ${PROJECT_BINARY_DIR}/data
        )

catchorg/Catch2 extras/Catch.cmake :212

add_custom_command(
  TARGET ${TARGET} POST_BUILD
  BYPRODUCTS "${ctest_tests_file}"
  COMMAND "${CMAKE_COMMAND}"
          -D "TEST_TARGET=${TARGET}"
          -D "TEST_EXECUTABLE=$<TARGET_FILE:${TARGET}>"
          -D "TEST_EXECUTOR=${crosscompiling_emulator}"
          -D "TEST_WORKING_DIR=${_WORKING_DIRECTORY}"
          -D "TEST_SPEC=${_TEST_SPEC}"
          -D "TEST_EXTRA_ARGS=${_EXTRA_ARGS}"
          -D "TEST_PROPERTIES=${_PROPERTIES}"
          -D "TEST_PREFIX=${_TEST_PREFIX}"
          -D "TEST_SUFFIX=${_TEST_SUFFIX}"
          -D "TEST_LIST=${_TEST_LIST}"
          -D "TEST_REPORTER=${_REPORTER}"
          -D "TEST_OUTPUT_DIR=${_OUTPUT_DIR}"
          -D "TEST_OUTPUT_PREFIX=${_OUTPUT_PREFIX}"
          -D "TEST_OUTPUT_SUFFIX=${_OUTPUT_SUFFIX}"
          -D "TEST_DL_PATHS=${_DL_PATHS}"
          -D "TEST_DL_FRAMEWORK_PATHS=${_DL_FRAMEWORK_PATHS}"
          -D "CTEST_FILE=${ctest_tests_file}"
          -D "ADD_TAGS_AS_LABELS=${_ADD_TAGS_AS_LABELS}"
          -P "${_CATCH_DISCOVER_TESTS_SCRIPT}"
  VERBATIM
)

catchorg/Catch2 extras/CatchShardTests.cmake :51

add_custom_command(
  TARGET ${TARGET} POST_BUILD
  BYPRODUCTS "${ctest_tests_file}"
  COMMAND "${CMAKE_COMMAND}"
          -D "TARGET_NAME=${TARGET}"
          -D "TEST_BINARY=$<TARGET_FILE:${TARGET}>"
          -D "CTEST_FILE=${ctest_tests_file}"
          -D "SHARD_COUNT=${_SHARD_COUNT}"
          -D "REPORTER_SPEC=${_REPORTER}"
          -D "TEST_SPEC=${_TEST_SPEC}"
          -P "${shard_impl_script_file}"
  VERBATIM
)

catchorg/Catch2 tests/CMakeLists.txt :157

add_custom_command(TARGET SelfTest PRE_LINK
  COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:Catch2>
  $<TARGET_FILE:Catch2WithMain> $<TARGET_FILE_DIR:SelfTest>
)

CGAL/cgal Linear_cell_complex/benchmark/Linear_cell_complex_3/cmake/ACGCommon.cmake :356

add_custom_command(TARGET ${target} POST_BUILD
  COMMAND ${CMAKE_COMMAND} -E copy_if_different "${src}/${_file}" "${dst}/${_file}"
)

CGAL/cgal Linear_cell_complex/benchmark/Linear_cell_complex_3/cmake/ACGCommon.cmake :449

add_custom_command (TARGET ${_target} POST_BUILD
                    COMMAND ${CMAKE_COMMAND} -E
                    copy_if_different
                      ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${_target}.dll
                      ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_PLUGINDIR}/${_target}.dll)

CGAL/cgal Linear_cell_complex/benchmark/Linear_cell_complex_3/cmake/ACGCommon.cmake :456

add_custom_command (TARGET ${_target} POST_BUILD
                    COMMAND ${CMAKE_COMMAND} -E
                    copy_if_different
                      ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${_target}.lib
                      ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR}/${_target}.lib)

CGAL/cgal Linear_cell_complex/benchmark/Linear_cell_complex_3/cmake/ACGCommon.cmake :464

add_custom_command (TARGET ${_target} POST_BUILD
                    COMMAND ${CMAKE_COMMAND} -E
                    copy_if_different
                      ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${_target}.dylib
                      ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR}/lib${_target}.dylib)

CGAL/cgal Linear_cell_complex/benchmark/Linear_cell_complex_3/cmake/ACGCommon.cmake :568

add_custom_command (TARGET translations_target_${_target} POST_BUILD
                    COMMAND ${CMAKE_COMMAND} -E
                    copy_if_different
                      ${_qm}
                      ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/Translations/${_qm_name})

projectchrono/chrono src/chrono_sensor/CMakeLists.txt :486

add_custom_command(TARGET Chrono_sensor
  PRE_BUILD
  COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/lib/sensor_ptx"
  COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_OBJECTS:Chrono_sensor_ptx> "${CMAKE_BINARY_DIR}/lib/sensor_ptx"
  COMMAND_EXPAND_LISTS
  COMMENT "Copy Chrono::Sensor PTX files."
)

projectchrono/chrono src/chrono_swig/chrono_python/CMakeLists.txt :275

add_custom_command(TARGET fea
                 POST_BUILD
                 COMMAND ${CMAKE_COMMAND} -E make_directory ${CHPY_FEA_PYD_PATH}/pychrono)

projectchrono/chrono src/chrono_swig/chrono_python/CMakeLists.txt :710

add_custom_command(TARGET vehicle
                   POST_BUILD
                   COMMAND ${CMAKE_COMMAND} -E copy ${CHPY_VEHICLE_PY_FILE} ${CHPY_VEHICLE_PYD_PATH}/pychrono)

projectchrono/chrono src/chrono_swig/chrono_python/CMakeLists.txt :781

add_custom_command(TARGET sensor
        POST_BUILD
        COMMAND ${CMAKE_COMMAND} -E make_directory ${CHPY_SENSOR_PYD_PATH}/pychrono)

projectchrono/chrono src/chrono_swig/chrono_python/CMakeLists.txt :870

add_custom_command(TARGET robot
                   POST_BUILD
                   COMMAND ${CMAKE_COMMAND} -E copy ${CHPY_VEHICLE_PY_FILE} ${CHPY_VEHICLE_PYD_PATH}/pychrono)

projectchrono/chrono src/chrono_swig/chrono_python/CMakeLists.txt :937

add_custom_command(TARGET parsers
                 POST_BUILD
                 COMMAND ${CMAKE_COMMAND} -E make_directory ${CHPY_PARSERS_PYD_PATH}/pychrono)

projectchrono/chrono src/chrono_swig/chrono_python/CMakeLists.txt :1037

add_custom_command(TARGET ros
                   POST_BUILD
                   COMMAND ${CMAKE_COMMAND} -E copy ${CHPY_ROS_PY_FILE} ${CHPY_ROS_PYD_PATH}/pychrono)

projectchrono/chrono src/chrono_thirdparty/yaml-cpp/test/CMakeLists.txt :59

add_custom_command(
  TARGET yaml-cpp-tests
  POST_BUILD COMMAND ${CMAKE_COMMAND} -E
  copy_if_different "$<TARGET_FILE:yaml-cpp>" "$<TARGET_FILE_DIR:yaml-cpp-tests>")

projectchrono/chrono src/chrono_vehicle/CMakeLists.txt :1103

add_custom_command(TARGET Chrono_vehicle POST_BUILD
    COMMAND ${CMAKE_COMMAND} -E copy_if_different
    "${OpenRG_DLL}"
    "${PROJECT_BINARY_DIR}/bin/$<CONFIGURATION>")

CLIUtils/CLI11 cmake/CodeCoverage.cmake :789

add_custom_command(
  TARGET ${Coverage_NAME}
  POST_BUILD
  COMMAND ${CMAKE_COMMAND} -E echo ${INFO_MSG})

eranif/codelite LiteEditor/CMakeLists.txt :355

add_custom_command(
    TARGET codelite
    POST_BUILD
    COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/compile_commands.json
            ${CMAKE_SOURCE_DIR}/compile_commands.json)

mono/corefx src/Native/Unix/CMakeLists.txt :220

add_custom_command(
    TARGET ${targetName}
    POST_BUILD
    VERBATIM 
    COMMAND ${OBJCOPY} --only-keep-debug ${strip_source_file} ${strip_destination_file}
    COMMAND ${OBJCOPY} --strip-unneeded ${strip_source_file}
    COMMAND ${OBJCOPY} --add-gnu-debuglink=${strip_destination_file} ${strip_source_file}
    COMMENT Stripping symbols from ${strip_source_file} into file ${strip_destination_file}
)

mono/corefx src/Native/Unix/System.Security.Cryptography.Native/CMakeLists.txt :78

add_custom_command(TARGET System.Security.Cryptography.Native.OpenSsl POST_BUILD
    COMMENT "Verifying System.Security.Cryptography.Native.OpenSsl.so dependencies"
    COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/../verify-so.sh 
        $<TARGET_FILE:System.Security.Cryptography.Native.OpenSsl> 
        "Verification failed. System.Security.Cryptography.Native.OpenSsl.so has undefined dependencies. These are likely OpenSSL APIs that need to be added to opensslshim.h"
    VERBATIM
)

mono/corefx src/Native/Unix/System.Security.Cryptography.Native/CMakeLists.txt :105

add_custom_command(TARGET System.Security.Cryptography.Native.OpenSsl POST_BUILD
    COMMAND ${CMAKE_INSTALL_NAME_TOOL} -change /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib @rpath/libcrypto.1.0.0.dylib $<TARGET_FILE:System.Security.Cryptography.Native.OpenSsl>
    COMMAND ${CMAKE_INSTALL_NAME_TOOL} -change /usr/local/opt/openssl/lib/libssl.1.0.0.dylib @rpath/libssl.1.0.0.dylib $<TARGET_FILE:System.Security.Cryptography.Native.OpenSsl>
    COMMAND ${CMAKE_INSTALL_NAME_TOOL} -add_rpath @loader_path $<TARGET_FILE:System.Security.Cryptography.Native.OpenSsl>
    )

mono/corert src/Native/Runtime/Portable/CMakeLists.txt :28

add_custom_command(
    # The AsmOffsetsPortable.cs is consumed later by the managed build
    TARGET PortableRuntime
    COMMAND ${CMAKE_CXX_COMPILER} ${COMPILER_LANGUAGE} ${DEFINITIONS} ${PREPROCESSOR_FLAGS} -I"${ARCH_SOURCES_DIR}" "${ASM_OFFSETS_CSPP}" >"${CMAKE_CURRENT_BINARY_DIR}/AsmOffsetsPortable.cs"
    DEPENDS "${RUNTIME_DIR}/AsmOffsets.cpp" "${RUNTIME_DIR}/AsmOffsets.h"
)

mosra/corrade modules/FindCorrade.cmake :481

            # CMAKE_CROSSCOMPILING_EMULATOR in add_custom_command((), try to
            # find the cross-compiled version as a (slower) fallback. This
            # assumes the toolchain sets CMAKE_FIND_ROOT_PATH_MODE_PROGRAM to
            # NEVER, i.e. that the search is restricted to native executables
            # by default.
            if(NOT CORRADE_${_COMPONENT}_EXECUTABLE AND CMAKE_CROSSCOMPILING AND CMAKE_CROSSCOMPILING_EMULATOR AND NOT CMAKE_VERSION VERSION_LESS 3.6)
                # Additionally, there are no CMAKE_FIND_PROGRAM_SUFFIXES akin
                # to CMAKE_FIND_LIBRARY_SUFFIXES for libraries, so we have to
                # try manually.
                if(CORRADE_TARGET_EMSCRIPTEN)
                    set(_CORRADE_PROGRAM_EXTENSION .js)
                endif()
                find_program(CORRADE_${_COMPONENT}_EXECUTABLE
                    NAMES
                        corrade-${_component}
                        corrade-${_component}${_CORRADE_PROGRAM_EXTENSION}
                    ONLY_CMAKE_FIND_ROOT_PATH)
                if(CORRADE_${_COMPONENT}_EXECUTABLE)
                    set(CORRADE_${_COMPONENT}_EXECUTABLE_EMULATOR ${CMAKE_CROSSCOMPILING_EMULATOR} CACHE PATH "Emulator for running a cross-compiled corrade-${_component} executable")
                    mark_as_advanced(CORRADE_${_COMPONENT}_EXECUTABLE_EMULATOR)
                endif()
            endif()

        # If not a header-only component it's something unknown, skip. FPHSA
        # will take care of handling this below.
        elseif(NOT _component IN_LIST _CORRADE_HEADER_ONLY_COMPONENTS)
            continue()
        endif()

        # Find library includes
        if(_component IN_LIST _CORRADE_LIBRARY_COMPONENTS)
            find_path(_CORRADE_${_COMPONENT}_INCLUDE_DIR
                NAMES ${_CORRADE_${_COMPONENT}_INCLUDE_PATH_NAMES}
                HINTS ${CORRADE_INCLUDE_DIR}/${_CORRADE_${_COMPONENT}_INCLUDE_PATH_SUFFIX})
            mark_as_advanced(_CORRADE_${_COMPONENT}_INCLUDE_DIR)
        endif()

        # Decide if the component was found. If not, skip the rest, which
        # creates and populates the target and finds additional dependencies.
        # If found, the _FOUND variable may still get reset by something below.
        if(
            # If the component is a library, it should have the include dir
            (_component IN_LIST _CORRADE_LIBRARY_COMPONENTS AND _CORRADE_${_COMPONENT}_INCLUDE_DIR AND (
                # And it should be either header-only
                _component IN_LIST _CORRADE_HEADER_ONLY_COMPONENTS OR
                # Or have a debug library, and a DLL found if expected
                (CORRADE_${_COMPONENT}_LIBRARY_DEBUG AND (
                    NOT DEFINED CORRADE_${_COMPONENT}_DLL_DEBUG OR
                    CORRADE_${_COMPONENT}_DLL_DEBUG)) OR
                # Or have a release library, and a DLL found if expected
                (CORRADE_${_COMPONENT}_LIBRARY_RELEASE AND (
                    NOT DEFINED CORRADE_${_COMPONENT}_DLL_RELEASE OR
                    CORRADE_${_COMPONENT}_DLL_RELEASE)))) OR
            # If the component is an executable, it should have just the
            # location
            (_component IN_LIST _CORRADE_EXECUTABLE_COMPONENTS AND CORRADE_${_COMPONENT}_EXECUTABLE)
        )
            set(Corrade_${_component}_FOUND TRUE)
        else()
            set(Corrade_${_component}_FOUND FALSE)
            continue()
        endif()

        # Target for header-only library components
        if(_component IN_LIST _CORRADE_HEADER_ONLY_COMPONENTS)
            add_library(Corrade::${_component} INTERFACE IMPORTED)

        # Target and location for (non-header-only) libraries
        elseif(_component IN_LIST _CORRADE_LIBRARY_COMPONENTS)
            if(CORRADE_BUILD_STATIC OR _component IN_LIST _CORRADE_LIBRARY_COMPONENTS_ALWAYS_STATIC)
                add_library(Corrade::${_component} STATIC IMPORTED)
            else()
                add_library(Corrade::${_component} SHARED IMPORTED)
            endif()

            foreach(_CONFIG DEBUG RELEASE)
                if(NOT CORRADE_${_COMPONENT}_LIBRARY_${_CONFIG})
                    continue()
                endif()

                set_property(TARGET Corrade::${_component} APPEND PROPERTY
                    IMPORTED_CONFIGURATIONS ${_CONFIG})
                # Unfortunately for a DLL the two properties are swapped out,
                # *.lib goes to IMPLIB, so it's duplicated like this
                if(DEFINED CORRADE_${_COMPONENT}_DLL_${_CONFIG})
                    # Quotes to "fix" KDE's higlighter
                    set_target_properties("Corrade::${_component}" PROPERTIES
                        IMPORTED_LOCATION_${_CONFIG} ${CORRADE_${_COMPONENT}_DLL_${_CONFIG}}
                        IMPORTED_IMPLIB_${_CONFIG} ${CORRADE_${_COMPONENT}_LIBRARY_${_CONFIG}})
                else()
                    set_property(TARGET Corrade::${_component} PROPERTY
                        IMPORTED_LOCATION_${_CONFIG} ${CORRADE_${_COMPONENT}_LIBRARY_${_CONFIG}})
                endif()
            endforeach()

        # Target and location for executable components
        elseif(_component IN_LIST _CORRADE_EXECUTABLE_COMPONENTS)
            add_executable(Corrade::${_component} IMPORTED)

            set_property(TARGET Corrade::${_component} PROPERTY
                IMPORTED_LOCATION ${CORRADE_${_COMPONENT}_EXECUTABLE})
        endif()

        # No special setup for Containers library

        # Interconnect library
        if(_component STREQUAL Interconnect)
            # Disable /OPT:ICF on MSVC, which merges functions with identical
            # contents and thus breaks signal comparison. Same case is for
            # clang-cl which uses the MSVC linker by default.
            if(CORRADE_TARGET_WINDOWS AND (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" OR CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC"))
                if(CMAKE_VERSION VERSION_LESS 3.13)
                    set_property(TARGET Corrade::${_component} PROPERTY
                        INTERFACE_LINK_LIBRARIES "-OPT:NOICF,REF")
                else()
                    set_property(TARGET Corrade::${_component} PROPERTY
                        INTERFACE_LINK_OPTIONS "/OPT:NOICF,REF")
                endif()
            endif()

        # Main library
        elseif(_component STREQUAL Main)
            if(CORRADE_TARGET_WINDOWS)
                if(NOT MINGW)
                    # Abusing INTERFACE_LINK_LIBRARIES because
                    # INTERFACE_LINK_OPTIONS is only since 3.13. They treat
                    # things with `-` in front as linker flags and fortunately
                    # I can use `-ENTRY` instead of `/ENTRY`.
                    # https://gitlab.kitware.com/cmake/cmake/issues/16543
                    set_property(TARGET Corrade::${_component} APPEND PROPERTY
                        INTERFACE_LINK_LIBRARIES "-ENTRY:$<$<NOT:$<BOOL:$<TARGET_PROPERTY:WIN32_EXECUTABLE>>>:wmainCRTStartup>$<$<BOOL:$<TARGET_PROPERTY:WIN32_EXECUTABLE>>:wWinMainCRTStartup>")
                else()
                    set_property(TARGET Corrade::${_component} APPEND PROPERTY
                        INTERFACE_LINK_LIBRARIES "-municode")
                endif()
            endif()

        # PluginManager library
        elseif(_component STREQUAL PluginManager)
            # -ldl is handled by Utility now

        # TestSuite library has some additional files. If those are not found,
        # set the component _FOUND variable to false so it works properly both
        # when the component is required and when it's optional.
        elseif(_component STREQUAL TestSuite)
            # XCTest runner file
            if(CORRADE_TESTSUITE_TARGET_XCTEST)
                find_file(CORRADE_TESTSUITE_XCTEST_RUNNER XCTestRunner.mm.in
                    PATH_SUFFIXES share/corrade/TestSuite)
                if(NOT CORRADE_TESTSUITE_XCTEST_RUNNER)
                    set(Corrade_${_component}_FOUND FALSE)
                endif()

            # ADB runner file
            elseif(CORRADE_TARGET_ANDROID)
                find_file(CORRADE_TESTSUITE_ADB_RUNNER AdbRunner.sh
                    PATH_SUFFIXES share/corrade/TestSuite)
                if(NOT CORRADE_TESTSUITE_ADB_RUNNER)
                    set(Corrade_${_component}_FOUND FALSE)
                endif()

            # Emscripten runner file
            elseif(CORRADE_TARGET_EMSCRIPTEN)
                find_file(CORRADE_TESTSUITE_EMSCRIPTEN_RUNNER EmscriptenRunner.html.in
                    PATH_SUFFIXES share/corrade/TestSuite)
                if(NOT CORRADE_TESTSUITE_EMSCRIPTEN_RUNNER)
                    set(Corrade_${_component}_FOUND FALSE)
                endif()
            endif()

        # Utility library (contains all setup that is used by others)
        elseif(_component STREQUAL Utility)
            # Top-level include directory
            set_property(TARGET Corrade::${_component} APPEND PROPERTY
                INTERFACE_INCLUDE_DIRECTORIES ${CORRADE_INCLUDE_DIR})

            # Require (at least) C++11 for users
            set_property(TARGET Corrade::${_component} PROPERTY
                INTERFACE_CORRADE_CXX_STANDARD 11)
            set_property(TARGET Corrade::${_component} APPEND PROPERTY
                COMPATIBLE_INTERFACE_NUMBER_MAX CORRADE_CXX_STANDARD)

            # -fno-strict-aliasing is set in UseCorrade.cmake for everyone who
            # enables CORRADE_USE_PEDANTIC_FLAGS. Not all projects linking to
            # Corrade enable it (or can't enable it), but this flag is
            # essential to prevent insane bugs and random breakages, so force
            # it for anyone linking to Corrade::Utility. Similar code is in
            # Corrade/Utility/CMakeLists.txt.
            if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR (CMAKE_CXX_COMPILER_ID MATCHES "(Apple)?Clang" AND NOT CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC") OR CORRADE_TARGET_EMSCRIPTEN)
                set_property(TARGET Corrade::${_component} APPEND PROPERTY INTERFACE_COMPILE_OPTIONS -fno-strict-aliasing)
            endif()

            # Path::libraryLocation() needs this
            if(CORRADE_TARGET_UNIX)
                set_property(TARGET Corrade::${_component} APPEND PROPERTY
                    INTERFACE_LINK_LIBRARIES ${CMAKE_DL_LIBS})
            endif()
            # AndroidLogStreamBuffer class needs to be linked to log library
            if(CORRADE_TARGET_ANDROID)
                set_property(TARGET Corrade::${_component} APPEND PROPERTY
                    INTERFACE_LINK_LIBRARIES "log")
            endif()
            # Emscripten has various stuff implemented in JS
            if(CORRADE_TARGET_EMSCRIPTEN)
                find_file(CORRADE_UTILITY_JS CorradeUtility.js
                    PATH_SUFFIXES lib)
                set_property(TARGET Corrade::${_component} APPEND PROPERTY
                    # TODO switch to INTERFACE_LINK_OPTIONS and SHELL: once we
                    #   require CMake 3.13 unconditionally
                    INTERFACE_LINK_LIBRARIES "--js-library ${CORRADE_UTILITY_JS}")
            endif()
        endif()

        # Add inter-library dependencies
        if(_component IN_LIST _CORRADE_LIBRARY_COMPONENTS OR _component IN_LIST _CORRADE_HEADER_ONLY_COMPONENTS)
            foreach(_dependency ${_CORRADE_${_component}_DEPENDENCIES})
                if(_dependency IN_LIST _CORRADE_LIBRARY_COMPONENTS OR _dependency IN_LIST _CORRADE_HEADER_ONLY_COMPONENTS)
                    set_property(TARGET Corrade::${_component} APPEND PROPERTY
                        INTERFACE_LINK_LIBRARIES Corrade::${_dependency})
                endif()
            endforeach()
        endif()
    endif()
endforeach()

# For CMake 3.16+ with REASON_FAILURE_MESSAGE, provide additional potentially
# useful info about the failed components.
if(NOT CMAKE_VERSION VERSION_LESS 3.16)
    set(_CORRADE_REASON_FAILURE_MESSAGE )
    # Go only through the originally specified find_package() components, not
    # the dependencies added by us afterwards
    foreach(_component ${_CORRADE_ORIGINAL_FIND_COMPONENTS})
        if(Corrade_${_component}_FOUND)
            continue()
        endif()

        # If it's not known at all, tell the user -- it might be a new library
        # and an old Find module, or something platform-specific.
        if(NOT _component IN_LIST _CORRADE_LIBRARY_COMPONENTS AND NOT _component IN_LIST _CORRADE_EXECUTABLE_COMPONENTS)
            list(APPEND _CORRADE_REASON_FAILURE_MESSAGE "${_component} is not a known component on this platform.")
        # Otherwise, if it's not among implicitly built components, hint that
        # the user may need to enable it.
        # TODO: currently, the _FOUND variable doesn't reflect if dependencies
        #   were found. When it will, this needs to be updated to avoid
        #   misleading messages.
        elseif(NOT _component IN_LIST _CORRADE_IMPLICITLY_ENABLED_COMPONENTS)
            string(TOUPPER ${_component} _COMPONENT)
            list(APPEND _CORRADE_REASON_FAILURE_MESSAGE "${_component} is not built by default. Make sure you enabled CORRADE_WITH_${_COMPONENT} when building Corrade.")
        # Otherwise we have no idea. Better be silent than to print something
        # misleading.
        else()
        endif()
    endforeach()

    string(REPLACE ";" " " _CORRADE_REASON_FAILURE_MESSAGE "${_CORRADE_REASON_FAILURE_MESSAGE}")
    set(_CORRADE_REASON_FAILURE_MESSAGE REASON_FAILURE_MESSAGE "${_CORRADE_REASON_FAILURE_MESSAGE}")
endif()

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Corrade REQUIRED_VARS
    CORRADE_INCLUDE_DIR
    _CORRADE_MODULE_DIR
    _CORRADE_CONFIGURE_FILE
    HANDLE_COMPONENTS
    ${_CORRADE_REASON_FAILURE_MESSAGE})

# Finalize the finding process
include(${CORRADE_USE_MODULE})

set(CORRADE_INCLUDE_INSTALL_DIR include/Corrade)

if(CORRADE_BUILD_DEPRECATED AND CORRADE_INCLUDE_INSTALL_PREFIX AND NOT CORRADE_INCLUDE_INSTALL_PREFIX STREQUAL ".")
    message(DEPRECATION "CORRADE_INCLUDE_INSTALL_PREFIX is obsolete as its primary use was for old Android NDK versions. Please switch to the NDK r19+ layout instead of using this variable and recreate your build directory to get rid of this warning.")
    set(CORRADE_INCLUDE_INSTALL_DIR ${CORRADE_INCLUDE_INSTALL_PREFIX}/${CORRADE_INCLUDE_INSTALL_DIR})
endif()

mosra/corrade modules/UseCorrade.cmake :769

add_custom_command(TARGET ${plugin_name} POST_BUILD
    # This would be nice to Ninja, but BYPRODUCTS don't support generator
    # expressions right now (last checked: CMake 3.16)
    #BYPRODUCTS $<TARGET_FILE_DIR:${plugin_name}>/${plugin_name}${metadata_file_suffix}
    COMMAND ${CMAKE_COMMAND} -E copy ${metadata_file} $<TARGET_FILE_DIR:${plugin_name}>/${plugin_name}${metadata_file_suffix}
    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})

google/cppdap CMakeLists.txt :382

add_custom_command(TARGET ${target}
   POST_BUILD
   COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${target}> ${extdir})

cpputest/cpputest cmake/Modules/CppUTest.cmake :79

add_custom_command(
    TARGET ${target} POST_BUILD
    BYPRODUCTS "${CTEST_GENERATED_FILE}"
    COMMAND
        "${CMAKE_COMMAND}"
        -D "TESTS_DETAILED:BOOL=${_DETAILED}"
        -D "EXECUTABLE=$<TARGET_FILE:${target}>"
        -D "EMULATOR=${emulator}"
        -D "ARGS=${_EXTRA_ARGS}"
        -D "CTEST_FILE=${CTEST_GENERATED_FILE}"
        -P "${_CPPUTEST_DISCOVERY_SCRIPT}"
    WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
    VERBATIM
)

libcpr/cpr test/CMakeLists.txt :34

add_custom_command(TARGET ${_TEST_NAME}_tests POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:libcurl> $<TARGET_FILE_DIR:${_TEST_NAME}_tests>)

libcpr/cpr test/CMakeLists.txt :35

add_custom_command(TARGET ${_TEST_NAME}_tests POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:cpr> $<TARGET_FILE_DIR:${_TEST_NAME}_tests>)

libcpr/cpr test/CMakeLists.txt :77

add_custom_command(TARGET ssl_tests POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/data/certificates/root-ca.crt $<TARGET_FILE_DIR:ssl_tests>/data/certificates/root-ca.crt)

libcpr/cpr test/CMakeLists.txt :78

add_custom_command(TARGET ssl_tests POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/data/certificates/sub-ca.crt $<TARGET_FILE_DIR:ssl_tests>/data/certificates/sub-ca.crt)

libcpr/cpr test/CMakeLists.txt :79

add_custom_command(TARGET ssl_tests POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/data/certificates/ca-bundle.crt $<TARGET_FILE_DIR:ssl_tests>/data/certificates/ca-bundle.crt)

libcpr/cpr test/CMakeLists.txt :80

add_custom_command(TARGET ssl_tests POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/data/certificates/server.crt $<TARGET_FILE_DIR:ssl_tests>/data/certificates/server.crt)

libcpr/cpr test/CMakeLists.txt :81

add_custom_command(TARGET ssl_tests POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/data/keys/client.key $<TARGET_FILE_DIR:ssl_tests>/data/keys/client.key)

libcpr/cpr test/CMakeLists.txt :83

add_custom_command(TARGET ssl_tests POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/data/keys/server.key $<TARGET_FILE_DIR:ssl_tests>/data/keys/server.key)

libcpr/cpr test/CMakeLists.txt :84

add_custom_command(TARGET ssl_tests POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/data/keys/server.pub $<TARGET_FILE_DIR:ssl_tests>/data/keys/server.pub)

SFML/CSFML test/CMakeLists.txt :85

add_custom_command(
    TARGET test-csfml-system PRE_BUILD
    COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${SFML_TARGET}> $<TARGET_FILE_DIR:test-csfml-system> COMMAND_EXPAND_LISTS
)

dftbplus/dftbplus cmake/DftbPlusUtils.cmake :671

add_custom_command(TARGET lcov_eval POST_BUILD
  COMMAND ;
  COMMENT "LCOV total coverage evaluated in ${lcov_output_dir}/lcov.total")

microsoft/DirectXTex CMakeLists.txt :511

add_custom_command(TARGET texconv POST_BUILD
    COMMAND ${CMAKE_COMMAND} -E copy
    $<TARGET_RUNTIME_DLLS:texconv> $<TARGET_FILE_DIR:texconv>
    COMMAND_EXPAND_LISTS
    )

davisking/dlib dlib/CMakeLists.txt :1051

add_custom_command(TARGET dlib POST_BUILD
   # In some newer versions of windows/visual studio the output Config folder doesn't
   # exist at first, so you can't copy to it unless you make it yourself.  So make
   # sure the target folder exists first.
   COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/$<CONFIG>/"
   COMMAND ${CMAKE_COMMAND} -E copy "${mkl_iomp_dll}" "${CMAKE_BINARY_DIR}/$<CONFIG>/"
   )

davisking/dlib dlib/external/pybind11/tools/pybind11Common.cmake :414

add_custom_command(
  TARGET ${target_name}
  POST_BUILD
  COMMAND ${CMAKE_STRIP} ${x_opt} $<TARGET_FILE:${target_name}>)

doctest/doctest scripts/cmake/doctest.cmake :135

add_custom_command(
  TARGET ${TARGET} POST_BUILD
  BYPRODUCTS "${ctest_tests_file}"
  COMMAND "${CMAKE_COMMAND}"
          -D "TEST_TARGET=${TARGET}"
          -D "TEST_EXECUTABLE=$<TARGET_FILE:${TARGET}>"
          -D "TEST_EXECUTOR=${crosscompiling_emulator}"
          -D "TEST_WORKING_DIR=${_WORKING_DIRECTORY}"
          -D "TEST_SPEC=${_TEST_SPEC}"
          -D "TEST_EXTRA_ARGS=${_EXTRA_ARGS}"
          -D "TEST_PROPERTIES=${_PROPERTIES}"
          -D "TEST_ADD_LABELS=${_ADD_LABELS}"
          -D "TEST_PREFIX=${_TEST_PREFIX}"
          -D "TEST_SUFFIX=${_TEST_SUFFIX}"
          -D "TEST_LIST=${_TEST_LIST}"
          -D "TEST_JUNIT_OUTPUT_DIR=${_JUNIT_OUTPUT_DIR}"
          -D "CTEST_FILE=${ctest_tests_file}"
          -P "${_DOCTEST_DISCOVER_TESTS_SCRIPT}"
  VERBATIM
)

doctest/doctest scripts/playground/CMakeLists.txt :6

#add_custom_command(TARGET playground POST_BUILD COMMAND $<TARGET_FILE:${PROJECT_NAME}>)

doctest/doctest scripts/playground/CMakeLists.txt :7

#add_custom_command(TARGET playground POST_BUILD COMMAND ctest -C $<CONFIGURATION> --output-on-failure)

jrfonseca/drmingw src/mgwhelp/CMakeLists.txt :40

add_custom_command (
    TARGET mgwhelp
    POST_BUILD
    COMMAND ${CMAKE_COMMAND} -DCMAKE_OBJDUMP=${CMAKE_OBJDUMP} -DTARGET=$<TARGET_FILE:mgwhelp> -P ${CMAKE_SOURCE_DIR}/cmake/CheckDependencies.cmake
    VERBATIM
)

duckdb/duckdb CMakeLists.txt :975

add_custom_command(
  TARGET ${TARGET_NAME}
  POST_BUILD
  COMMAND emcc $<TARGET_FILE:${TARGET_NAME}> -o $<TARGET_FILE:${TARGET_NAME}>.wasm -O3 -sSIDE_MODULE=2 -sEXPORTED_FUNCTIONS="${EXPORTED_FUNCTIONS}" ${WASM_THREAD_FLAGS} ${TO_BE_LINKED}
  )

ElmerCSC/elmerfem fem/tests/CMakeLists.txt :100

ADD_CUSTOM_COMMAND(TARGET ElmerTests
  POST_BUILD
  COMMAND "${CMAKE_COMMAND}" "-E" "copy_directory"
  "${CMAKE_CURRENT_SOURCE_DIR}/${_file}"
  "${CMAKE_BINARY_DIR}/elmerfem-tests/${_file}")

embree/embree CMakeLists.txt :31

ADD_CUSTOM_COMMAND(TARGET ${target} POST_BUILD
  COMMAND ${EMBREE_SIGN_FILE} $<TARGET_FILE:${target}>)

Exiv2/exiv2 app/CMakeLists.txt :40

add_custom_command(
  TARGET exiv2
  POST_BUILD
  COMMAND ${CMAKE_COMMAND} -E copy_directory ${PROJECT_BINARY_DIR}/conanDlls ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
  COMMENT "Copy 3rd party DLLs the bin folder"
)

FirebirdSQL/firebird builds/cmake/BuildFunctions.cmake :28

add_custom_command(TARGET ${target} PRE_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory ${out}/${dir})

FirebirdSQL/firebird builds/cmake/BuildFunctions.cmake :204

add_custom_command(
    TARGET ${target}
    POST_BUILD
    COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:${target}> ${name2}
)

FirebirdSQL/firebird src/CMakeLists.txt :816

add_custom_command(
    TARGET boot_isql
    POST_BUILD
    #
    COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/extern/icu/icudt${ICU_VERSION}l.dat ${output_dir}/icudt${ICU_VERSION}l.dat
    #
    # one copy to boot directory
    COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/extern/icu/icudt${ICU_VERSION}l.dat $<TARGET_FILE_DIR:boot_isql>/icudt${ICU_VERSION}l.dat
)

FirebirdSQL/firebird src/CMakeLists.txt :977

add_custom_command(TARGET copy_files POST_BUILD
    COMMAND type ${f} >> ${output_dir}/include/ibase.tmp)

google/flatbuffers tests/fuzzer/CMakeLists.txt :159

add_custom_command(
  TARGET monster_fuzzer PRE_BUILD
  COMMAND ${CMAKE_COMMAND} -E copy
  ${CMAKE_SOURCE_DIR}/../monster_test.bfbs
  ${CMAKE_CURRENT_BINARY_DIR}/monster_test.bfbs)

google/flatbuffers tests/fuzzer/CMakeLists.txt :167

add_custom_command(
  TARGET annotator_fuzzer PRE_BUILD

  COMMAND ${CMAKE_COMMAND} -E copy
  ${CMAKE_SOURCE_DIR}/../annotated_binary/annotated_binary.bfbs
  ${CMAKE_CURRENT_BINARY_DIR}/annotated_binary.bfbs

  COMMAND ${CMAKE_COMMAND} -E copy
  ${CMAKE_SOURCE_DIR}/../annotated_binary/annotated_binary.bin
  ${CMAKE_CURRENT_BINARY_DIR}/seed_annotator/annotated_binary.bin
)

google/flatbuffers tests/fuzzer/CMakeLists.txt :181

add_custom_command(
  TARGET 64bit_fuzzer PRE_BUILD

  COMMAND ${CMAKE_COMMAND} -E copy
  ${CMAKE_SOURCE_DIR}/../64bit/test_64bit.bin
  ${CMAKE_CURRENT_BINARY_DIR}/seed_64bit/test_64bit.bin
)

google/flatbuffers tests/fuzzer/CMakeLists.txt :228

add_custom_command(
  TARGET monster_debug PRE_BUILD
  COMMAND ${CMAKE_COMMAND} -E copy
  ${CMAKE_SOURCE_DIR}/../monster_test.bfbs
  ${CMAKE_CURRENT_BINARY_DIR}/monster_test.bfbs)

fltk/fltk CMake/fl_create_example.cmake :151

add_custom_command(
  TARGET ${TARGET_NAME} POST_BUILD
  COMMAND cp ${FLTK_SOURCE_DIR}/CMake/macOS-bundle-wrapper.in ${WRAPPER}
  COMMAND chmod u+x,g+x,o+x ${WRAPPER}
  BYPRODUCTS ${WRAPPER}
  # COMMENT "Creating macOS bundle wrapper script ${WRAPPER}"
  VERBATIM
)

fltk/fltk fltk-options/CMakeLists.txt :69

add_custom_command(
  TARGET ${TARGET} POST_BUILD
  COMMAND cp ${FLTK_SOURCE_DIR}/CMake/macOS-bundle-wrapper.in ${WRAPPER}
  COMMAND chmod u+x,g+x,o+x ${WRAPPER}
  BYPRODUCTS ${WRAPPER}
  VERBATIM
)

fltk/fltk fluid/CMakeLists.txt :77

add_custom_command(
  TARGET ${TARGET} POST_BUILD
  COMMAND cp ${FLTK_SOURCE_DIR}/CMake/macOS-bundle-wrapper.in ${WRAPPER}
  COMMAND chmod u+x,g+x,o+x ${WRAPPER}
  BYPRODUCTS ${WRAPPER}
  VERBATIM
)

FluidSynth/fluidsynth cmake_admin/CodeCoverage.cmake :351

add_custom_command(TARGET ${Coverage_NAME} POST_BUILD
    COMMAND ;
    COMMENT "Lcov code coverage info report saved in ${Coverage_NAME}.info."
)

FluidSynth/fluidsynth cmake_admin/CodeCoverage.cmake :469

add_custom_command(TARGET ${Coverage_NAME} POST_BUILD
    COMMAND "echo"
    COMMENT "Open ./${Coverage_NAME}/index.html in your browser to view the coverage report."
)

facebook/folly build/fbcode_builder/CMake/FBPythonBinary.cmake :302

add_custom_command(
  TARGET "${TARGET}.GEN_PY_EXE" POST_BUILD
  BYPRODUCTS "${ctest_tests_file}"
  COMMAND
    "${CMAKE_COMMAND}"
    -D "TEST_TARGET=${TARGET}"
    -D "TEST_INTERPRETER=${Python3_EXECUTABLE}"
    -D "TEST_ENV=${ARG_ENV}"
    -D "TEST_EXECUTABLE=$<TARGET_PROPERTY:${TARGET}.GEN_PY_EXE,EXECUTABLE>"
    -D "TEST_WORKING_DIR=${ARG_WORKING_DIRECTORY}"
    -D "TEST_LIST=${ARG_TEST_LIST}"
    -D "TEST_PREFIX=${TARGET}::"
    -D "TEST_PROPERTIES=${ARG_PROPERTIES}"
    -D "CTEST_FILE=${ctest_tests_file}"
    -P "${FB_PY_TEST_DISCOVER_SCRIPT}"
  VERBATIM
)

facebook/folly folly/CMakeLists.txt :61

add_custom_command(TARGET create_binding_symlink PRE_BUILD
  COMMAND
    ${CMAKE_COMMAND} -E create_symlink
    "${_src}"
    "${_cybld}/folly/${_target_file}"
)

facebook/folly folly/CMakeLists.txt :80

add_custom_command(TARGET folly_python_bindings POST_BUILD
  COMMAND ${CMAKE_COMMAND} -E env
    "CFLAGS=${CMAKE_C_FLAGS}"
    "CXXFLAGS=${CMAKE_CXX_FLAGS}"
    "CC=${CMAKE_C_COMPILER}"
    "CXX=${CMAKE_CXX_COMPILER}"
    python3 ${CMAKE_CURRENT_SOURCE_DIR}/python/setup.py
    build_ext -f ${incs} ${libs}
  BYPRODUCTS
    ${_cybld}/folly/executor_api.h
    ${_cybld}/folly/iobuf_api.h
  WORKING_DIRECTORY ${_cybld}
)

facebook/folly folly/CMakeLists.txt :101

add_custom_command(TARGET create_post_binding_symlink
  COMMAND
    ${CMAKE_COMMAND} -E create_symlink
    "${_cybld}/folly/iobuf_api.h"
    "${_cybld}/folly/python/iobuf_api.h"
)

facebook/folly folly/CMakeLists.txt :133

add_custom_command(TARGET folly_python_bindings
  COMMAND ${CMAKE_COMMAND} -E env
    "CFLAGS=${CMAKE_C_FLAGS}"
    "CXXFLAGS=${CMAKE_CXX_FLAGS}"
    "CC=${CMAKE_C_COMPILER}"
    "CXX=${CMAKE_CXX_COMPILER}"
    python3 ${CMAKE_CURRENT_SOURCE_DIR}/python/setup.py
    bdist_wheel
  WORKING_DIRECTORY ${_cybld}
)

fontforge/fontforge fontforge/CMakeLists.txt :229

add_custom_command(TARGET fontforge POST_BUILD
        COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:fontforge> ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
)

pietrodelugas/fox examples/CMakeLists.txt :32

ADD_CUSTOM_COMMAND(TARGET sax_example PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/examples/staffNS.xml ${PROJECT_BINARY_DIR}/examples)

pietrodelugas/fox examples/CMakeLists.txt :49

ADD_CUSTOM_COMMAND(TARGET dom_example_2 PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/examples/h2o.xml ${PROJECT_BINARY_DIR}/examples)

pietrodelugas/fox examples/CMakeLists.txt :58

ADD_CUSTOM_COMMAND(TARGET dom_example_3 PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/examples/h2o.xml ${PROJECT_BINARY_DIR}/examples)

FreeCAD/FreeCAD src/Mod/TechDraw/App/CMakeLists.txt :301

ADD_CUSTOM_COMMAND(TARGET TechDraw
                   POST_BUILD
                   COMMAND ${CMAKE_COMMAND} -E copy_directory
                   ${CMAKE_SOURCE_DIR}/src/Mod/TechDraw/Symbols
                   ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_DATADIR}/Mod/TechDraw/Symbols
)

FreeRDP/FreeRDP cmake/MergeStaticLibs.cmake :78

add_custom_command(
  TARGET ${output_target} POST_BUILD COMMAND rm ${outfile} COMMAND /usr/bin/libtool -static -o ${outfile}
                                                                   ${libfiles}
)

FreeRDP/FreeRDP cmake/MergeStaticLibs.cmake :141

add_custom_command(
  TARGET ${output_target} POST_BUILD COMMAND ${CMAKE_COMMAND} -E echo "Running: ${CMAKE_RANLIB} ${outfile}"
  COMMAND ${CMAKE_RANLIB} ${outfile}
)

malaterre/GDCM Utilities/gdcmopenjpeg/src/lib/openjp2/CMakeLists.txt :158

add_custom_command(TARGET ${OPENJPEG_LIBRARY_NAME}
  COMMAND ${CPPCHECK_EXECUTABLE} -DWIN32 ${f})

malaterre/GDCM Utilities/VTK/CMakeLists.txt :275

add_custom_command(TARGET ${SWIG_MODULE_php_vtkgdcm_REAL_NAME}
  PRE_BUILD
  COMMAND sed -i -e 's/zend_error_noreturn/zend_error/g' "${swig_generated_file_fullname}"
  COMMENT "Patching zend_error_noreturn into zend_error"
  )

malaterre/GDCM Wrapping/PHP/CMakeLists.txt :66

add_custom_command(TARGET ${SWIG_MODULE_php_gdcm_REAL_NAME}
  PRE_BUILD
  COMMAND sed -i -e 's/zend_error_noreturn/zend_error/g' "${swig_generated_file_fullname}"
  COMMENT "Patching zend_error_noreturn into zend_error"
)

geographiclib/geographiclib wrapper/c/CMakeLists.txt :29

add_custom_command (TARGET ${PROJECT_NAME} POST_BUILD
  COMMAND
    ${CMAKE_COMMAND} -E
    copy $<TARGET_FILE:${GeographicLib_LIBRARIES}> ${CMAKE_CFG_INTDIR}
  COMMENT "Installing shared library in build tree")

geographiclib/geographiclib wrapper/excel/CMakeLists.txt :42

    add_custom_command (TARGET ${PROJECT_NAME} POST_BUILD
      COMMAND
        ${CMAKE_COMMAND} -E
        copy $<TARGET_FILE:${GeographicLib_LIBRARIES}> ${CMAKE_CFG_INTDIR}
      COMMENT "Installing shared library in build tree
${INSTALL_MSG}")

geographiclib/geographiclib wrapper/python/CMakeLists.txt :37

add_custom_command (TARGET ${PROJECT_NAME} POST_BUILD
  COMMAND
    ${CMAKE_COMMAND} -E
    copy $<TARGET_FILE:${GeographicLib_LIBRARIES}> ${CMAKE_CFG_INTDIR}
  COMMENT "Installing shared library in build tree")

cginternals/glbinding source/tests/CMakeLists.txt :43

add_custom_command(TARGET test POST_BUILD 
    COMMAND $<TARGET_FILE:${target}> --gtest_output=xml:gtests-${target}.xml
)

gnuradio/gnuradio cmake/Modules/CodeCoverage.cmake :138

add_custom_command(
    TARGET ${_targetname}
    POST_BUILD
    COMMAND ;
    COMMENT
        "Open ./${_outputname}/index.html in your browser to view the coverage report."
)

gnuradio/gnuradio gr-utils/modtool/templates/gr-newmod/python/howto/bindings/CMakeLists.txt :32

add_custom_command(
    TARGET howto_python
    POST_BUILD
    COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:howto_python>
            ${PROJECT_BINARY_DIR}/test_modules/gnuradio/howto/)

sciapp/gr CMakeLists.txt :1229

add_custom_command(
  TARGET GKSTerm
  POST_BUILD
  COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/lib/gks/quartz/English.lproj
          ${CMAKE_CURRENT_BINARY_DIR}/GKSTerm.app/Contents/Resources/English.lproj
  BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/GKSTerm.app/Contents/Resources/English.lproj
)

sciapp/gr CMakeLists.txt :1792

add_custom_command(
  TARGET libGR
  PRE_LINK
  COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/lib/gks/fonts/${FONT}"
          "${CMAKE_CURRENT_BINARY_DIR}/fonts/${FONT}"
  BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/fonts/${FONT}"
)

silnrsi/graphite tests/fuzz-tests/CMakeLists.txt :37

add_custom_command(TARGET fuzztest PRE_BUILD COMMAND echo ${fname})

silnrsi/graphite tests/fuzz-tests/CMakeLists.txt :40

add_custom_command(TARGET fuzztest PRE_BUILD COMMAND ${PROJECT_SOURCE_DIR}/../fuzztest ARGS -l fuzzregress-${fname}-${textname}-${tname}.log -f ${PROJECT_SOURCE_DIR}/../fonts/${fname}.ttf -q ${noasan} --include=required,graphite --exclude==fontdir,opentype,volt,advtypo,post -V -k --input=${PROJECT_SOURCE_DIR}/${fname}/${textname}/${tname} -- ../comparerenderer/comparerenderer -q ${dirargs} -s 12 -n -f {} -t ${PROJECT_SOURCE_DIR}/../texts/${textname}.txt)