diff --git a/CMake/mitkSetupCPack.cmake b/CMake/mitkSetupCPack.cmake index 34d44c209e..30a7cc7711 100644 --- a/CMake/mitkSetupCPack.cmake +++ b/CMake/mitkSetupCPack.cmake @@ -1,104 +1,109 @@ # # First, set the generator variable # if(NOT CPACK_GENERATOR) if(WIN32) find_program(NSIS_MAKENSIS NAMES makensis PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS] DOC "Where is makensis.exe located" ) if(NOT NSIS_MAKENSIS) set(CPACK_GENERATOR ZIP) else() set(CPACK_GENERATOR "NSIS;ZIP") endif(NOT NSIS_MAKENSIS) else() if(APPLE) set(CPACK_GENERATOR DragNDrop) else() set(CPACK_GENERATOR TGZ) endif() endif() endif(NOT CPACK_GENERATOR) # On windows set default install directory appropriately for 32 and 64 bit # installers if not already set if(WIN32 AND NOT CPACK_NSIS_INSTALL_ROOT) if(CMAKE_CL_64) set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64") else() set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES") endif() endif() +# By default, do not warn when built on machines using only VS Express +if(NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS) + set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON) +endif() + # include required mfc libraries include(InstallRequiredSystemLibraries) set(CPACK_PACKAGE_NAME "MITK") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MITK is a medical image processing tool") set(CPACK_PACKAGE_VENDOR "German Cancer Research Center (DKFZ)") set(CPACK_PACKAGE_DESCRIPTION_FILE "${MITK_SOURCE_DIR}/LICENSE.txt") set(CPACK_RESOURCE_FILE_LICENSE "${MITK_SOURCE_DIR}/LICENSE.txt") set(CPACK_PACKAGE_VERSION_MAJOR "${MITK_VERSION_MAJOR}") set(CPACK_PACKAGE_VERSION_MINOR "${MITK_VERSION_MINOR}") # tell cpack to strip all debug symbols from all files set(CPACK_STRIP_FILES ON) # append revision number if available if(MITK_REVISION_ID AND MITK_VERSION_PATCH STREQUAL "99") if(MITK_WC_TYPE STREQUAL "git") set(git_hash ${MITK_REVISION_ID}) string(LENGTH "${git_hash}" hash_length) if(hash_length GREATER 6) string(SUBSTRING ${git_hash} 0 6 git_hash) endif() set(CPACK_PACKAGE_VERSION_PATCH "${MITK_VERSION_PATCH}_r${git_hash}") else() set(CPACK_PACKAGE_VERSION_PATCH "${MITK_VERSION_PATCH}_r${MITK_REVISION_ID}") endif() else() set(CPACK_PACKAGE_VERSION_PATCH "${MITK_VERSION_PATCH}") endif() # set version set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") # determine possible system specific extension set(CPACK_PACKAGE_ARCH "unkown-architecture") if(${CMAKE_SYSTEM_NAME} MATCHES Windows) if(CMAKE_CL_64) set(CPACK_PACKAGE_ARCH "win64") elseif(MINGW) set(CPACK_PACKAGE_ARCH "mingw32") elseif(WIN32) set(CPACK_PACKAGE_ARCH "win32") endif() endif(${CMAKE_SYSTEM_NAME} MATCHES Windows) if(${CMAKE_SYSTEM_NAME} MATCHES Linux) if(${CMAKE_SYSTEM_PROCESSOR} MATCHES i686) set(CPACK_PACKAGE_ARCH "linux32") elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES x86_64) if(${CMAKE_CXX_FLAGS} MATCHES " -m32 ") set(CPACK_PACKAGE_ARCH "linux32") else() set(CPACK_PACKAGE_ARCH "linux64") endif(${CMAKE_CXX_FLAGS} MATCHES " -m32 ") else() set(CPACK_PACKAGE_ARCH "linux") endif() endif(${CMAKE_SYSTEM_NAME} MATCHES Linux) if(${CMAKE_SYSTEM_NAME} MATCHES Darwin) set(CPACK_PACKAGE_ARCH "mac64") endif(${CMAKE_SYSTEM_NAME} MATCHES Darwin) set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_PACKAGE_ARCH}") diff --git a/Utilities/Poco/CMakeLists.txt b/Utilities/Poco/CMakeLists.txt index 789482f151..8017f2bf45 100755 --- a/Utilities/Poco/CMakeLists.txt +++ b/Utilities/Poco/CMakeLists.txt @@ -1,120 +1,125 @@ project(poco) cmake_minimum_required(VERSION 2.6) set(CPACK_PACKAGE_VERSION_MAJOR "1") set(CPACK_PACKAGE_VERSION_MINOR "3") set(CPACK_PACKAGE_VERSION_PATCH "5") set(COMPLETE_VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}) set(RELEASE_NAME "Poco 1.3.5") set(PROJECT_VERSION ${COMPLETE_VERSION}) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "" CACHE PATH "The single directory for all runtime files") set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "" CACHE PATH "The single directory for all library files") #set(COMMON_CXX "-Wall -Wno-sign-compare") set(CMAKE_CXX_FLAGS_DEBUG "${COMMON_CXX} ${CMAKE_CXX_FLAGS_DEBUG}") set(CMAKE_CXX_FLAGS_MINSIZEREL "${COMMON_CXX} ${CMAKE_CXX_FLAGS_MINSIZEREL}") #see Bug #5281 if(NOT MSVC) set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG") endif(NOT MSVC) # Set the library postfix set(CMAKE_DEBUG_POSTFIX "d") # Uncomment from next two lines to force statitc or dynamic library, default is autodetection if(POCO_STATIC) set( LIB_MODE STATIC ) else(POCO_STATIC) set( LIB_MODE SHARED ) endif(POCO_STATIC) # whether unit tests should be build set(POCO_ENABLE_TESTS FALSE CACHE BOOL "Build the Poco unit tests") mark_as_advanced(POCO_ENABLE_TESTS) set(ENABLE_TESTS ${POCO_ENABLE_TESTS}) if(ENABLE_TESTS) enable_testing() endif(ENABLE_TESTS) # Set local include path #include_directories( CppUnit/include Foundation/include XML/include Net/include NetSSL_OpenSSL/include Util/include Data/include WebWidgets/include Zip/include) include_directories( CppUnit/include CppUnit/WinTestRunner/include Foundation/include XML/include Util/include Zip/include) include(CheckTypeSize) include(FindCygwin) #include(FindOpenSSL) include(CMakeDetermineCompilerId) #include(contrib/cmake/FindMySQL.cmake) #include(contrib/cmake/FindAPR.cmake) #include(contrib/cmake/FindApache2.cmake) # OS Detection if(CMAKE_SYSTEM MATCHES "Windows") add_definitions( -DPOCO_OS_FAMILY_WINDOWS )# -DPOCO_WIN32_UTF8) add_definitions( -DPOCO_NO_AUTOMATIC_LIBS ) set(SYSLIBS iphlpapi gdi32) endif(CMAKE_SYSTEM MATCHES "Windows") if(CMAKE_SYSTEM MATCHES "Linux") add_definitions( -DPOCO_OS_FAMILY_UNIX ) # Standard 'must be' defines add_definitions( -D_XOPEN_SOURCE=500 -D_REENTRANT -D_THREAD_SAFE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64) set(SYSLIBS pthread dl rt) endif(CMAKE_SYSTEM MATCHES "Linux") if(CMAKE_SYSTEM MATCHES "SunOS") add_definitions( -DPOCO_OS_FAMILY_UNIX ) # Standard 'must be' defines add_definitions( -D_XOPEN_SOURCE=500 -D_REENTRANT -D_THREAD_SAFE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 ) set(SYSLIBS pthread socket xnet nsl resolv rt dl) endif(CMAKE_SYSTEM MATCHES "SunOS") if(CMAKE_COMPILER_IS_MINGW) add_definitions(-DWC_NO_BEST_FIT_CHARS=0x400) add_definitions(-mno-cygwin -D_WIN32 -DMINGW32 -DWINVER=0x500 -DODBCVER=0x0300 -DPOCO_THREAD_STACK_SIZE -DFoundation_Config_INCLUDED ) #link_directories(/usr/local/lib /usr/lib) #include_directories(/usr/local/include /usr/include) endif(CMAKE_COMPILER_IS_MINGW) if(CMAKE_COMPILER_IS_CYGWIN) # add_definitions(-DWC_NO_BEST_FIT_CHARS=0x400) endif(CMAKE_COMPILER_IS_CYGWIN) # SunPro C++ if(${CMAKE_CXX_COMPILER_ID} MATCHES "SunPro") add_definitions( -D_BSD_SOURCE -library=stlport4) endif(${CMAKE_CXX_COMPILER_ID} MATCHES "SunPro") add_subdirectory(Foundation) add_subdirectory(XML) add_subdirectory(Util) add_subdirectory(CppUnit) #add_subdirectory(Net) #if(OPENSSL_FOUND) # add_subdirectory(NetSSL_OpenSSL) # add_subdirectory(Crypto) #endif(OPENSSL_FOUND) #add_subdirectory(Data) #add_subdirectory(WebWidgets) add_subdirectory(Zip) if(ENABLE_TESTS) add_subdirectory(Foundation/testsuite) add_subdirectory(XML/testsuite) add_subdirectory(Util/testsuite) add_subdirectory(Zip/testsuite) endif(ENABLE_TESTS) # Enable packaging +# By default, do not warn when built on machines using only VS Express +if(NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS) + set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON) +endif() + include(InstallRequiredSystemLibraries)