Skip to content

Instantly share code, notes, and snippets.

@utensil
Created June 4, 2014 13:59
Show Gist options
  • Save utensil/16c49c72a87485a7a59d to your computer and use it in GitHub Desktop.
Save utensil/16c49c72a87485a7a59d to your computer and use it in GitHub Desktop.
CMake Test
cmake_minimum_required(VERSION 2.8)
macro (show variable value)
message("${variable} = ${value}")
endmacro()
function(join VALUES GLUE OUTPUT)
string (REPLACE ";" "${GLUE}" _TMP_STR "${VALUES}")
set (${OUTPUT} "${_TMP_STR}" PARENT_SCOPE)
endfunction()
macro (show_list variable list)
join(${list} " " output)
message("${variable} = ${output}")
endmacro()
show("WIN32" ${WIN32})
show("MINGW" ${MINGW})
show("MSYS" ${MSYS})
show("CYGWIN" ${CYGWIN})
show("MSVC" ${MSVC})
show("CMAKE_CXX_COMPILER" ${CMAKE_CXX_COMPILER})
@utensil
Copy link
Author

utensil commented Jun 4, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment