diff --git a/CMakeLists.txt b/CMakeLists.txt index 6c33131b..27203d9c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,6 +39,37 @@ SET(OPENJPEG_LIBRARY_PROPERTIES VERSION "${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}.${OPENJPEG_VERSION_BUILD}" SOVERSION "${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}" ) +# You will also need to define a value for the following variables: +# OPENJPEG_INSTALL_BIN_DIR - binary dir (executables) +# OPENJPEG_INSTALL_LIB_DIR - library dir (libs) +# OPENJPEG_INSTALL_DATA_DIR - share dir (say, examples, data, etc) +# OPENJPEG_INSTALL_INCLUDE_DIR - include dir (headers) + +# -------------------------------------------------------------------------- +# Install directories + +STRING(TOLOWER ${PROJECT_NAME} projectname) +SET(subdir "${projectname}-${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}") + +IF(NOT OPENJPEG_INSTALL_BIN_DIR) + SET(OPENJPEG_INSTALL_BIN_DIR "bin") +ENDIF(NOT OPENJPEG_INSTALL_BIN_DIR) + +IF(NOT OPENJPEG_INSTALL_LIB_DIR) + SET(OPENJPEG_INSTALL_LIB_DIR "lib") +ENDIF(NOT OPENJPEG_INSTALL_LIB_DIR) + +IF(NOT OPENJPEG_INSTALL_DATA_DIR) + SET(OPENJPEG_INSTALL_DATA_DIR "share/${subdir}") +ENDIF(NOT OPENJPEG_INSTALL_DATA_DIR) + +IF(NOT OPENJPEG_INSTALL_INCLUDE_DIR) + SET(OPENJPEG_INSTALL_INCLUDE_DIR "include/${subdir}") +ENDIF(NOT OPENJPEG_INSTALL_INCLUDE_DIR) + +IF(NOT OPENJPEG_INSTALL_DOC_DIR) + SET(OPENJPEG_INSTALL_DOC_DIR "share/doc/${subdir}") +ENDIF(NOT OPENJPEG_INSTALL_DOC_DIR) #----------------------------------------------------------------------------- # Test for some required system information. @@ -111,7 +142,7 @@ IF(BUILD_DOCUMENTATION) ENDIF(BUILD_DOCUMENTATION) #----------------------------------------------------------------------------- -# For openjpeg team if they ever want Dart+CMake +# For openjpeg team if they ever want CDash+CMake OPTION(BUILD_TESTING "Build the tests." OFF) IF(BUILD_TESTING) ENABLE_TESTING() diff --git a/ChangeLog b/ChangeLog index 19265f13..70edb2c1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,7 @@ Jun 21, 2010 * [MM] Remove some warnings in code * [MM] j2k_to_image properly return error code * [MM] increase coverage by testing all codecs +* [MM] fix installation. Place in subfolder to handle both API April 8, 2010 * [FOD] Fixed problem with Borland C++ Builder (Borland C do not have lrintf). Thanks Marek Mauder for this fix. diff --git a/libopenjpeg/CMakeLists.txt b/libopenjpeg/CMakeLists.txt index c1075389..10e9ee21 100644 --- a/libopenjpeg/CMakeLists.txt +++ b/libopenjpeg/CMakeLists.txt @@ -70,8 +70,10 @@ ENDIF(UNIX) # Install library INSTALL(TARGETS ${OPENJPEG_LIBRARY_NAME} - DESTINATION lib) + DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} +) # Install includes files INSTALL(FILES openjpeg.h - DESTINATION ${INCLUDE_INSTALL_DIR}/openjpeg) + DESTINATION ${OPENJPEG_INSTALL_INCLUDE_DIR} +) diff --git a/test_Free_image_V2_tile_handling/CMakeLists.txt b/test_Free_image_V2_tile_handling/CMakeLists.txt index 3b589a30..f75ea8cd 100644 --- a/test_Free_image_V2_tile_handling/CMakeLists.txt +++ b/test_Free_image_V2_tile_handling/CMakeLists.txt @@ -24,7 +24,5 @@ FOREACH(exe test2_encoder test2_decoder) ADD_EXECUTABLE(${exe} ${exe}.c) TARGET_LINK_LIBRARIES(${exe} ${OPJ_PREFIX}openjpeg) TARGET_LINK_LIBRARIES(${exe} ${FREEIMAGE_LIBRARIES}) - # Install exe - INSTALL_TARGETS(/bin/ ${exe}) ENDFOREACH(exe) diff --git a/test_V2_tile_handling/CMakeLists.txt b/test_V2_tile_handling/CMakeLists.txt index 7ea4a52c..10917dd4 100644 --- a/test_V2_tile_handling/CMakeLists.txt +++ b/test_V2_tile_handling/CMakeLists.txt @@ -21,7 +21,5 @@ ENDIF(NOT BUILD_SHARED_LIBS) FOREACH(exe test_encoder test_decoder) ADD_EXECUTABLE(${exe} ${exe}.c) TARGET_LINK_LIBRARIES(${exe} ${OPJ_PREFIX}openjpeg) - # Install exe - INSTALL_TARGETS(/bin/ ${exe}) ENDFOREACH(exe)