|
From: <ai...@us...> - 2013-06-06 15:09:08
|
Revision: 12369
http://sourceforge.net/p/plplot/code/12369
Author: airwin
Date: 2013-06-06 15:09:05 +0000 (Thu, 06 Jun 2013)
Log Message:
-----------
Preliminary work to make build_projects work with the "MinGW
Makefiles" generator.
Modified Paths:
--------------
trunk/cmake/build_projects/CMakeLists.txt
trunk/cmake/build_projects/libagg/ep.cmake
trunk/cmake/build_projects/libharu/ep.cmake
trunk/cmake/build_projects/libqhull/ep.cmake
trunk/cmake/build_projects/ndiff/ep.cmake
trunk/cmake/build_projects/shapelib/ep.cmake
Modified: trunk/cmake/build_projects/CMakeLists.txt
===================================================================
--- trunk/cmake/build_projects/CMakeLists.txt 2013-06-05 06:54:51 UTC (rev 12368)
+++ trunk/cmake/build_projects/CMakeLists.txt 2013-06-06 15:09:05 UTC (rev 12369)
@@ -37,32 +37,72 @@
# Set build_projects variables to control builds in general
-if(NOT ${CMAKE_GENERATOR} STREQUAL "Unix Makefiles" AND NOT ${CMAKE_GENERATOR} STREQUAL "MSYS Makefiles")
- message(FATAL_ERROR "This project only works with either the \"Unix Makefiles\" or \"MSYS Makefiles\" generators")
-endif(NOT ${CMAKE_GENERATOR} STREQUAL "Unix Makefiles" AND NOT ${CMAKE_GENERATOR} STREQUAL "MSYS Makefiles")
-
+# Test whether there is access to the MSYS platform on the PATH. Note
+# this is a different question than whether you are using the "MSYS
+# Makefiles" generator since some other generators (e.g., "MinGW
+# Makefiles") can have MSYS on the path so long as sh.exe is renamed
+# or removed from that PATH. Note, we search for the automatic
+# installer app, mingw-get.exe and the bash.exe shell to check
+# (approximately) whether we have access to the MSYS platform, and
+# then we test that platform (very approximately) for completeness by
+# making sure unzip (necessary for some build configurations to unpack
+# their packages) is installed (using mingw-get).
+
+set(MSYS_PLATFORM)
+find_program(MINGW_GET_EXECUTABLE mingw-get)
+if(MINGW_GET_EXECUTABLE)
+ find_program(BASH_EXECUTABLE bash)
+ if(BASH_EXECUTABLE)
+ set(MSYS_PLATFORM ON)
+ endif(BASH_EXECUTABLE)
+endif(MINGW_GET_EXECUTABLE)
+message(STATUS "WIN32 = ${WIN32}")
+message(STATUS "MINGW = ${MINGW}")
+message(STATUS "MSYS = ${MSYS}")
+message(STATUS "MSYS_PLATFORM = ${MSYS_PLATFORM}")
+message(STATUS "CYGWIN = ${CYGWIN}")
+
+if(CYGWIN)
+ message(FATAL_ERROR "build_projects does not work correctly on the Cygwin platform. Use the MinGW compiler and MSYS platform instead.")
+endif(CYGWIN)
+
+if(WIN32 AND NOT MSYS_PLATFORM)
+ message(FATAL_ERROR "build_projects does not work correctly on Windows without the MSYS platform. Install the MSYS platform (perhaps without sh.exe depending on CMake generator) on Windows.")
+endif(WIN32 AND NOT MSYS_PLATFORM)
+
+find_program(UNZIP_EXECUTABLE unzip)
+if(NOT UNZIP_EXECUTABLE)
+ if(MSYS_PLATFORM)
+ message(STATUS "unzip missing from your MSYS platform. Use mingw-get to install it.")
+ endif(MSYS_PLATFORM)
+ message(FATAL_ERROR "unzip must be on your PATH in order for build_projects to work correctly")
+endif(NOT UNZIP_EXECUTABLE)
+
# Propagate the overall CMake generator and install prefix to all CMake-based
# software project builds.
set(BP_CMAKE_COMMAND cmake "-G${CMAKE_GENERATOR}" -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX})
# The non-parallel versions are for build systems that
# apparently have race conditions for parallel builds.
-set(BP_PARALLEL_BUILD_COMMAND make -j4)
-set(BP_NON_PARALLEL_MAKE_COMMAND make)
+if(CMAKE_GENERATOR STREQUAL "MinGW Makefiles")
+ set(BP_BUILD_COMMAND mingw32-make)
+else(CMAKE_GENERATOR STREQUAL "MinGW Makefiles")
+ set(BP_BUILD_COMMAND make)
+endif(CMAKE_GENERATOR STREQUAL "MinGW Makefiles")
+set(BP_PARALLEL_BUILD_COMMAND ${BP_BUILD_COMMAND} -j4)
+set(BP_CTEST_COMMAND ctest)
set(BP_PARALLEL_CTEST_COMMAND ctest -j4)
-set(BP_NON_PARALLEL_CTEST_COMMAND ctest)
+
set(BP_ORIGINAL_NATIVE_PATH "$ENV{PATH}")
set(BP_PATH "${BP_ORIGINAL_NATIVE_PATH}")
-if(MSYS)
+if(MSYS_PLATFORM)
# Useful function to convert Windows list of semicolon-delimited
- # paths to the equivalent list of MSYS paths (exactly like the
- # colon-delimited Unix list of paths except the driver letters are
+ # PATHs to the equivalent list of MSYS PATHs (exactly like the
+ # colon-delimited Unix list of PATHs except the driver letters are
# specified as the initial one-character component of each of the
- # paths). to MSYS path (like Unix path but with the drive letters
- # as single character initial component of the path). For example,
- # this function will will transform the Windows list of paths,
- # "z:\whatever_z;c:\whatever_c" to /z/whatever_z:/c/whatever_c.
+ # PATHs). For example, this function will transform the Windows
+ # list of PATHs, "z:\path1;c:\path2" to "/z/path1:/c/path2".
function(determine_msys_path MSYS_PATH NATIVE_PATH)
#message(STATUS "NATIVE_PATH = ${NATIVE_PATH}")
string(REGEX REPLACE "^\([a-zA-z]\):" "/\\1" PATH "${NATIVE_PATH}")
@@ -72,7 +112,7 @@
#message(STATUS "MSYS_PATH = ${PATH}")
set(${MSYS_PATH} ${PATH} PARENT_SCOPE)
endfunction(determine_msys_path)
-endif(MSYS)
+endif(MSYS_PLATFORM)
# Now include the build configurations for certain targets and their
# dependencies.
Modified: trunk/cmake/build_projects/libagg/ep.cmake
===================================================================
--- trunk/cmake/build_projects/libagg/ep.cmake 2013-06-05 06:54:51 UTC (rev 12368)
+++ trunk/cmake/build_projects/libagg/ep.cmake 2013-06-06 15:09:05 UTC (rev 12369)
@@ -29,11 +29,11 @@
set(libagg_URL_MD5 0229a488bc47be10a2fee6cf0b2febd6)
# Data that is related to the PATH that must be used.
-if(MSYS)
+if(MSYS_PLATFORM)
#set(BP_PATH_NODLL "${BP_PATH}")
#set(BP_PATH "${EP_BASE}/Build/build_libagg/dll;${BP_PATH_NODLL}")
determine_msys_path(BP_PATH "${BP_PATH}")
-endif(MSYS)
+endif(MSYS_PLATFORM)
#message(STATUS "modified BP_PATH for libagg = ${BP_PATH}")
ExternalProject_Add(
Modified: trunk/cmake/build_projects/libharu/ep.cmake
===================================================================
--- trunk/cmake/build_projects/libharu/ep.cmake 2013-06-05 06:54:51 UTC (rev 12368)
+++ trunk/cmake/build_projects/libharu/ep.cmake 2013-06-06 15:09:05 UTC (rev 12369)
@@ -29,11 +29,11 @@
set(libharu_URL_MD5 0623b8fb08ae1b28af08b2cdbd66b662)
# Data that is related to the PATH that must be used.
-if(MSYS)
+if(MSYS_PLATFORM)
#set(BP_PATH_NODLL "${BP_PATH}")
#set(BP_PATH "${EP_BASE}/Build/build_libharu/dll;${BP_PATH_NODLL}")
determine_msys_path(BP_PATH "${BP_PATH}")
-endif(MSYS)
+endif(MSYS_PLATFORM)
#message(STATUS "modified BP_PATH for libharu = ${BP_PATH}")
ExternalProject_Add(
Modified: trunk/cmake/build_projects/libqhull/ep.cmake
===================================================================
--- trunk/cmake/build_projects/libqhull/ep.cmake 2013-06-05 06:54:51 UTC (rev 12368)
+++ trunk/cmake/build_projects/libqhull/ep.cmake 2013-06-06 15:09:05 UTC (rev 12369)
@@ -29,11 +29,11 @@
set(libqhull_URL_MD5 e64138470acdeb18f752a0bc2a11ceb4)
# Data that is related to the PATH that must be used.
-if(MSYS)
+if(MSYS_PLATFORM)
#set(BP_PATH_NODLL "${BP_PATH}")
#set(BP_PATH "${EP_BASE}/Build/build_libqhull/dll;${BP_PATH_NODLL}")
determine_msys_path(BP_PATH "${BP_PATH}")
-endif(MSYS)
+endif(MSYS_PLATFORM)
#message(STATUS "modified BP_PATH for libqhull = ${BP_PATH}")
ExternalProject_Add(
Modified: trunk/cmake/build_projects/ndiff/ep.cmake
===================================================================
--- trunk/cmake/build_projects/ndiff/ep.cmake 2013-06-05 06:54:51 UTC (rev 12368)
+++ trunk/cmake/build_projects/ndiff/ep.cmake 2013-06-06 15:09:05 UTC (rev 12369)
@@ -29,15 +29,15 @@
# The MD5 value below is correct for the gpg --verified version
# Use URL_MD5 because ExternalProject_Add doesn't deal with gpg --version.
-# In any case, gpg is not available for the MSYS case.
+# In any case, gpg is not available for the MSYS_PLATFORM case.
set(ndiff_URL_MD5 885548b4dc26e72c5455bebb5ba6c16d)
# Data that is related to the PATH that must be used.
-if(MSYS)
+if(MSYS_PLATFORM)
#set(BP_PATH_NODLL "${BP_PATH}")
#set(BP_PATH "${EP_BASE}/Build/build_ndiff/dll;${BP_PATH_NODLL}")
determine_msys_path(BP_PATH "${BP_PATH}")
-endif(MSYS)
+endif(MSYS_PLATFORM)
#message(STATUS "modified BP_PATH for ndiff = ${BP_PATH}")
ExternalProject_Add(
Modified: trunk/cmake/build_projects/shapelib/ep.cmake
===================================================================
--- trunk/cmake/build_projects/shapelib/ep.cmake 2013-06-05 06:54:51 UTC (rev 12368)
+++ trunk/cmake/build_projects/shapelib/ep.cmake 2013-06-06 15:09:05 UTC (rev 12369)
@@ -32,11 +32,11 @@
set(shape_eg_data_URL_MD5 36208abd5d34c5c80101d8b214109f0d)
# Data that is related to the PATH that must be used.
-if(MSYS)
+if(MSYS_PLATFORM)
set(BP_PATH_NODLL "${BP_PATH}")
set(BP_PATH "${EP_BASE}/Build/build_shapelib/dll;${BP_PATH_NODLL}")
determine_msys_path(BP_PATH "${BP_PATH}")
-endif(MSYS)
+endif(MSYS_PLATFORM)
#message(STATUS "modified BP_PATH for shapelib = ${BP_PATH}")
ExternalProject_Add(
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|