38 lines
1.1 KiB
CMake
38 lines
1.1 KiB
CMake
|
|
INCLUDE_REGULAR_EXPRESSION("^.*$")
|
|
|
|
# Defines the source code for the library
|
|
SET(OPENJP3D_SRCS
|
|
bio.c cio.c dwt.c event.c jp3d.c jp3d_lib.c mct.c mqc.c openjp3d.c pi.c raw.c t1.c t1_3d.c t2.c tcd.c tgt.c volume.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)
|
|
ADD_LIBRARY(${OPENJP3D_LIBRARY_NAME} ${OPENJP3D_SRCS})
|
|
IF(UNIX)
|
|
TARGET_LINK_LIBRARIES(${OPENJP3D_LIBRARY_NAME} m)
|
|
ENDIF(UNIX)
|
|
SET_TARGET_PROPERTIES(${OPENJP3D_LIBRARY_NAME} PROPERTIES ${OPENJP3D_LIBRARY_PROPERTIES})
|
|
|
|
# Install library
|
|
INSTALL(TARGETS ${OPENJP3D_LIBRARY_NAME}
|
|
EXPORT OpenJP3DTargets
|
|
DESTINATION ${OPENJP3D_INSTALL_LIB_DIR}
|
|
COMPONENT Libraries
|
|
)
|
|
|
|
# Install includes files
|
|
INSTALL(FILES openjp3d.h
|
|
DESTINATION ${OPENJP3D_INSTALL_INCLUDE_DIR}/${subdir}
|
|
COMPONENT Headers
|
|
)
|
|
INSTALL(CODE
|
|
"EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink ${subdir}/openjp3d.h \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${OPENJP3D_INSTALL_INCLUDE_DIR}/openjp3d.h)")
|
|
|