summaryrefslogtreecommitdiffstats
path: root/Modules/FindHDF5.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-12-18 15:13:01 (GMT)
committerBrad King <brad.king@kitware.com>2009-12-18 15:13:01 (GMT)
commit4ce7ffbfc545fe92cfecc4cd46b73b17b9eb6ad2 (patch)
tree940e695d293fb8d9893a63098bb9f672f513e86b /Modules/FindHDF5.cmake
parentbdcce344353d6fa0db0a9c2755170005ce84f901 (diff)
downloadCMake-4ce7ffbfc545fe92cfecc4cd46b73b17b9eb6ad2.zip
CMake-4ce7ffbfc545fe92cfecc4cd46b73b17b9eb6ad2.tar.gz
CMake-4ce7ffbfc545fe92cfecc4cd46b73b17b9eb6ad2.tar.bz2
FindHDF5: Fix Windows compile-line parsing
We modify the signature of _HDF5_parse_compile_line to pass the command line variable name rather than the command line itself. Otherwise the CMake language MACRO implementation tries to parse the command line as CMake syntax, which does not like backslashes.
Diffstat (limited to 'Modules/FindHDF5.cmake')
-rw-r--r--Modules/FindHDF5.cmake12
1 files changed, 6 insertions, 6 deletions
diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake
index a3c7105..a84e677 100644
--- a/Modules/FindHDF5.cmake
+++ b/Modules/FindHDF5.cmake
@@ -107,7 +107,7 @@ endmacro()
# Parse a compile line for definitions, includes, library paths, and libraries.
macro( _HDF5_parse_compile_line
- compile_line
+ compile_line_var
include_paths
definitions
library_paths
@@ -115,7 +115,7 @@ macro( _HDF5_parse_compile_line
# Match the include paths
string( REGEX MATCHALL "-I([^\" ]+)" include_path_flags
- "${compile_line}"
+ "${${compile_line_var}}"
)
foreach( IPATH ${include_path_flags} )
string( REGEX REPLACE "^-I" "" IPATH ${IPATH} )
@@ -124,14 +124,14 @@ macro( _HDF5_parse_compile_line
endforeach()
# Match the definitions
- string( REGEX MATCHALL "-D[^ ]*" definition_flags "${compile_line}" )
+ string( REGEX MATCHALL "-D[^ ]*" definition_flags "${${compile_line_var}}" )
foreach( DEF ${definition_flags} )
list( APPEND ${definitions} ${DEF} )
endforeach()
# Match the library paths
string( REGEX MATCHALL "-L([^\" ]+|\"[^\"]+\")" library_path_flags
- "${compile_line}"
+ "${${compile_line_var}}"
)
foreach( LPATH ${library_path_flags} )
@@ -144,7 +144,7 @@ macro( _HDF5_parse_compile_line
# match only -l's preceded by a space or comma
# this is to exclude directory names like xxx-linux/
string( REGEX MATCHALL "[, ]-l([^\", ]+)" library_name_flags
- "${compile_line}" )
+ "${${compile_line_var}}" )
# strip the -l from all of the library flags and add to the search list
foreach( LIB ${library_name_flags} )
string( REGEX REPLACE "^[, ]-l" "" LIB ${LIB} )
@@ -180,7 +180,7 @@ else()
foreach( LANGUAGE ${HDF5_LANGUAGE_BINDINGS} )
if( HDF5_${LANGUAGE}_COMPILE_LINE )
- _HDF5_parse_compile_line( ${HDF5_${LANGUAGE}_COMPILE_LINE}
+ _HDF5_parse_compile_line( HDF5_${LANGUAGE}_COMPILE_LINE
HDF5_${LANGUAGE}_INCLUDE_FLAGS
HDF5_${LANGUAGE}_DEFINITIONS
HDF5_${LANGUAGE}_LIBRARY_DIRS