[Kst] branches/work/kst/portto4/kst/cmake

Peter Kümmel syntheticpp at gmx.net
Sun Mar 18 19:10:43 UTC 2012


SVN commit 1286231 by kuemmel:

add 3rdparty lib support for mingw32 witk GCC 4.6

 M  +15 -2     CMakeLists.txt  


--- branches/work/kst/portto4/kst/cmake/CMakeLists.txt #1286230:1286231
@@ -61,15 +61,28 @@
 	set(kst_3rdparty_dir ${CMAKE_BINARY_DIR}/3rdparty/installed)
 	add_subdirectory(3rdparty)
 elseif(kst_3rdparty_download)
+    if(MINGW)
+        execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
+        message(STATUS "Using GCC version ${GCC_VERSION}")
+        if(GCC_VERSION VERSION_LESS 4.6)
+            set(ver 4.4)
+            set(md5 999248fb40a44543af4dd4cd1be0ceeb)
+        else(GCC_VERSION VERSION_GREATER 4.6)
+            set(ver 4.6)
+            set(md5 eb7898c9c5e57998ea210af899d8c3a1)
+        else()
+            message(FATA_ERROR "MinGW version ${GCC_VERSION} not supported")
+        endif()
+    endif()
 	message(STATUS "Checking downloaded 3rd party binaries.")
-	set(_deps kst-3rdparty-win32-gcc4.4)
+	set(_deps kst-3rdparty-win32-gcc${ver})
 	set(_file ${_deps}.zip)
 	set(_downloaded _downloaded-NOTFOUND CACHE PATH "3rd party binaries already downloaded" FORCE)
 	find_file(_downloaded ${_file} ${CMAKE_BINARY_DIR})
 	if (NOT _downloaded)
 		file(DOWNLOAD http://sourceforge.net/projects/kst/files/3rdparty/${_file}
             ${CMAKE_BINARY_DIR}/${_file}
-			EXPECTED_MD5 999248fb40a44543af4dd4cd1be0ceeb
+			EXPECTED_MD5 ${md5}
 			SHOW_PROGRESS)
 		execute_process(COMMAND ${CMAKE_COMMAND} -E tar -xfj ${CMAKE_BINARY_DIR}/${_file})
 	endif()


More information about the Kst mailing list