86Box/86Box
src/CMakeLists.txt
:268
add_custom_command(TARGET 86Box POST_BUILD COMMAND paxctl ARGS +m $<TARGET_FILE:86Box> COMMENT "Disable PaX MPROTECT")
add_custom_command(TARGET 86Box POST_BUILD COMMAND paxctl ARGS +m $<TARGET_FILE:86Box> COMMENT "Disable PaX MPROTECT")
ADD_CUSTOM_COMMAND(OUTPUT parser.cpp
COMMAND ${CMAKE_COMMAND} -E copy ${BISON_FLEX_PRECOMPILE_DIR}/parser.cpp ${CMAKE_CURRENT_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} -E copy ${BISON_FLEX_PRECOMPILE_DIR}/parser.h ${CMAKE_CURRENT_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} -E copy ${BISON_FLEX_PRECOMPILE_DIR}/location.hh ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Using pre-generated Bison Output from ${BISON_FLEX_PRECOMPILE_DIR}")
add_custom_command(
OUTPUT dill_${_arch}.c vm_include.c
COMMAND ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/${_arch}.ops
DEPENDS ${_arch}.ops
)
add_custom_command(
OUTPUT dill_${_arch}.c
COMMAND ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/${_arch}.ops
DEPENDS ${_arch}.ops
)
add_custom_command(OUTPUT dill_${_arch}.c
COMMAND ${CMAKE_COMMAND} -E copy
${PROJECT_SOURCE_DIR}/pregen-source/dill_${_arch}.c dill_${_arch}.c
COMMENT "Copying pregen diil_${_arch}.c build area")
add_custom_command(
OUTPUT dill.h dill.c
COMMAND ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/base.ops ${BASE_OPS_ARG}
DEPENDS base.ops
)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/regress.c
COMMAND ${PERL_EXECUTABLE} -w
${CMAKE_CURRENT_SOURCE_DIR}/test-gen
${TEST_PERL_FLAGS} > regress.c
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/test-gen
)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/call-test.c
COMMAND ${PERL_EXECUTABLE} -w
${CMAKE_CURRENT_SOURCE_DIR}/call-gen ${TEST_PERL_FLAGS} > call-test.c
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/call-gen
)
ADD_CUSTOM_COMMAND(OUTPUT cod.tab.c
COMMAND ${CMAKE_COMMAND} -E copy ${BISON_FLEX_PRECOMPILE_DIR}/cod.tab.c ${CMAKE_CURRENT_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} -E copy ${BISON_FLEX_PRECOMPILE_DIR}/cod.tab.h ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Using pre-generated Bison Output from ${BISON_FLEX_PRECOMPILE_DIR}")
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/general.c
COMMAND perl ${CMAKE_CURRENT_SOURCE_DIR}/general.pl
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/general.pl
)
add_custom_command(OUTPUT general.c
COMMAND ${CMAKE_COMMAND} -E copy
${PROJECT_SOURCE_DIR}/pregen-source/cod/tests/general.c general.c
COMMENT "Copying pregen general.c to build area")
add_custom_command(
OUTPUT ${jnilib}
DEPENDS ${lib}
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${lib}> ${jnilib})
add_custom_command(
OUTPUT ${native}
DEPENDS ${prog}
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${prog}> ${native}
)
add_custom_command(
OUTPUT luajit_protos
DEPENDS ${SOURCES}
COMMAND Python::Interpreter ${PROJECT_SOURCE_DIR}/python/checkdocs.py
-c ${CMAKE_C_COMPILER}
-p luajit_protos
-b ${PROJECT_BINARY_DIR}
-s ${PROJECT_SOURCE_DIR}
-w
)
add_custom_command(
OUTPUT ${SEARCH_INDEX_JS}
DEPENDS ${HTML_REFS_TIMESTAMP} make_search_index
COMMAND ${MAKE_SEARCH_INDEX} ${HTML_REFS} > ${SEARCH_INDEX_JS}
)
add_custom_command(
OUTPUT ${HTML_DIR}/${page}.html
DEPENDS
${PROTOS_TIMESTAMP}
${HTML_REFS_TIMESTAMP}
${page_src}
${CMAKE_CURRENT_BINARY_DIR}/inc.a.html
${CMAKE_CURRENT_BINARY_DIR}/inc.z.html
${SEARCH_INDEX_JS}
${API_EXAMPLES}
make_doc
insert_timestamp
COMMAND
${INSERT_TIMESTAMP} ${CMAKE_SOURCE_DIR}/include/allegro5/base.h > inc.timestamp.html
COMMAND
${MAKE_DOC}
--examples ${API_EXAMPLES}
--to html
--raise-sections
--include-before-body inc.a.html
--include-after-body inc.timestamp.html
--include-after-body inc.z.html
--css pandoc.css
--include-in-header ${SRC_DIR}/custom_header.html
--standalone
--toc
-- ${page_src} ${HTML_REFS}
> ${HTML_DIR}/${page}.html
)
add_custom_command(
OUTPUT ${HTML_DIR}/images/${image}.png
DEPENDS
${SRC_REFMAN_DIR}/images/${image}.png
COMMAND
"${CMAKE_COMMAND}" -E copy
"${SRC_REFMAN_DIR}/images/${image}.png" "${HTML_DIR}/images/${image}.png"
)
add_custom_command(
OUTPUT ${TEXI_DIR}/refman.texi
DEPENDS ${PROTOS_TIMESTAMP} ${TITLE_TXT} ${PAGES_TXT}
make_doc
COMMAND ${MAKE_DOC}
--to texinfo
--standalone
--
${TITLE_TXT} ${PAGES_TXT}
> ${TEXI_DIR}/refman.texi
)
add_custom_command(
OUTPUT tags
DEPENDS ${PAGES_TXT}
COMMAND ${CTAGS}
--langdef=allegrodoc
--langmap=allegrodoc:.txt
"--regex-allegrodoc=/^#+ API: (.+)/\\1/"
${PAGES_TXT}
VERBATIM
)
add_custom_command(
OUTPUT ${ANTLR_${Name}_OUTPUTS}
COMMAND ${Java_JAVA_EXECUTABLE} -jar ${ANTLR_EXECUTABLE}
${InputFile}
-o ${ANTLR_${Name}_OUTPUT_DIR}
-no-listener
-Dlanguage=Cpp
${ANTLR_TARGET_COMPILE_FLAGS}
DEPENDS ${InputFile}
${ANTLR_TARGET_DEPENDS}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Building ${Name} with ANTLR ${ANTLR_VERSION}")
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)
add_custom_command(OUTPUT ${GRPC_STATIC_LIBRARY_GRPCPP_FOR_AR}
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:gRPC::grpc++>
${GRPC_STATIC_LIBRARY_GRPCPP_FOR_AR}
DEPENDS grpc_ep)
add_custom_command(OUTPUT ${PERF_PROTO_GENERATED_FILES}
COMMAND ${ARROW_PROTOBUF_PROTOC} "-I${CMAKE_CURRENT_SOURCE_DIR}"
"--cpp_out=${CMAKE_CURRENT_BINARY_DIR}" "perf.proto"
DEPENDS ${PROTO_DEPENDS})
add_custom_command(OUTPUT ${GANDIVA_PRECOMPILED_BC_PATH}
COMMAND ${LLVM_LINK_EXECUTABLE} -o ${GANDIVA_PRECOMPILED_BC_PATH}
${GANDIVA_PRECOMPILED_BC_FILES}
DEPENDS ${GANDIVA_PRECOMPILED_BC_FILES})
add_custom_command(OUTPUT ${GANDIVA_PRECOMPILED_CC_PATH}
COMMAND ${PYTHON_EXECUTABLE}
"${CMAKE_CURRENT_SOURCE_DIR}/../make_precompiled_bitcode.py"
${GANDIVA_PRECOMPILED_CC_IN_PATH}
${GANDIVA_PRECOMPILED_BC_PATH} ${GANDIVA_PRECOMPILED_CC_PATH}
DEPENDS ${GANDIVA_PRECOMPILED_CC_IN_PATH}
${GANDIVA_PRECOMPILED_BC_PATH})
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)
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)
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)
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)
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)
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)
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)
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)
add_custom_command(
OUTPUT "${glue_OUTPUT_PATH}.cpp"
COMMAND ${PYTHON_EXECUTABLE} $ENV{EMSCRIPTEN}/tools/webidl_binder.py
${glue_INPUT_IDL} ${glue_OUTPUT_PATH}
DEPENDS ${draco_js_dec_idl}
COMMENT "Generating ${glue_OUTPUT_PATH}.cpp."
WORKING_DIRECTORY ${draco_build}
VERBATIM)
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj
COMMAND ${CMAKE_RC_COMPILER}
-D GCC_WINDRES
-I ${CMAKE_CURRENT_SOURCE_DIR}
-I ${CMAKE_CURRENT_BINARY_DIR}
-o ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj
-i ${CMAKE_CURRENT_SOURCE_DIR}/win32/zlib1.rc)
add_custom_command(OUTPUT build COMMAND ${PYTHON_EXECUTABLE} setup.py build DEPENDS ${PYTHON_SRC} ${PYTHON_HDR} setup.py)
add_custom_command(
OUTPUT ${resh}
DEPENDS ${src} encodefile
COMMAND encodefile
ARGS ${src} ${resh} ${file_we}
COMMENT "Encoding ${src}"
)
add_custom_command(
OUTPUT programmer_types.texi
DEPENDS programmer_types.txt
COMMAND ${CMAKE_COMMAND}
-D TXT_FILE=programmer_types.txt
-D TEXI_FILE=programmer_types.texi
-P "${CMAKE_CURRENT_SOURCE_DIR}/programmer_types.cmake"
VERBATIM
)
add_custom_command(
OUTPUT avrstats.texi
DEPENDS avrdude_binaries
COMMAND echo -n "@set NUMPARTS " >> avrstats.texi
COMMAND $<TARGET_FILE:avrdude> -C ${AVRDUDE_CONF} -p \? 2>&1 | grep = | wc -l >> avrstats.texi
COMMAND echo -n "@set NUMPROGRAMMERS " >> avrstats.texi
COMMAND $<TARGET_FILE:avrdude> -C ${AVRDUDE_CONF} -c \? 2>&1 | grep = | wc -l >> avrstats.texi
VERBATIM
)
add_custom_command(TARGET basisu POST_BUILD COMMAND strip -X -x ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/basisu)
add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/lcov/index.html
COMMAND ${LCOV} -q -z -d .
COMMAND ${LCOV} -q --no-external -c -b "${CMAKE_SOURCE_DIR}" -d . -o before.lcov -i
COMMAND ${CTEST} --force-new-ctest-process
COMMAND ${LCOV} -q --no-external -c -b "${CMAKE_SOURCE_DIR}" -d . -o after.lcov
COMMAND ${LCOV} -q -a before.lcov -a after.lcov --output-file final.lcov
COMMAND ${LCOV} -q -r final.lcov "'${CMAKE_SOURCE_DIR}/test/*'" -o final.lcov
COMMAND ${GENHTML} final.lcov -o lcov --demangle-cpp --sort -p "${CMAKE_BINARY_DIR}" -t benchmark
DEPENDS filter_test benchmark_test options_test basic_test fixture_test complexity_test
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMENT "Running LCOV"
)
add_custom_command(
OUTPUT ${dest}
COMMAND ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/${src} ${PERLASM_STYLE} ${PERLASM_FLAGS} ${ARGN} > ${dest}
DEPENDS
${src}
${PROJECT_SOURCE_DIR}/crypto/perlasm/arm-xlate.pl
${PROJECT_SOURCE_DIR}/crypto/perlasm/x86_64-xlate.pl
${PROJECT_SOURCE_DIR}/crypto/perlasm/x86asm.pl
${PROJECT_SOURCE_DIR}/crypto/perlasm/x86gas.pl
${PROJECT_SOURCE_DIR}/crypto/perlasm/x86masm.pl
${PROJECT_SOURCE_DIR}/crypto/perlasm/x86nasm.pl
WORKING_DIRECTORY .
)
#add_custom_command(
# OUTPUT err_data.c
# COMMAND ${GO_EXECUTABLE} run err_data_generate.go > ${CMAKE_CURRENT_BINARY_DIR}/err_data.c
# DEPENDS
# err_data_generate.go
# asn1.errordata
# bio.errordata
# bn.errordata
# cipher.errordata
# conf.errordata
# dh.errordata
# digest.errordata
# dsa.errordata
# ecdh.errordata
# ecdsa.errordata
# ec.errordata
# engine.errordata
# evp.errordata
# hkdf.errordata
# obj.errordata
# pem.errordata
# pkcs8.errordata
# rsa.errordata
# ssl.errordata
# x509.errordata
# x509v3.errordata
# WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
#)
add_custom_command(TARGET NDK_GDB POST_BUILD COMMAND ${CMAKE_STRIP} ${TARGET_LOCATION})
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
)
ADD_CUSTOM_COMMAND(
OUTPUT ${BULLET_PHYSICS_SOURCE_DIR}/src/LinearMath/btSerializer64.cpp
COMMAND ${CMAKE_CFG_INTDIR}/makesdna ${BULLET_PHYSICS_SOURCE_DIR}/src/LinearMath/btSerializer64.cpp ${BULLET_PHYSICS_SOURCE_DIR}/Extras/Serialize/CommonSerialize/
DEPENDS makesdna
)
add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/git_hash.h
COMMAND ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_LIST_DIR}/git_hash.cmake")
add_custom_command(
OUTPUT "${output_base}.c++" "${output_base}.h"
COMMAND "${CAPNP_EXECUTABLE}"
ARGS compile
-o ${CAPNPC_CXX_EXECUTABLE}${output_dir}
--src-prefix ${CAPNPC_SRC_PREFIX}
${include_path}
${CAPNPC_FLAGS}
${file_path}
DEPENDS "${schema_file}" ${tool_depends}
COMMENT "Compiling Cap'n Proto schema ${schema_file}"
VERBATIM
)
add_custom_command(OUTPUT ${TDIR}/${FILE}.gcov
COMMAND ${GCOV_ENV} ${GCOV_BIN} ${TDIR}/${FILE}.gcno > /dev/null
DEPENDS ${TNAME} ${TDIR}/${FILE}.gcno
WORKING_DIRECTORY ${FILE_PATH}
)
add_custom_command(OUTPUT "${OUTFILE}.raw"
COMMAND cat ${ARGV} > ${OUTFILE}.raw
DEPENDS ${ARGV}
COMMENT "Generating ${FILE_REL}"
)
add_custom_command(OUTPUT ${OUTFILE} COMMAND ${GCOV_ENV} ${GENINFO_BIN}
--quiet --base-directory ${PROJECT_SOURCE_DIR} --initial
--gcov-tool ${GCOV_BIN} --output-filename ${OUTFILE}
${GENINFO_EXTERN_FLAG} ${TDIR}/${FILE}.gcno
DEPENDS ${TNAME}
COMMENT "Capturing initial coverage data for ${FILE}"
)
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
)
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
)
add_custom_command(TARGET SelfTest PRE_LINK
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:Catch2>
$<TARGET_FILE:Catch2WithMain> $<TARGET_FILE_DIR:SelfTest>
)
add_custom_command(
OUTPUT
"${header_destination}" "${depfile_destination}"
COMMAND
"${CBINDGEN_PATH}"
--output "${header_destination}"
--depfile "${depfile_destination}"
${ARGN}
DEPFILE "${depfile_destination}"
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
COMMENT "Running cbindgen"
COMMAND_EXPAND_LISTS
)
add_custom_command(
OUTPUT ccache.1
# Convert monospace to bold since that's typically rendered better when
# viewing the man page.
COMMAND perl -pe "'s!\\\\f\\(CR(.*?)\\\\fP!\\\\fB\\1\\\\fP!g'" ccache.1.tmp >ccache.1
MAIN_DEPENDENCY ccache.1.tmp
)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/ccache.1"
DESTINATION "${CMAKE_INSTALL_MANDIR}/man1"
)
add_custom_target(doc-man-page DEPENDS ccache.1)
add_custom_target(doc ALL DEPENDS doc-html doc-man-page)
endif()
add_custom_command (OUTPUT ${_outfile}
COMMAND ${QT_RCC_EXECUTABLE}
ARGS -o ${_outfile} ${_abs_FILE}
DEPENDS ${_abs_FILE})
add_custom_command(TARGET ${target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${src}/${_file}" "${dst}/${_file}"
)
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)
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)
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)
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})
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Periodic_3_triangulation_3.qhc
DEPENDS Periodic_3_triangulation_3.qhp Periodic_3_triangulation_3.qhcp
COMMAND
${CGAL_QCOLLECTIONGENERATOR_TARGET}
${CMAKE_CURRENT_SOURCE_DIR}/Periodic_3_triangulation_3.qhcp -o
${CMAKE_CURRENT_BINARY_DIR}/Periodic_3_triangulation_3.qhc)
add_custom_command(
OUTPUT Periodic_Lloyd_3.qhc
DEPENDS Periodic_Lloyd_3.qhp Periodic_Lloyd_3.qhcp
COMMAND
${CGAL_QCOLLECTIONGENERATOR_TARGET}
${CMAKE_CURRENT_SOURCE_DIR}/Periodic_Lloyd_3.qhcp -o
${CMAKE_CURRENT_BINARY_DIR}/Periodic_Lloyd_3.qhc
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
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."
)
add_custom_command(TARGET fea
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory ${CHPY_FEA_PYD_PATH}/pychrono)
add_custom_command(TARGET vehicle
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CHPY_VEHICLE_PY_FILE} ${CHPY_VEHICLE_PYD_PATH}/pychrono)
add_custom_command(TARGET sensor
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory ${CHPY_SENSOR_PYD_PATH}/pychrono)
add_custom_command(TARGET robot
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CHPY_VEHICLE_PY_FILE} ${CHPY_VEHICLE_PYD_PATH}/pychrono)
add_custom_command(TARGET parsers
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory ${CHPY_PARSERS_PYD_PATH}/pychrono)
add_custom_command(TARGET ros
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CHPY_ROS_PY_FILE} ${CHPY_ROS_PYD_PATH}/pychrono)
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>")
add_custom_command(TARGET Chrono_vehicle POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${OpenRG_DLL}"
"${PROJECT_BINARY_DIR}/bin/$<CONFIGURATION>")
add_custom_command(
TARGET ${Coverage_NAME}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E echo ${INFO_MSG})
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${DATA_FILE}"
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/${DATA_FILE}"
"${CMAKE_CURRENT_BINARY_DIR}/${DATA_FILE}"
MAIN_DEPENDENCY "${CMAKE_CURRENT_SOURCE_DIR}/${DATA_FILE}"
VERBATIM)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/codebookge.c
COMMAND generate_codebook ge_cb ${CODEBOOKSGE} > ${CMAKE_CURRENT_BINARY_DIR}/codebookge.c
DEPENDS generate_codebook ${CODEBOOKSGE}
)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/codebookd.c
COMMAND generate_codebook lsp_cbd ${CODEBOOKSD} > ${CMAKE_CURRENT_BINARY_DIR}/codebookd.c
DEPENDS generate_codebook ${CODEBOOKSD}
)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/codebookjmv.c
COMMAND generate_codebook lsp_cbjmv ${CODEBOOKSJMV} > ${CMAKE_CURRENT_BINARY_DIR}/codebookjmv.c
DEPENDS generate_codebook ${CODEBOOKSJMV}
)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/codebookge.c
COMMAND generate_codebook ge_cb ${CODEBOOKSGE} > ${CMAKE_CURRENT_BINARY_DIR}/codebookge.c
DEPENDS generate_codebook ${CODEBOOKSGE}
)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/codebooknewamp2_energy.c
COMMAND generate_codebook newamp2_energy_cb ${CODEBOOKSNEWAMP2_ENERGY} > ${CMAKE_CURRENT_BINARY_DIR}/codebooknewamp2_energy.c
DEPENDS generate_codebook ${CODEBOOKSNEWAMP2_ENERGY}
)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/fast_fading_samples.float
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/faster_fading_samples.float
COMMAND cd ${CMAKE_CURRENT_SOURCE_DIR} && ./fading_files.sh ${CMAKE_CURRENT_BINARY_DIR}
)
add_custom_command(
TARGET codelite
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/compile_commands.json
${CMAKE_SOURCE_DIR}/compile_commands.json)
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}
)
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
)
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>
)
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"
)
# 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()
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})
add_custom_command(
OUTPUT ${resource_out}
COMMAND ${command} ${plugin_name} --single ${metadata_file} ${resource_out}
DEPENDS Corrade::rc ${metadata_file}
COMMENT "Compiling static plugin metadata file ${resource_out}"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
add_custom_command(OUTPUT validateCFG-cmd APPEND
COMMAND ${LIBXML2_XMLLINT_EXECUTABLE} --noout --relaxng ${CMAKE_SOURCE_DIR}/cfg/cppcheck-cfg.rng ${cfg})
add_custom_command(TARGET ${target}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${target}> ${extdir})
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
)
add_custom_command(TARGET ${_TEST_NAME}_tests POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:libcurl> $<TARGET_FILE_DIR:${_TEST_NAME}_tests>)
add_custom_command(TARGET ${_TEST_NAME}_tests POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:cpr> $<TARGET_FILE_DIR:${_TEST_NAME}_tests>)
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)
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)
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)
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)
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)
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)