1 diff --git a/CMakeLists.txt b/CMakeLists.txt
2 index 88f0949..c57ef72 100644
5 @@ -20,8 +20,21 @@ SET( charls_HEADERS "colortransform.h" "context.h" "decoderstrategy.h" "encode
6 OPTION(charls_BUILD_SHARED_LIBS "Build CharLS with shared libraries." OFF)
7 SET(BUILD_SHARED_LIBS ${charls_BUILD_SHARED_LIBS})
9 -add_library(CharLS header.cpp interface.cpp jpegls.cpp )
10 +# Add soname to generated shared lib
12 +SET(CHARLS_LIB_MAJOR_VERSION 1)
13 +SET(CHARLS_LIB_MINOR_VERSION 0)
15 +IF(BUILD_SHARED_LIBS)
16 + add_library(CharLS SHARED header.cpp interface.cpp jpegls.cpp
19 + set_target_properties( CharLS PROPERTIES
20 + VERSION ${CHARLS_LIB_MAJOR_VERSION}.${CHARLS_LIB_MINOR_VERSION}
21 + SOVERSION ${CHARLS_LIB_MAJOR_VERSION}
24 +ENDIF(BUILD_SHARED_LIBS)
26 add_executable(charlstest test/main.cpp test/time.cpp test/util.cpp test/bitstreamdamage.cpp test/compliance.cpp test/performance.cpp test/dicomsamples.cpp)
27 target_link_libraries (charlstest CharLS)
28 @@ -29,4 +42,8 @@ target_link_libraries (charlstest CharLS)
29 # Installs the header files into the {build_dir}/include/libcharls directory
30 install(FILES ${charls_HEADERS} DESTINATION include/CharLS)
32 +# Installs the target file (libCharLS.so) into the {build_dir}/lib directory
33 +install(TARGETS CharLS LIBRARY DESTINATION lib${LIB_SUFFIX})