2018-01-22 15:20:10 +00:00
|
|
|
|
2019-04-25 12:07:45 +00:00
|
|
|
if(CAPSTONE_LOCAL_DIR)
|
|
|
|
message(STATUS "Capstone: using local Capstone directory.")
|
|
|
|
|
|
|
|
ExternalProject_Add(capstone-project
|
|
|
|
DOWNLOAD_COMMAND ""
|
|
|
|
SOURCE_DIR "${CAPSTONE_LOCAL_DIR}"
|
|
|
|
CMAKE_ARGS
|
|
|
|
# This does not work on MSVC, but may be useful on Linux.
|
|
|
|
-DCMAKE_BUILD_TYPE=Release
|
|
|
|
-DCAPSTONE_BUILD_STATIC=ON
|
|
|
|
-DCAPSTONE_BUILD_SHARED=OFF
|
2020-03-23 09:01:03 +00:00
|
|
|
-DCAPSTONE_BUILD_STATIC_RUNTIME=${RETDEC_MSVC_STATIC_RUNTIME}
|
2019-04-25 12:07:45 +00:00
|
|
|
-DCAPSTONE_BUILD_TESTS=OFF
|
|
|
|
-DCAPSTONE_X86_ATT_DISABLE=OFF
|
|
|
|
# Enabled architectures.
|
|
|
|
-DCAPSTONE_ARM_SUPPORT=ON
|
|
|
|
-DCAPSTONE_MIPS_SUPPORT=ON
|
|
|
|
-DCAPSTONE_PPC_SUPPORT=ON
|
|
|
|
-DCAPSTONE_X86_SUPPORT=ON
|
|
|
|
# Disabled architectures.
|
|
|
|
-DCAPSTONE_ARM64_SUPPORT=OFF
|
|
|
|
-DCAPSTONE_M68K_SUPPORT=OFF
|
|
|
|
-DCAPSTONE_SPARC_SUPPORT=OFF
|
|
|
|
-DCAPSTONE_SYSZ_SUPPORT=OFF
|
|
|
|
-DCAPSTONE_XCORE_SUPPORT=OFF
|
|
|
|
-DCAPSTONE_TMS320C64X_SUPPORT=OFF
|
|
|
|
-DCAPSTONE_M680X_SUPPORT=OFF
|
|
|
|
# Force the use of the same compiler as used to build the top-level
|
|
|
|
# project. Otherwise, the external project may pick up a different
|
|
|
|
# compiler, which may result in link errors.
|
|
|
|
"${CMAKE_C_COMPILER_OPTION}"
|
|
|
|
"${CMAKE_CXX_COMPILER_OPTION}"
|
2020-06-05 05:42:46 +00:00
|
|
|
-DCMAKE_POSITION_INDEPENDENT_CODE=${CMAKE_POSITION_INDEPENDENT_CODE}
|
2020-01-22 12:02:53 +00:00
|
|
|
# Patch the Capstone sources.
|
|
|
|
PATCH_COMMAND
|
|
|
|
${CMAKE_COMMAND} -Dcapstone_path=<SOURCE_DIR> -P ${CMAKE_CURRENT_SOURCE_DIR}/patch.cmake
|
2019-04-25 12:07:45 +00:00
|
|
|
# Disable the update step.
|
|
|
|
UPDATE_COMMAND ""
|
|
|
|
# Disable the install step.
|
|
|
|
INSTALL_COMMAND ""
|
|
|
|
)
|
|
|
|
force_configure_step(capstone-project)
|
|
|
|
else()
|
|
|
|
message(STATUS "Capstone: using remote Capstone revision.")
|
2019-05-30 11:39:34 +00:00
|
|
|
|
2019-04-25 12:07:45 +00:00
|
|
|
ExternalProject_Add(capstone-project
|
2020-01-27 09:13:41 +00:00
|
|
|
URL ${CAPSTONE_URL}
|
|
|
|
URL_HASH SHA256=${CAPSTONE_ARCHIVE_SHA256}
|
2019-04-25 12:07:45 +00:00
|
|
|
DOWNLOAD_NAME capstone.zip
|
|
|
|
CMAKE_ARGS
|
|
|
|
# This does not work on MSVC, but may be useful on Linux.
|
|
|
|
-DCMAKE_BUILD_TYPE=Release
|
|
|
|
-DCAPSTONE_BUILD_STATIC=ON
|
|
|
|
-DCAPSTONE_BUILD_SHARED=OFF
|
2020-03-23 09:01:03 +00:00
|
|
|
-DCAPSTONE_BUILD_STATIC_RUNTIME=${RETDEC_MSVC_STATIC_RUNTIME}
|
2019-04-25 12:07:45 +00:00
|
|
|
-DCAPSTONE_BUILD_TESTS=OFF
|
|
|
|
-DCAPSTONE_X86_ATT_DISABLE=OFF
|
|
|
|
# Enabled architectures.
|
|
|
|
-DCAPSTONE_ARM_SUPPORT=ON
|
|
|
|
-DCAPSTONE_MIPS_SUPPORT=ON
|
|
|
|
-DCAPSTONE_PPC_SUPPORT=ON
|
|
|
|
-DCAPSTONE_X86_SUPPORT=ON
|
2019-05-27 08:28:42 +00:00
|
|
|
-DCAPSTONE_ARM64_SUPPORT=ON
|
2019-04-25 12:07:45 +00:00
|
|
|
# Disabled architectures.
|
|
|
|
-DCAPSTONE_M68K_SUPPORT=OFF
|
|
|
|
-DCAPSTONE_SPARC_SUPPORT=OFF
|
|
|
|
-DCAPSTONE_SYSZ_SUPPORT=OFF
|
|
|
|
-DCAPSTONE_XCORE_SUPPORT=OFF
|
|
|
|
-DCAPSTONE_TMS320C64X_SUPPORT=OFF
|
|
|
|
-DCAPSTONE_M680X_SUPPORT=OFF
|
|
|
|
# Force the use of the same compiler as used to build the top-level
|
|
|
|
# project. Otherwise, the external project may pick up a different
|
|
|
|
# compiler, which may result in link errors.
|
|
|
|
"${CMAKE_C_COMPILER_OPTION}"
|
|
|
|
"${CMAKE_CXX_COMPILER_OPTION}"
|
2020-06-05 05:42:46 +00:00
|
|
|
-DCMAKE_POSITION_INDEPENDENT_CODE=${CMAKE_POSITION_INDEPENDENT_CODE}
|
2020-01-22 12:02:53 +00:00
|
|
|
# Patch the Capstone sources.
|
|
|
|
PATCH_COMMAND
|
|
|
|
${CMAKE_COMMAND} -Dcapstone_path=<SOURCE_DIR> -P ${CMAKE_CURRENT_SOURCE_DIR}/patch.cmake
|
2019-04-25 12:07:45 +00:00
|
|
|
# Disable the update step.
|
|
|
|
UPDATE_COMMAND ""
|
|
|
|
# Disable the install step.
|
|
|
|
INSTALL_COMMAND ""
|
|
|
|
LOG_DOWNLOAD ON
|
|
|
|
LOG_CONFIGURE ON
|
|
|
|
LOG_BUILD ON
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
check_if_variable_changed(CAPSTONE_LOCAL_DIR CHANGED)
|
|
|
|
if(CHANGED)
|
|
|
|
ExternalProject_Get_Property(capstone-project binary_dir)
|
|
|
|
message(STATUS "Capstone: path to Capstone directory changed -> cleaning CMake files in ${binary_dir}.")
|
|
|
|
clean_cmake_files(${binary_dir})
|
|
|
|
endif()
|
2018-01-05 10:26:55 +00:00
|
|
|
|
2018-01-10 15:33:15 +00:00
|
|
|
ExternalProject_Get_Property(capstone-project source_dir)
|
|
|
|
ExternalProject_Get_Property(capstone-project binary_dir)
|
|
|
|
|
New build system (#730)
* something working
* progress
* progress
* progress
* cmake: fix common and add ctypes
* src/serdes: new build system
* new build system for pdbparser
* new build system for yaracpp
* new build system for crypto component
* new build system for config
* refactor cmake for retdec-configtool
* new build system for idr2pat
* new build system for ar-extractor and its LLVM dependency
* refactor the new build system
* new build for ar-extractortool
* new build system for macho-extractor and macho-extractortool
* new build for ctypesparser, demangler, and demanglertool
* new build for llvm-support and llvmir-emul
* new build for capstone2llvmir and capstone2llvmirtool
* new build for fileformat, loader, cpdetect, fileinfo
* new build for most remaining modules
* cmake/options.cmake: fix debugformat enable settings
* some build system fixes
* cmake/options.cmake: make RETDEC_ENABLE_ALL into option
this allows us to set it to ODD and build only documentation
* tests: new build system for unit tests
* pelib: fix doxygen comment
* retdec/retdec: remove unused include of llvm-support/diagnostics.h
* fileformat: do not include openssl in headers
* cmake: make install paths relative.
When they are absolute, then all the paths in instaled cmake scripts are absolute - install dir could not be moved.
* deps/yara: refactor cmake to properly install libs
* deps/yara: small cosmetic changes
* deps/llvm: refactor cmake to properly install libs
* deps/capstone: refactor cmake to properly install libs
* deps: refactor cmake files
* deps: refactor cmake files
* deps/yaramod: refactor cmake to properly install libs
* CMakeLists.txt: fix files installation
* config/retdec-config-config.cmake: fix required component order
Looks like this may matter (on some machines or cmake version).
* deps/llvm: fix include installation
* fileformat/cmake: do not use openssl-crypto
For some reasons, this can cause linking problems on some machines.
* deps/yaramod: fix link library order
* deps/googletests: fix target link library order
* rtti-finder: make deps PUBLIC.
I have no idea why it doesn't work with PRIVATE.
* deps/yaramod: fix formatting
* cmake: more refactorization...
1. Protect against including the same target file multiple times. It looks like this was not a problem, but who knows.
2. Use find_package() instead of find_dependency(). It looks like the later does not work correctly for components on some CMake versions.
* cmake: do not create version files for all components
Only the main RetDec version file is needed.
* cmake: propagate current project version to package config files
It is used to find the same version retdec components.
* CMakeLists.txt: replace AnyNewerVersion -> ExactVersion in compatibility settings
Since we probably will make breaking changes, make retdec installation compatible only with the same version.
* cmake: remove all COMPONENT options, these are not really needed
* cmake: move dependency finders inside double target protection conditions
* cmake: prefix all deps targets with retdec::deps::
* fileinfo: add openssl-crypto dep
* Revert "fileinfo: add openssl-crypto dep"
This reverts commit e1645d7fd5e81d1606c96752da3ac633c38a63e1.
* remove RETDEC_FORCE_OPENSSL_BUILD option, always build OpenSSL
* cmake: refactorization
* deps/whereami: fix include paths
* deps/tinyxml+whereami: fix included dirs
* deps/yaramod: fix pog_fmt lib installation
* deps/whereami: properly install target, not as part of utils.
Previous version should work, but there is a CMake bug in older versions which screws it up on Windows and macOS.
* crypto: link retdec::deps::openssl-crypto as PUBLIC
* bin2llvmir/providers/debugformat: fix segfault
Co-authored-by: Peter Matula <imatula@fit.vutbr.cz>
2020-04-05 14:50:56 +00:00
|
|
|
set(CAPSTONE_LIB_NAME ${CMAKE_STATIC_LIBRARY_PREFIX}capstone${CMAKE_STATIC_LIBRARY_SUFFIX})
|
2020-04-06 18:26:21 +00:00
|
|
|
set(CAPSTONE_LIB_PNAME ${CMAKE_STATIC_LIBRARY_PREFIX}retdec-capstone${CMAKE_STATIC_LIBRARY_SUFFIX})
|
2020-06-12 08:09:24 +00:00
|
|
|
set(CAPSTONE_LIB ${binary_dir}/${MSVC_CONFIG}${CAPSTONE_LIB_NAME})
|
New build system (#730)
* something working
* progress
* progress
* progress
* cmake: fix common and add ctypes
* src/serdes: new build system
* new build system for pdbparser
* new build system for yaracpp
* new build system for crypto component
* new build system for config
* refactor cmake for retdec-configtool
* new build system for idr2pat
* new build system for ar-extractor and its LLVM dependency
* refactor the new build system
* new build for ar-extractortool
* new build system for macho-extractor and macho-extractortool
* new build for ctypesparser, demangler, and demanglertool
* new build for llvm-support and llvmir-emul
* new build for capstone2llvmir and capstone2llvmirtool
* new build for fileformat, loader, cpdetect, fileinfo
* new build for most remaining modules
* cmake/options.cmake: fix debugformat enable settings
* some build system fixes
* cmake/options.cmake: make RETDEC_ENABLE_ALL into option
this allows us to set it to ODD and build only documentation
* tests: new build system for unit tests
* pelib: fix doxygen comment
* retdec/retdec: remove unused include of llvm-support/diagnostics.h
* fileformat: do not include openssl in headers
* cmake: make install paths relative.
When they are absolute, then all the paths in instaled cmake scripts are absolute - install dir could not be moved.
* deps/yara: refactor cmake to properly install libs
* deps/yara: small cosmetic changes
* deps/llvm: refactor cmake to properly install libs
* deps/capstone: refactor cmake to properly install libs
* deps: refactor cmake files
* deps: refactor cmake files
* deps/yaramod: refactor cmake to properly install libs
* CMakeLists.txt: fix files installation
* config/retdec-config-config.cmake: fix required component order
Looks like this may matter (on some machines or cmake version).
* deps/llvm: fix include installation
* fileformat/cmake: do not use openssl-crypto
For some reasons, this can cause linking problems on some machines.
* deps/yaramod: fix link library order
* deps/googletests: fix target link library order
* rtti-finder: make deps PUBLIC.
I have no idea why it doesn't work with PRIVATE.
* deps/yaramod: fix formatting
* cmake: more refactorization...
1. Protect against including the same target file multiple times. It looks like this was not a problem, but who knows.
2. Use find_package() instead of find_dependency(). It looks like the later does not work correctly for components on some CMake versions.
* cmake: do not create version files for all components
Only the main RetDec version file is needed.
* cmake: propagate current project version to package config files
It is used to find the same version retdec components.
* CMakeLists.txt: replace AnyNewerVersion -> ExactVersion in compatibility settings
Since we probably will make breaking changes, make retdec installation compatible only with the same version.
* cmake: remove all COMPONENT options, these are not really needed
* cmake: move dependency finders inside double target protection conditions
* cmake: prefix all deps targets with retdec::deps::
* fileinfo: add openssl-crypto dep
* Revert "fileinfo: add openssl-crypto dep"
This reverts commit e1645d7fd5e81d1606c96752da3ac633c38a63e1.
* remove RETDEC_FORCE_OPENSSL_BUILD option, always build OpenSSL
* cmake: refactorization
* deps/whereami: fix include paths
* deps/tinyxml+whereami: fix included dirs
* deps/yaramod: fix pog_fmt lib installation
* deps/whereami: properly install target, not as part of utils.
Previous version should work, but there is a CMake bug in older versions which screws it up on Windows and macOS.
* crypto: link retdec::deps::openssl-crypto as PUBLIC
* bin2llvmir/providers/debugformat: fix segfault
Co-authored-by: Peter Matula <imatula@fit.vutbr.cz>
2020-04-05 14:50:56 +00:00
|
|
|
|
|
|
|
# Create target.
|
2018-01-10 15:33:15 +00:00
|
|
|
add_library(capstone INTERFACE)
|
New build system (#730)
* something working
* progress
* progress
* progress
* cmake: fix common and add ctypes
* src/serdes: new build system
* new build system for pdbparser
* new build system for yaracpp
* new build system for crypto component
* new build system for config
* refactor cmake for retdec-configtool
* new build system for idr2pat
* new build system for ar-extractor and its LLVM dependency
* refactor the new build system
* new build for ar-extractortool
* new build system for macho-extractor and macho-extractortool
* new build for ctypesparser, demangler, and demanglertool
* new build for llvm-support and llvmir-emul
* new build for capstone2llvmir and capstone2llvmirtool
* new build for fileformat, loader, cpdetect, fileinfo
* new build for most remaining modules
* cmake/options.cmake: fix debugformat enable settings
* some build system fixes
* cmake/options.cmake: make RETDEC_ENABLE_ALL into option
this allows us to set it to ODD and build only documentation
* tests: new build system for unit tests
* pelib: fix doxygen comment
* retdec/retdec: remove unused include of llvm-support/diagnostics.h
* fileformat: do not include openssl in headers
* cmake: make install paths relative.
When they are absolute, then all the paths in instaled cmake scripts are absolute - install dir could not be moved.
* deps/yara: refactor cmake to properly install libs
* deps/yara: small cosmetic changes
* deps/llvm: refactor cmake to properly install libs
* deps/capstone: refactor cmake to properly install libs
* deps: refactor cmake files
* deps: refactor cmake files
* deps/yaramod: refactor cmake to properly install libs
* CMakeLists.txt: fix files installation
* config/retdec-config-config.cmake: fix required component order
Looks like this may matter (on some machines or cmake version).
* deps/llvm: fix include installation
* fileformat/cmake: do not use openssl-crypto
For some reasons, this can cause linking problems on some machines.
* deps/yaramod: fix link library order
* deps/googletests: fix target link library order
* rtti-finder: make deps PUBLIC.
I have no idea why it doesn't work with PRIVATE.
* deps/yaramod: fix formatting
* cmake: more refactorization...
1. Protect against including the same target file multiple times. It looks like this was not a problem, but who knows.
2. Use find_package() instead of find_dependency(). It looks like the later does not work correctly for components on some CMake versions.
* cmake: do not create version files for all components
Only the main RetDec version file is needed.
* cmake: propagate current project version to package config files
It is used to find the same version retdec components.
* CMakeLists.txt: replace AnyNewerVersion -> ExactVersion in compatibility settings
Since we probably will make breaking changes, make retdec installation compatible only with the same version.
* cmake: remove all COMPONENT options, these are not really needed
* cmake: move dependency finders inside double target protection conditions
* cmake: prefix all deps targets with retdec::deps::
* fileinfo: add openssl-crypto dep
* Revert "fileinfo: add openssl-crypto dep"
This reverts commit e1645d7fd5e81d1606c96752da3ac633c38a63e1.
* remove RETDEC_FORCE_OPENSSL_BUILD option, always build OpenSSL
* cmake: refactorization
* deps/whereami: fix include paths
* deps/tinyxml+whereami: fix included dirs
* deps/yaramod: fix pog_fmt lib installation
* deps/whereami: properly install target, not as part of utils.
Previous version should work, but there is a CMake bug in older versions which screws it up on Windows and macOS.
* crypto: link retdec::deps::openssl-crypto as PUBLIC
* bin2llvmir/providers/debugformat: fix segfault
Co-authored-by: Peter Matula <imatula@fit.vutbr.cz>
2020-04-05 14:50:56 +00:00
|
|
|
add_library(retdec::deps::capstone ALIAS capstone)
|
2018-01-10 15:33:15 +00:00
|
|
|
add_dependencies(capstone capstone-project)
|
New build system (#730)
* something working
* progress
* progress
* progress
* cmake: fix common and add ctypes
* src/serdes: new build system
* new build system for pdbparser
* new build system for yaracpp
* new build system for crypto component
* new build system for config
* refactor cmake for retdec-configtool
* new build system for idr2pat
* new build system for ar-extractor and its LLVM dependency
* refactor the new build system
* new build for ar-extractortool
* new build system for macho-extractor and macho-extractortool
* new build for ctypesparser, demangler, and demanglertool
* new build for llvm-support and llvmir-emul
* new build for capstone2llvmir and capstone2llvmirtool
* new build for fileformat, loader, cpdetect, fileinfo
* new build for most remaining modules
* cmake/options.cmake: fix debugformat enable settings
* some build system fixes
* cmake/options.cmake: make RETDEC_ENABLE_ALL into option
this allows us to set it to ODD and build only documentation
* tests: new build system for unit tests
* pelib: fix doxygen comment
* retdec/retdec: remove unused include of llvm-support/diagnostics.h
* fileformat: do not include openssl in headers
* cmake: make install paths relative.
When they are absolute, then all the paths in instaled cmake scripts are absolute - install dir could not be moved.
* deps/yara: refactor cmake to properly install libs
* deps/yara: small cosmetic changes
* deps/llvm: refactor cmake to properly install libs
* deps/capstone: refactor cmake to properly install libs
* deps: refactor cmake files
* deps: refactor cmake files
* deps/yaramod: refactor cmake to properly install libs
* CMakeLists.txt: fix files installation
* config/retdec-config-config.cmake: fix required component order
Looks like this may matter (on some machines or cmake version).
* deps/llvm: fix include installation
* fileformat/cmake: do not use openssl-crypto
For some reasons, this can cause linking problems on some machines.
* deps/yaramod: fix link library order
* deps/googletests: fix target link library order
* rtti-finder: make deps PUBLIC.
I have no idea why it doesn't work with PRIVATE.
* deps/yaramod: fix formatting
* cmake: more refactorization...
1. Protect against including the same target file multiple times. It looks like this was not a problem, but who knows.
2. Use find_package() instead of find_dependency(). It looks like the later does not work correctly for components on some CMake versions.
* cmake: do not create version files for all components
Only the main RetDec version file is needed.
* cmake: propagate current project version to package config files
It is used to find the same version retdec components.
* CMakeLists.txt: replace AnyNewerVersion -> ExactVersion in compatibility settings
Since we probably will make breaking changes, make retdec installation compatible only with the same version.
* cmake: remove all COMPONENT options, these are not really needed
* cmake: move dependency finders inside double target protection conditions
* cmake: prefix all deps targets with retdec::deps::
* fileinfo: add openssl-crypto dep
* Revert "fileinfo: add openssl-crypto dep"
This reverts commit e1645d7fd5e81d1606c96752da3ac633c38a63e1.
* remove RETDEC_FORCE_OPENSSL_BUILD option, always build OpenSSL
* cmake: refactorization
* deps/whereami: fix include paths
* deps/tinyxml+whereami: fix included dirs
* deps/yaramod: fix pog_fmt lib installation
* deps/whereami: properly install target, not as part of utils.
Previous version should work, but there is a CMake bug in older versions which screws it up on Windows and macOS.
* crypto: link retdec::deps::openssl-crypto as PUBLIC
* bin2llvmir/providers/debugformat: fix segfault
Co-authored-by: Peter Matula <imatula@fit.vutbr.cz>
2020-04-05 14:50:56 +00:00
|
|
|
|
|
|
|
target_include_directories(capstone
|
|
|
|
SYSTEM INTERFACE
|
|
|
|
$<BUILD_INTERFACE:${source_dir}/include>
|
|
|
|
$<BUILD_INTERFACE:${source_dir}/arch>
|
|
|
|
$<INSTALL_INTERFACE:${RETDEC_INSTALL_DEPS_INCLUDE_DIR}>
|
|
|
|
)
|
|
|
|
|
|
|
|
target_link_libraries(capstone INTERFACE
|
2020-06-12 08:09:24 +00:00
|
|
|
$<BUILD_INTERFACE:${CAPSTONE_LIB}>
|
New build system (#730)
* something working
* progress
* progress
* progress
* cmake: fix common and add ctypes
* src/serdes: new build system
* new build system for pdbparser
* new build system for yaracpp
* new build system for crypto component
* new build system for config
* refactor cmake for retdec-configtool
* new build system for idr2pat
* new build system for ar-extractor and its LLVM dependency
* refactor the new build system
* new build for ar-extractortool
* new build system for macho-extractor and macho-extractortool
* new build for ctypesparser, demangler, and demanglertool
* new build for llvm-support and llvmir-emul
* new build for capstone2llvmir and capstone2llvmirtool
* new build for fileformat, loader, cpdetect, fileinfo
* new build for most remaining modules
* cmake/options.cmake: fix debugformat enable settings
* some build system fixes
* cmake/options.cmake: make RETDEC_ENABLE_ALL into option
this allows us to set it to ODD and build only documentation
* tests: new build system for unit tests
* pelib: fix doxygen comment
* retdec/retdec: remove unused include of llvm-support/diagnostics.h
* fileformat: do not include openssl in headers
* cmake: make install paths relative.
When they are absolute, then all the paths in instaled cmake scripts are absolute - install dir could not be moved.
* deps/yara: refactor cmake to properly install libs
* deps/yara: small cosmetic changes
* deps/llvm: refactor cmake to properly install libs
* deps/capstone: refactor cmake to properly install libs
* deps: refactor cmake files
* deps: refactor cmake files
* deps/yaramod: refactor cmake to properly install libs
* CMakeLists.txt: fix files installation
* config/retdec-config-config.cmake: fix required component order
Looks like this may matter (on some machines or cmake version).
* deps/llvm: fix include installation
* fileformat/cmake: do not use openssl-crypto
For some reasons, this can cause linking problems on some machines.
* deps/yaramod: fix link library order
* deps/googletests: fix target link library order
* rtti-finder: make deps PUBLIC.
I have no idea why it doesn't work with PRIVATE.
* deps/yaramod: fix formatting
* cmake: more refactorization...
1. Protect against including the same target file multiple times. It looks like this was not a problem, but who knows.
2. Use find_package() instead of find_dependency(). It looks like the later does not work correctly for components on some CMake versions.
* cmake: do not create version files for all components
Only the main RetDec version file is needed.
* cmake: propagate current project version to package config files
It is used to find the same version retdec components.
* CMakeLists.txt: replace AnyNewerVersion -> ExactVersion in compatibility settings
Since we probably will make breaking changes, make retdec installation compatible only with the same version.
* cmake: remove all COMPONENT options, these are not really needed
* cmake: move dependency finders inside double target protection conditions
* cmake: prefix all deps targets with retdec::deps::
* fileinfo: add openssl-crypto dep
* Revert "fileinfo: add openssl-crypto dep"
This reverts commit e1645d7fd5e81d1606c96752da3ac633c38a63e1.
* remove RETDEC_FORCE_OPENSSL_BUILD option, always build OpenSSL
* cmake: refactorization
* deps/whereami: fix include paths
* deps/tinyxml+whereami: fix included dirs
* deps/yaramod: fix pog_fmt lib installation
* deps/whereami: properly install target, not as part of utils.
Previous version should work, but there is a CMake bug in older versions which screws it up on Windows and macOS.
* crypto: link retdec::deps::openssl-crypto as PUBLIC
* bin2llvmir/providers/debugformat: fix segfault
Co-authored-by: Peter Matula <imatula@fit.vutbr.cz>
2020-04-05 14:50:56 +00:00
|
|
|
$<INSTALL_INTERFACE:retdec::deps::capstone-libs>
|
|
|
|
)
|
|
|
|
|
|
|
|
# Install includes.
|
|
|
|
install(
|
2020-04-06 18:26:21 +00:00
|
|
|
DIRECTORY ${source_dir}/include/
|
|
|
|
DESTINATION ${RETDEC_INSTALL_DEPS_INCLUDE_DIR}
|
New build system (#730)
* something working
* progress
* progress
* progress
* cmake: fix common and add ctypes
* src/serdes: new build system
* new build system for pdbparser
* new build system for yaracpp
* new build system for crypto component
* new build system for config
* refactor cmake for retdec-configtool
* new build system for idr2pat
* new build system for ar-extractor and its LLVM dependency
* refactor the new build system
* new build for ar-extractortool
* new build system for macho-extractor and macho-extractortool
* new build for ctypesparser, demangler, and demanglertool
* new build for llvm-support and llvmir-emul
* new build for capstone2llvmir and capstone2llvmirtool
* new build for fileformat, loader, cpdetect, fileinfo
* new build for most remaining modules
* cmake/options.cmake: fix debugformat enable settings
* some build system fixes
* cmake/options.cmake: make RETDEC_ENABLE_ALL into option
this allows us to set it to ODD and build only documentation
* tests: new build system for unit tests
* pelib: fix doxygen comment
* retdec/retdec: remove unused include of llvm-support/diagnostics.h
* fileformat: do not include openssl in headers
* cmake: make install paths relative.
When they are absolute, then all the paths in instaled cmake scripts are absolute - install dir could not be moved.
* deps/yara: refactor cmake to properly install libs
* deps/yara: small cosmetic changes
* deps/llvm: refactor cmake to properly install libs
* deps/capstone: refactor cmake to properly install libs
* deps: refactor cmake files
* deps: refactor cmake files
* deps/yaramod: refactor cmake to properly install libs
* CMakeLists.txt: fix files installation
* config/retdec-config-config.cmake: fix required component order
Looks like this may matter (on some machines or cmake version).
* deps/llvm: fix include installation
* fileformat/cmake: do not use openssl-crypto
For some reasons, this can cause linking problems on some machines.
* deps/yaramod: fix link library order
* deps/googletests: fix target link library order
* rtti-finder: make deps PUBLIC.
I have no idea why it doesn't work with PRIVATE.
* deps/yaramod: fix formatting
* cmake: more refactorization...
1. Protect against including the same target file multiple times. It looks like this was not a problem, but who knows.
2. Use find_package() instead of find_dependency(). It looks like the later does not work correctly for components on some CMake versions.
* cmake: do not create version files for all components
Only the main RetDec version file is needed.
* cmake: propagate current project version to package config files
It is used to find the same version retdec components.
* CMakeLists.txt: replace AnyNewerVersion -> ExactVersion in compatibility settings
Since we probably will make breaking changes, make retdec installation compatible only with the same version.
* cmake: remove all COMPONENT options, these are not really needed
* cmake: move dependency finders inside double target protection conditions
* cmake: prefix all deps targets with retdec::deps::
* fileinfo: add openssl-crypto dep
* Revert "fileinfo: add openssl-crypto dep"
This reverts commit e1645d7fd5e81d1606c96752da3ac633c38a63e1.
* remove RETDEC_FORCE_OPENSSL_BUILD option, always build OpenSSL
* cmake: refactorization
* deps/whereami: fix include paths
* deps/tinyxml+whereami: fix included dirs
* deps/yaramod: fix pog_fmt lib installation
* deps/whereami: properly install target, not as part of utils.
Previous version should work, but there is a CMake bug in older versions which screws it up on Windows and macOS.
* crypto: link retdec::deps::openssl-crypto as PUBLIC
* bin2llvmir/providers/debugformat: fix segfault
Co-authored-by: Peter Matula <imatula@fit.vutbr.cz>
2020-04-05 14:50:56 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# Install libs.
|
|
|
|
install(
|
2020-06-12 08:09:24 +00:00
|
|
|
FILES ${CAPSTONE_LIB}
|
2020-04-06 18:26:21 +00:00
|
|
|
DESTINATION ${RETDEC_INSTALL_LIB_DIR}
|
|
|
|
RENAME ${CAPSTONE_LIB_PNAME}
|
New build system (#730)
* something working
* progress
* progress
* progress
* cmake: fix common and add ctypes
* src/serdes: new build system
* new build system for pdbparser
* new build system for yaracpp
* new build system for crypto component
* new build system for config
* refactor cmake for retdec-configtool
* new build system for idr2pat
* new build system for ar-extractor and its LLVM dependency
* refactor the new build system
* new build for ar-extractortool
* new build system for macho-extractor and macho-extractortool
* new build for ctypesparser, demangler, and demanglertool
* new build for llvm-support and llvmir-emul
* new build for capstone2llvmir and capstone2llvmirtool
* new build for fileformat, loader, cpdetect, fileinfo
* new build for most remaining modules
* cmake/options.cmake: fix debugformat enable settings
* some build system fixes
* cmake/options.cmake: make RETDEC_ENABLE_ALL into option
this allows us to set it to ODD and build only documentation
* tests: new build system for unit tests
* pelib: fix doxygen comment
* retdec/retdec: remove unused include of llvm-support/diagnostics.h
* fileformat: do not include openssl in headers
* cmake: make install paths relative.
When they are absolute, then all the paths in instaled cmake scripts are absolute - install dir could not be moved.
* deps/yara: refactor cmake to properly install libs
* deps/yara: small cosmetic changes
* deps/llvm: refactor cmake to properly install libs
* deps/capstone: refactor cmake to properly install libs
* deps: refactor cmake files
* deps: refactor cmake files
* deps/yaramod: refactor cmake to properly install libs
* CMakeLists.txt: fix files installation
* config/retdec-config-config.cmake: fix required component order
Looks like this may matter (on some machines or cmake version).
* deps/llvm: fix include installation
* fileformat/cmake: do not use openssl-crypto
For some reasons, this can cause linking problems on some machines.
* deps/yaramod: fix link library order
* deps/googletests: fix target link library order
* rtti-finder: make deps PUBLIC.
I have no idea why it doesn't work with PRIVATE.
* deps/yaramod: fix formatting
* cmake: more refactorization...
1. Protect against including the same target file multiple times. It looks like this was not a problem, but who knows.
2. Use find_package() instead of find_dependency(). It looks like the later does not work correctly for components on some CMake versions.
* cmake: do not create version files for all components
Only the main RetDec version file is needed.
* cmake: propagate current project version to package config files
It is used to find the same version retdec components.
* CMakeLists.txt: replace AnyNewerVersion -> ExactVersion in compatibility settings
Since we probably will make breaking changes, make retdec installation compatible only with the same version.
* cmake: remove all COMPONENT options, these are not really needed
* cmake: move dependency finders inside double target protection conditions
* cmake: prefix all deps targets with retdec::deps::
* fileinfo: add openssl-crypto dep
* Revert "fileinfo: add openssl-crypto dep"
This reverts commit e1645d7fd5e81d1606c96752da3ac633c38a63e1.
* remove RETDEC_FORCE_OPENSSL_BUILD option, always build OpenSSL
* cmake: refactorization
* deps/whereami: fix include paths
* deps/tinyxml+whereami: fix included dirs
* deps/yaramod: fix pog_fmt lib installation
* deps/whereami: properly install target, not as part of utils.
Previous version should work, but there is a CMake bug in older versions which screws it up on Windows and macOS.
* crypto: link retdec::deps::openssl-crypto as PUBLIC
* bin2llvmir/providers/debugformat: fix segfault
Co-authored-by: Peter Matula <imatula@fit.vutbr.cz>
2020-04-05 14:50:56 +00:00
|
|
|
OPTIONAL
|
|
|
|
)
|
|
|
|
|
|
|
|
# Install targets.
|
|
|
|
install(TARGETS capstone
|
|
|
|
EXPORT capstone-targets
|
|
|
|
)
|
|
|
|
|
|
|
|
# Export targets.
|
|
|
|
install(EXPORT capstone-targets
|
|
|
|
FILE "retdec-capstone-targets.cmake"
|
|
|
|
NAMESPACE retdec::deps::
|
|
|
|
DESTINATION ${RETDEC_INSTALL_CMAKE_DIR}
|
|
|
|
)
|
|
|
|
|
|
|
|
# Configure config file.
|
2020-04-06 18:26:21 +00:00
|
|
|
set(CAPSTONE_LIB_INSTALLED "${RETDEC_INSTALL_LIB_DIR_ABS}/${CAPSTONE_LIB_PNAME}")
|
New build system (#730)
* something working
* progress
* progress
* progress
* cmake: fix common and add ctypes
* src/serdes: new build system
* new build system for pdbparser
* new build system for yaracpp
* new build system for crypto component
* new build system for config
* refactor cmake for retdec-configtool
* new build system for idr2pat
* new build system for ar-extractor and its LLVM dependency
* refactor the new build system
* new build for ar-extractortool
* new build system for macho-extractor and macho-extractortool
* new build for ctypesparser, demangler, and demanglertool
* new build for llvm-support and llvmir-emul
* new build for capstone2llvmir and capstone2llvmirtool
* new build for fileformat, loader, cpdetect, fileinfo
* new build for most remaining modules
* cmake/options.cmake: fix debugformat enable settings
* some build system fixes
* cmake/options.cmake: make RETDEC_ENABLE_ALL into option
this allows us to set it to ODD and build only documentation
* tests: new build system for unit tests
* pelib: fix doxygen comment
* retdec/retdec: remove unused include of llvm-support/diagnostics.h
* fileformat: do not include openssl in headers
* cmake: make install paths relative.
When they are absolute, then all the paths in instaled cmake scripts are absolute - install dir could not be moved.
* deps/yara: refactor cmake to properly install libs
* deps/yara: small cosmetic changes
* deps/llvm: refactor cmake to properly install libs
* deps/capstone: refactor cmake to properly install libs
* deps: refactor cmake files
* deps: refactor cmake files
* deps/yaramod: refactor cmake to properly install libs
* CMakeLists.txt: fix files installation
* config/retdec-config-config.cmake: fix required component order
Looks like this may matter (on some machines or cmake version).
* deps/llvm: fix include installation
* fileformat/cmake: do not use openssl-crypto
For some reasons, this can cause linking problems on some machines.
* deps/yaramod: fix link library order
* deps/googletests: fix target link library order
* rtti-finder: make deps PUBLIC.
I have no idea why it doesn't work with PRIVATE.
* deps/yaramod: fix formatting
* cmake: more refactorization...
1. Protect against including the same target file multiple times. It looks like this was not a problem, but who knows.
2. Use find_package() instead of find_dependency(). It looks like the later does not work correctly for components on some CMake versions.
* cmake: do not create version files for all components
Only the main RetDec version file is needed.
* cmake: propagate current project version to package config files
It is used to find the same version retdec components.
* CMakeLists.txt: replace AnyNewerVersion -> ExactVersion in compatibility settings
Since we probably will make breaking changes, make retdec installation compatible only with the same version.
* cmake: remove all COMPONENT options, these are not really needed
* cmake: move dependency finders inside double target protection conditions
* cmake: prefix all deps targets with retdec::deps::
* fileinfo: add openssl-crypto dep
* Revert "fileinfo: add openssl-crypto dep"
This reverts commit e1645d7fd5e81d1606c96752da3ac633c38a63e1.
* remove RETDEC_FORCE_OPENSSL_BUILD option, always build OpenSSL
* cmake: refactorization
* deps/whereami: fix include paths
* deps/tinyxml+whereami: fix included dirs
* deps/yaramod: fix pog_fmt lib installation
* deps/whereami: properly install target, not as part of utils.
Previous version should work, but there is a CMake bug in older versions which screws it up on Windows and macOS.
* crypto: link retdec::deps::openssl-crypto as PUBLIC
* bin2llvmir/providers/debugformat: fix segfault
Co-authored-by: Peter Matula <imatula@fit.vutbr.cz>
2020-04-05 14:50:56 +00:00
|
|
|
configure_package_config_file(
|
|
|
|
"retdec-capstone-config.cmake"
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/retdec-capstone-config.cmake"
|
|
|
|
INSTALL_DESTINATION ${RETDEC_INSTALL_CMAKE_DIR}
|
|
|
|
PATH_VARS
|
|
|
|
CAPSTONE_LIB_INSTALLED
|
|
|
|
)
|
|
|
|
|
|
|
|
# Install CMake files.
|
|
|
|
install(
|
|
|
|
FILES
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/retdec-capstone-config.cmake"
|
|
|
|
DESTINATION
|
|
|
|
"${RETDEC_INSTALL_CMAKE_DIR}"
|
|
|
|
)
|