Linux linking fix + new Travis check
This commit is contained in:
parent
6b9da3f2a2
commit
34fb23c380
|
@ -27,3 +27,5 @@ before_script:
|
|||
|
||||
script: make
|
||||
|
||||
after_success:
|
||||
- demo/caesiumd -v
|
||||
|
|
|
@ -8,7 +8,7 @@ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
|||
# The version number.
|
||||
set(VERSION_MAJOR 0)
|
||||
set(VERSION_MINOR 5)
|
||||
set(VERSION_PATCH 1)
|
||||
set(VERSION_PATCH 2)
|
||||
|
||||
if (DEFINED VERBOSE)
|
||||
set(VERBOSE ${VERBOSE})
|
||||
|
@ -31,7 +31,7 @@ elseif (WIN32)
|
|||
set(ZOPFLI_DEFAULT_PATH C:\\zopfli)
|
||||
else ()
|
||||
set(MOZJPEG_DEFAULT_PATH /opt/mozjpeg)
|
||||
set(ZOPFLI_DEFAULT_PATH /usr)
|
||||
set(ZOPFLI_DEFAULT_PATH /usr/local)
|
||||
endif ()
|
||||
|
||||
|
||||
|
|
|
@ -6,11 +6,12 @@ endif ()
|
|||
|
||||
find_library(jpeg jpeg ${MOZJPEG_PATH}/lib)
|
||||
find_library(turbojpeg turbojpeg ${MOZJPEG_PATH}/lib)
|
||||
find_library(zopfli zopfli ${ZOPFLI_PATH}/lib)
|
||||
find_library(zopflipng zopflipng ${ZOPFLI_PATH}/lib)
|
||||
|
||||
add_library(caesium SHARED caesium.c error.c utils.c png.c vendor/lodepng.c jpeg.c)
|
||||
|
||||
target_link_libraries(caesium jpeg turbojpeg zopflipng)
|
||||
target_link_libraries(caesium jpeg turbojpeg zopfli zopflipng)
|
||||
|
||||
# Make sure the compiler can find include files for our Caesium library
|
||||
# when other libraries or executables link to Caesium
|
||||
|
@ -18,4 +19,4 @@ target_include_directories(caesium PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
|||
|
||||
install(FILES caesium.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include)
|
||||
install(TARGETS caesium
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
|
||||
|
|
11
demo/main.c
11
demo/main.c
|
@ -1,14 +1,15 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "../caesium/caesium.h"
|
||||
#include "config.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
fprintf(stdout, "libcaesium demo application v%d.%d.%d\n",
|
||||
VERSION_MAJOR,
|
||||
VERSION_MINOR,
|
||||
VERSION_PATCH);
|
||||
if (argc == 2 && strcmp(argv[1], "-v") == 0) {
|
||||
fprintf(stdout, "%d.%d.%d\n", VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH);
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
if (argc != 3) {
|
||||
fprintf(stderr, "Wrong arguments.\nExiting.\n");
|
||||
|
@ -20,4 +21,4 @@ int main(int argc, char *argv[])
|
|||
cs_compress(argv[1], argv[2], &options, &error_code);
|
||||
|
||||
exit(error_code);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue