[trunk] FolderReorgProposal task: refactor MJ2

Update issue 177
This commit is contained in:
Mathieu Malaterre 2012-09-28 08:51:14 +00:00
parent 3e62f8d9b7
commit f71af2a2ef
6 changed files with 51 additions and 7 deletions

View File

@ -17,4 +17,6 @@ if(BUILD_JP3D)
add_subdirectory(jp3d) add_subdirectory(jp3d)
endif() endif()
if(BUILD_VIEWER)
add_subdirectory(wx) add_subdirectory(wx)
endif()

View File

@ -30,7 +30,7 @@ ${OPENJPEG_SOURCE_DIR}/src/lib/openjp2/tpix_manager.c
${OPENJPEG_SOURCE_DIR}/src/lib/openjp2/function_list.c ${OPENJPEG_SOURCE_DIR}/src/lib/openjp2/function_list.c
) )
set(MJ2_SRCS mj2.c mj2_convert.c) #set(MJ2_SRCS mj2.c mj2_convert.c)
if(WIN32) if(WIN32)
add_definitions(-DOPJ_STATIC) add_definitions(-DOPJ_STATIC)
@ -39,6 +39,7 @@ endif()
# Headers file are located here: # Headers file are located here:
include_directories( include_directories(
${OPENJPEG_SOURCE_DIR}/src/lib/openjp2 ${OPENJPEG_SOURCE_DIR}/src/lib/openjp2
${OPENJPEG_SOURCE_DIR}/src/lib/openmj2
${OPENJPEG_SOURCE_DIR}/src/bin/common ${OPENJPEG_SOURCE_DIR}/src/bin/common
${LCMS_INCLUDE_DIRNAME} ${LCMS_INCLUDE_DIRNAME}
) )
@ -49,7 +50,7 @@ add_executable(frames_to_mj2
${OPJ_SRCS} ${OPJ_SRCS}
${MJ2_SRCS} ${MJ2_SRCS}
) )
target_link_libraries(frames_to_mj2 ${LCMS_LIBNAME}) target_link_libraries(frames_to_mj2 ${LCMS_LIBNAME} openmj2)
if(UNIX) if(UNIX)
target_link_libraries(frames_to_mj2 m) target_link_libraries(frames_to_mj2 m)
@ -73,7 +74,7 @@ add_executable(extract_j2k_from_mj2
${OPJ_SRCS} ${OPJ_SRCS}
${MJ2_SRCS} ${MJ2_SRCS}
) )
target_link_libraries(extract_j2k_from_mj2 ${LCMS_LIBNAME}) target_link_libraries(extract_j2k_from_mj2 ${LCMS_LIBNAME} openmj2)
if(UNIX) if(UNIX)
target_link_libraries(extract_j2k_from_mj2 m) target_link_libraries(extract_j2k_from_mj2 m)

View File

@ -3,12 +3,15 @@
add_subdirectory(openjp2) add_subdirectory(openjp2)
# optionals components: # optionals components:
if(BUILD_JPIP)
add_subdirectory(openjpip)
endif()
if(BUILD_JPWL) if(BUILD_JPWL)
add_subdirectory(openjpwl) add_subdirectory(openjpwl)
endif() endif()
if(BUILD_MJ2)
add_subdirectory(openmj2)
endif()
if(BUILD_JPIP)
add_subdirectory(openjpip)
endif()
if(BUILD_JP3D) if(BUILD_JP3D)
add_subdirectory(openjp3d) add_subdirectory(openjp3d)
endif() endif()

View File

@ -0,0 +1,38 @@
set(OPENMJ2_LIBRARY_NAME openmj2)
set(OPENMJ2_SRCS
mj2.c
)
# Build the library
if(WIN32)
if(BUILD_SHARED_LIBS)
add_definitions(-DOPJ_EXPORTS)
else(BUILD_SHARED_LIBS)
add_definitions(-DOPJ_STATIC)
endif(BUILD_SHARED_LIBS)
endif(WIN32)
include_directories(
${OPENJPEG_SOURCE_DIR}/src/lib/openjp2
)
# build mj2 lib:
add_library(${OPENMJ2_LIBRARY_NAME} ${OPENMJ2_SRCS})
target_link_libraries(${OPENMJ2_LIBRARY_NAME} openjpeg)
if(UNIX)
target_link_libraries(${OPENMJ2_LIBRARY_NAME} m)
endif()
set_target_properties(${OPENMJ2_LIBRARY_NAME} PROPERTIES ${OPENJPEG_LIBRARY_PROPERTIES})
# Install library
install(TARGETS ${OPENMJ2_LIBRARY_NAME}
EXPORT OpenMJ2Targets
DESTINATION ${OPENJPEG_INSTALL_LIB_DIR}
COMPONENT Libraries
)
# Install includes files
#INSTALL(FILES mj2.h
# DESTINATION ${OPENJPEG_INSTALL_INCLUDE_DIR}/${subdir}
# COMPONENT Headers
#)