mirror of
https://github.com/simon987/fastimagehash.git
synced 2025-04-10 14:16:49 +00:00
CMake install
This commit is contained in:
parent
315335f38b
commit
d44da6bf34
@ -44,16 +44,15 @@ target_link_libraries(
|
|||||||
target_compile_options(
|
target_compile_options(
|
||||||
fastimagehash
|
fastimagehash
|
||||||
PRIVATE
|
PRIVATE
|
||||||
# -Ofast
|
# -Ofast
|
||||||
# -march=native
|
# -march=native
|
||||||
# -fno-stack-protector
|
# -fno-stack-protector
|
||||||
# -fomit-frame-pointer
|
# -fomit-frame-pointer
|
||||||
# -freciprocal-math
|
# -freciprocal-math
|
||||||
-g
|
-g
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
add_executable(bm benchmark.cpp)
|
add_executable(bm benchmark.cpp)
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
bm
|
bm
|
||||||
@ -77,6 +76,13 @@ target_compile_options(
|
|||||||
-g
|
-g
|
||||||
)
|
)
|
||||||
|
|
||||||
|
set_target_properties(fastimagehash PROPERTIES PUBLIC_HEADER "fastimagehash.h")
|
||||||
|
INSTALL(
|
||||||
|
TARGETS fastimagehash
|
||||||
|
LIBRARY DESTINATION /usr/lib/
|
||||||
|
PUBLIC_HEADER DESTINATION /usr/include/
|
||||||
|
)
|
||||||
|
|
||||||
add_dependencies(fastimagehash wavelib)
|
add_dependencies(fastimagehash wavelib)
|
||||||
add_dependencies(bm fastimagehash)
|
add_dependencies(bm fastimagehash)
|
||||||
add_dependencies(bm benchmark)
|
add_dependencies(bm benchmark)
|
||||||
|
@ -16,7 +16,7 @@ replacement for C/C++.
|
|||||||
### Example usage
|
### Example usage
|
||||||
|
|
||||||
```C
|
```C
|
||||||
#include "fastimagehash.h"
|
#include <fastimagehash.h>
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
unsigned char result[HASH_SIZE];
|
unsigned char result[HASH_SIZE];
|
||||||
@ -47,6 +47,9 @@ git clone --recursive https://github.com/simon987/fastimagehash
|
|||||||
# Build
|
# Build
|
||||||
cmake .
|
cmake .
|
||||||
make
|
make
|
||||||
|
|
||||||
|
# Install as a system library
|
||||||
|
sudo make install
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -40,7 +40,6 @@ void hash_to_hex_string_reversed(const uchar *h, char *out, int hash_size) {
|
|||||||
int hash_len = hash_size * hash_size / 4;
|
int hash_len = hash_size * hash_size / 4;
|
||||||
|
|
||||||
for (unsigned int i = 0; i < hash_len; i += 2) {
|
for (unsigned int i = 0; i < hash_len; i += 2) {
|
||||||
|
|
||||||
uchar c = (h[i / 2] & 0x80) >> 7 |
|
uchar c = (h[i / 2] & 0x80) >> 7 |
|
||||||
(h[i / 2] & 0x40) >> 5 |
|
(h[i / 2] & 0x40) >> 5 |
|
||||||
(h[i / 2] & 0x20) >> 3 |
|
(h[i / 2] & 0x20) >> 3 |
|
||||||
@ -370,7 +369,6 @@ int multi_hash_mem(void *buf, multi_hash_t *out, size_t buf_len,
|
|||||||
resize(im, dhash_im, Size(hash_size + 1, hash_size), 0, 0, INTER_AREA);
|
resize(im, dhash_im, Size(hash_size + 1, hash_size), 0, 0, INTER_AREA);
|
||||||
resize(im, whash_im, Size(wh_img_scale, wh_img_scale), 0, 0, INTER_AREA);
|
resize(im, whash_im, Size(wh_img_scale, wh_img_scale), 0, 0, INTER_AREA);
|
||||||
resize(im, phash_im, Size(ph_img_scale, ph_img_scale), 0, 0, INTER_AREA);
|
resize(im, phash_im, Size(ph_img_scale, ph_img_scale), 0, 0, INTER_AREA);
|
||||||
|
|
||||||
} catch (Exception &e) {
|
} catch (Exception &e) {
|
||||||
return FASTIMAGEHASH_ERR;
|
return FASTIMAGEHASH_ERR;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user