mirror of
https://github.com/bitdefender/bddisasm.git
synced 2024-11-22 07:28:07 +00:00
Merge pull request #31 from ianichitei/master
Add support for CMake find_package
This commit is contained in:
commit
1aa0e0d71b
@ -126,11 +126,33 @@ CONFIGURE_FILE("${CMAKE_STATIC_LIBRARY_PREFIX}bddisasm.pc.in"
|
||||
)
|
||||
|
||||
INSTALL(TARGETS bddisasm bdshemu
|
||||
EXPORT bddisasmTargets
|
||||
LIBRARY DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}"
|
||||
ARCHIVE DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}"
|
||||
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/bddisasm"
|
||||
)
|
||||
|
||||
set(CMAKE_INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/bddisasm)
|
||||
install(EXPORT bddisasmTargets
|
||||
DESTINATION ${CMAKE_INSTALL_CONFIGDIR}
|
||||
)
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
configure_package_config_file(${PROJECT_SOURCE_DIR}/bddisasmConfig.cmake.in ${PROJECT_BINARY_DIR}/bddisasmConfig.cmake
|
||||
INSTALL_DESTINATION ${CMAKE_INSTALL_CONFIGDIR}
|
||||
PATH_VARS CMAKE_INSTALL_FULL_INCLUDEDIR CMAKE_INSTALL_FULL_LIBDIR
|
||||
)
|
||||
|
||||
write_basic_package_version_file(${PROJECT_BINARY_DIR}/bddisasmConfigVersion.cmake
|
||||
VERSION ${PROJECT_VERSION}
|
||||
COMPATIBILITY SameMajorVersion
|
||||
)
|
||||
|
||||
install(FILES ${PROJECT_BINARY_DIR}/bddisasmConfig.cmake ${PROJECT_BINARY_DIR}/bddisasmConfigVersion.cmake
|
||||
DESTINATION ${CMAKE_INSTALL_CONFIGDIR}
|
||||
)
|
||||
|
||||
INSTALL(FILES "${PROJECT_SOURCE_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}bddisasm.pc"
|
||||
DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/pkgconfig"
|
||||
)
|
||||
|
@ -74,7 +74,11 @@ make
|
||||
make install
|
||||
```
|
||||
|
||||
The default build type is Release. Using cmake provides support for pkg-config.
|
||||
The default build type is Release. Using cmake provides support for pkg-config. Other CMake projects can also use `find_package(bddisasm CONFIG REQUIRED)` to find bddisasm. In both cases the following variables will be defined:
|
||||
|
||||
* `BDDISASM_INCLUDE_DIRS` - holds the path of the `bddisasm` directory, which contains the public `bddisasm` and `bdshemu` headers.
|
||||
* `BDDISASM_LIBRARY_DIRS` - holds the path of the directory that contains the `libbddisasm.a` and `libbdshemu.a` libraries.
|
||||
* `BDDISASM_LIBRARIES` - holds the libraries against which integrators should link.
|
||||
|
||||
### Building disasmtool_lix
|
||||
|
||||
|
13
bddisasmConfig.cmake.in
Normal file
13
bddisasmConfig.cmake.in
Normal file
@ -0,0 +1,13 @@
|
||||
@PACKAGE_INIT@
|
||||
|
||||
set(BDDISASM_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_FULL_INCLUDEDIR@")
|
||||
set(BDDISASM_INCLUDE_DIRS "@PACKAGE_CMAKE_INSTALL_FULL_INCLUDEDIR@")
|
||||
set(BDDISASM_LIBRARY_DIRS "@PACKAGE_CMAKE_INSTALL_FULL_LIBDIR@")
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/bddisasmTargets.cmake)
|
||||
|
||||
set(BDDISASM_LIBRARIES @PRIVATE_LIBS@)
|
||||
|
||||
check_required_components(bddisasm)
|
||||
check_required_components(bdshemu)
|
||||
set(BDDISASM_FOUND 1)
|
Loading…
Reference in New Issue
Block a user