Merge pull request #545 from mayeut/master
[openjpeg.git] / src / lib / openjpip / CMakeLists.txt
index 47eb24acda82200437ef0438cf52b8e7d85e7e54..c149ef3fafcef7b8b3eaf51cae54f545ec4bdffa 100644 (file)
@@ -36,11 +36,6 @@ set(OPENJPIP_SRCS
   ${CMAKE_CURRENT_SOURCE_DIR}/session_manager.c
   ${CMAKE_CURRENT_SOURCE_DIR}/jpip_parser.c
   ${CMAKE_CURRENT_SOURCE_DIR}/sock_manager.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/cidx_manager.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/phix_manager.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/ppix_manager.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/thix_manager.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/tpix_manager.c
   )
 
 set(SERVER_SRCS
@@ -56,17 +51,28 @@ set(LOCAL_SRCS
   )
 
 # Build the library
-add_library(openjpip_local STATIC ${OPENJPIP_SRCS} ${LOCAL_SRCS})
-target_link_libraries(openjpip_local ${OPENJPEG_LIBRARY_NAME})
+if(WIN32)
+  if(BUILD_SHARED_LIBS)
+    add_definitions(-DOPJ_EXPORTS)
+  else()
+    add_definitions(-DOPJ_STATIC)
+  endif()
+endif()
+add_library(openjpip ${OPENJPIP_SRCS} ${LOCAL_SRCS})
+set_target_properties(openjpip
+  PROPERTIES ${OPENJPEG_LIBRARY_PROPERTIES})
+target_link_libraries(openjpip ${OPENJPEG_LIBRARY_NAME})
 if(WIN32)
   # add Winsock on windows+mingw
-  target_link_libraries(openjpip_local ws2_32)
+  target_link_libraries(openjpip ws2_32)
 endif()
 
 # Install library
-install(TARGETS openjpip_local
+install(TARGETS openjpip
   EXPORT OpenJPEGTargets
-  DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries
+  RUNTIME DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
+  LIBRARY DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries
+  ARCHIVE DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries
   )
 
 if(BUILD_JPIP_SERVER)