]> granicus.if.org Git - openjpeg/commitdiff
[trunk] Merge the CMake/ dir from opj 1.5
authorMathieu Malaterre <mathieu.malaterre@gmail.com>
Mon, 13 Feb 2012 11:20:26 +0000 (11:20 +0000)
committerMathieu Malaterre <mathieu.malaterre@gmail.com>
Mon, 13 Feb 2012 11:20:26 +0000 (11:20 +0000)
CMake/CTestCustom.cmake.in
CMake/JPIPTestDriver.cmake [new file with mode: 0644]
CMake/OpenJPEGCPack.cmake
CMake/OpenJPEGConfig.cmake.in
CMake/opj_logo.icns [deleted file]

index 60e6352832572f2e3623ac9ebaac04ac05947ec6..b3c4931e3f03f4825ebba208fee0889f4a02caef 100644 (file)
@@ -1,3 +1,5 @@
+#----------------------------------------------------------------------
+#
 # For further details regarding this file,
 # see http://www.cmake.org/Wiki/CMake_Testing_With_CTest#Customizing_CTest
 #
@@ -11,29 +13,20 @@ SET(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS   50)
 SET(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 2000)
 
 SET(CTEST_CUSTOM_COVERAGE_EXCLUDE
- ${CTEST_CUSTOM_COVERAGE_EXCLUDE}
+  ${CTEST_CUSTOM_COVERAGE_EXCLUDE}
+
+  # Exclude files from the Testing directories
+  ".*/tests/.*"
 
- # Exclude files from the Testing directories
- ".*/tests/.*"
   # Exclude files from the ThirdParty Utilities directories
- ".*/thirdparty/.*"
- )
 ".*/thirdparty/.*"
 )
 
 SET(CTEST_CUSTOM_WARNING_EXCEPTION
   ${CTEST_CUSTOM_WARNING_EXCEPTION}
-  
+
   # Suppress warning caused by intentional messages about deprecation
   ".*warning,.* is deprecated"
-)
-
-
-# Custom mechanism to catch cppcheck reports:
-#set(CTEST_CUSTOM_ERROR_MATCH
-# "error"
-#)
-
-# don't ask
-SET(CTEST_CUSTOM_WARNING_MATCH
- "error"
-)
+  # supress warnings caused by 3rd party libs:
+  ".*/thirdparty/.*"
+  )
diff --git a/CMake/JPIPTestDriver.cmake b/CMake/JPIPTestDriver.cmake
new file mode 100644 (file)
index 0000000..2147c46
--- /dev/null
@@ -0,0 +1,9 @@
+# JPIP test driver
+#message(STATUS "${D_URL}")
+file(DOWNLOAD
+  "${D_URL}"
+  "${D_FILE}"
+  LOG log
+  EXPECTED_MD5 "${EXPECTED_MD5}"
+  )
+message(STATUS "LOG: ${log}")
index e3cc5f4c5559ebf8ae90655254dfe4e65aa1a2ad..b7f2ba37905cb8a66df00985896ad33ec3471a38 100644 (file)
@@ -3,6 +3,9 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
   if(EXISTS "${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake")
     set(CMAKE_INSTALL_MFC_LIBRARIES 0)
     set(CMAKE_INSTALL_DEBUG_LIBRARIES 0)
+    if(NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
+      set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
+    endif()
     include(${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake)
   endif(EXISTS "${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake")
 
@@ -10,14 +13,58 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
   set(OPJ_PACKAGE_CONTACT "openjpeg users <openjpeg@googlegroups.com>")
 
   set(CPACK_PACKAGE_DESCRIPTION_SUMMARY ${OPJ_PACKAGE_DESCRIPTION_SUMMARY})
-  set(CPACK_PACKAGE_VENDOR           "OpenJPEG")
-  set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
-  set(CPACK_RESOURCE_FILE_LICENSE    "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
+  set(CPACK_PACKAGE_VENDOR           "OpenJPEG Team")
+  configure_file("${CMAKE_CURRENT_SOURCE_DIR}/LICENSE"
+    "${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt" COPYONLY
+    )
+  # For PackageMaker on MacOSX it is important to have a file extension:
+  set(CPACK_PACKAGE_DESCRIPTION_FILE    "${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt")
+  set(CPACK_RESOURCE_FILE_LICENSE    "${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt")
   set(CPACK_PACKAGE_VERSION_MAJOR    "${OPENJPEG_VERSION_MAJOR}")
   set(CPACK_PACKAGE_VERSION_MINOR    "${OPENJPEG_VERSION_MINOR}")
   set(CPACK_PACKAGE_VERSION_PATCH    "${OPENJPEG_VERSION_BUILD}")
   set(CPACK_PACKAGE_INSTALL_DIRECTORY "OpenJPEG ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}")
   set(CPACK_SOURCE_PACKAGE_FILE_NAME  "openjpeg-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
 
+  # Make this explicit here, rather than accepting the CPack default value,
+  # so we can refer to it:
+  SET(CPACK_PACKAGE_NAME "${OPENJPEG_LIBRARY_NAME}")
+
+  IF(NOT DEFINED CPACK_SYSTEM_NAME)
+    # make sure package is not Cygwin-unknown, for Cygwin just
+    # cygwin is good for the system name
+    IF("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
+      SET(CPACK_SYSTEM_NAME Cygwin)
+    ELSE("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
+      SET(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
+    ENDIF("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
+  ENDIF(NOT DEFINED CPACK_SYSTEM_NAME)
+  IF(${CPACK_SYSTEM_NAME} MATCHES Windows)
+    IF(CMAKE_CL_64)
+      SET(CPACK_SYSTEM_NAME win64-x64)
+    ELSE(CMAKE_CL_64)
+      SET(CPACK_SYSTEM_NAME win32-x86)
+    ENDIF(CMAKE_CL_64)
+  ENDIF(${CPACK_SYSTEM_NAME} MATCHES Windows)
+
+  IF(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
+    # if the CPACK_PACKAGE_FILE_NAME is not defined by the cache
+    # default to source package - system, on cygwin system is not 
+    # needed
+    IF(CYGWIN)
+      SET(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}")
+    ELSE(CYGWIN)
+      SET(CPACK_PACKAGE_FILE_NAME 
+        "${CPACK_SOURCE_PACKAGE_FILE_NAME}-${CPACK_SYSTEM_NAME}")
+    ENDIF(CYGWIN)
+  ENDIF(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
+
+  set(CPACK_BUNDLE_NAME "OpenJPEG ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}")
+  configure_file(${CMAKE_ROOT}/Templates/AppleInfo.plist
+    ${CMAKE_CURRENT_BINARY_DIR}/opj.plist)
+  SET(CPACK_BUNDLE_PLIST
+    ${CMAKE_CURRENT_BINARY_DIR}/opj.plist)
+  #include(BundleUtilities)
+
   include(CPack)
 endiF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
index 91f9a4d5100794adaa9c8abc51bbc134ad4090f4..020ddfcc1e949b43949720a5a794cdd49a035c4e 100644 (file)
@@ -11,13 +11,13 @@ SET(OPENJPEG_MINOR_VERSION "@OPENJPEG_VERSION_MINOR@")
 SET(OPENJPEG_BUILD_VERSION "@OPENJPEG_VERSION_BUILD@")
 
 # The libraries.
-SET(OPENJPEG_LIBRARIES "@OPENJPEG_LIBRARIES@")
+SET(OPENJPEG_LIBRARIES "@OPENJPEG_LIBRARY_NAME@")
 
 # The CMake macros dir.
-SET(OPENJPEG_CMAKE_DIR "@OPENJPEG_CMAKE_DIR_CONFIG@")
+SET(OPENJPEG_CMAKE_DIR "@OPENJPEG_INSTALL_PACKAGE_DIR@")
 
 # The configuration options.
-SET(OPENJPEG_BUILD_SHARED_LIBS "@OPENJPEG_BUILD_SHARED_LIBS@")
+SET(OPENJPEG_BUILD_SHARED_LIBS "@BUILD_SHARED_LIBS@")
 
 # The "use" file.
 SET(OPENJPEG_USE_FILE "@OPENJPEG_USE_FILE_CONFIG@")
diff --git a/CMake/opj_logo.icns b/CMake/opj_logo.icns
deleted file mode 100644 (file)
index cf3a0e8..0000000
Binary files a/CMake/opj_logo.icns and /dev/null differ