deps/whereami: remove target for this module

Add its source and header directly to its only user. This is uglier, but much simpler than dealing with targets, exports, installs, etc. This will never be used outside of utils library.
This commit is contained in:
Matula Peter 2020-07-21 12:35:24 +02:00
parent 675cbd8916
commit cd4a8c491b
7 changed files with 3 additions and 61 deletions

View File

@ -498,9 +498,6 @@ set_if_at_least_one_set(RETDEC_ENABLE_TINYXML2
set_if_at_least_one_set(RETDEC_ENABLE_VARIANT
RETDEC_ENABLE_UTILS)
set_if_at_least_one_set(RETDEC_ENABLE_WHEREAMI
RETDEC_ENABLE_UTILS)
set_if_at_least_one_set(RETDEC_ENABLE_YARA
RETDEC_ENABLE_YARACPP)

1
deps/CMakeLists.txt vendored
View File

@ -21,7 +21,6 @@ cond_add_subdirectory(keystone RETDEC_ENABLE_KEYSTONE)
cond_add_subdirectory(llvm RETDEC_ENABLE_LLVM)
cond_add_subdirectory(rapidjson RETDEC_ENABLE_RAPIDJSON)
cond_add_subdirectory(tinyxml2 RETDEC_ENABLE_TINYXML2)
cond_add_subdirectory(whereami RETDEC_ENABLE_WHEREAMI)
cond_add_subdirectory(yara RETDEC_ENABLE_YARA)
cond_add_subdirectory(yaramod RETDEC_ENABLE_YARAMOD)
cond_add_subdirectory(eigen RETDEC_ENABLE_EIGEN)

View File

@ -1,46 +0,0 @@
add_library(whereami STATIC
whereami.c
)
add_library(retdec::deps::whereami ALIAS whereami)
target_include_directories(whereami
SYSTEM INTERFACE
$<BUILD_INTERFACE:${RETDEC_DEPS_DIR}/whereami/include>
$<INSTALL_INTERFACE:${RETDEC_INSTALL_DEPS_INCLUDE_DIR}>
PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/whereami>
)
set_target_properties(whereami
PROPERTIES
OUTPUT_NAME "retdec-whereami"
)
# Install includes.
install(
DIRECTORY ${RETDEC_DEPS_DIR}/whereami/include/
DESTINATION ${RETDEC_INSTALL_DEPS_INCLUDE_DIR}
)
# Install libs.
install(TARGETS whereami
EXPORT whereami-targets
ARCHIVE DESTINATION ${RETDEC_INSTALL_LIB_DIR}
LIBRARY DESTINATION ${RETDEC_INSTALL_LIB_DIR}
)
# Export targets.
install(EXPORT whereami-targets
FILE "retdec-whereami-targets.cmake"
NAMESPACE retdec::deps::
DESTINATION ${RETDEC_INSTALL_CMAKE_DIR}
)
# Install CMake files.
install(
FILES
"${CMAKE_CURRENT_LIST_DIR}/retdec-whereami-config.cmake"
DESTINATION
"${RETDEC_INSTALL_CMAKE_DIR}"
)

View File

@ -3,7 +3,7 @@
// in case you want to #include "whereami.c" in a larger compilation unit
#if !defined(WHEREAMI_H)
#include <whereami.h>
#include "whereami.h"
#endif
#ifdef __cplusplus

View File

@ -12,6 +12,7 @@ add_library(utils STATIC
string.cpp
system.cpp
time.cpp
${RETDEC_DEPS_DIR}/whereami/whereami/whereami.c
)
add_library(retdec::utils ALIAS utils)
@ -21,11 +22,8 @@ target_include_directories(utils
PUBLIC
$<BUILD_INTERFACE:${RETDEC_INCLUDE_DIR}>
$<INSTALL_INTERFACE:${RETDEC_INSTALL_INCLUDE_DIR}>
)
target_link_libraries(utils
PRIVATE
retdec::deps::whereami
$<BUILD_INTERFACE:${RETDEC_DEPS_DIR}/whereami>
)
# We may need to link filesystem library manually.

View File

@ -1,10 +1,4 @@
if(NOT TARGET retdec::utils)
find_package(retdec @PROJECT_VERSION@
REQUIRED
COMPONENTS
whereami
)
include(${CMAKE_CURRENT_LIST_DIR}/retdec-utils-targets.cmake)
endif()