Skip to content

Instantly share code, notes, and snippets.

@dhamp
Created July 8, 2016 13:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dhamp/4063692d2c620caa8a01a164082f6827 to your computer and use it in GitHub Desktop.
Save dhamp/4063692d2c620caa8a01a164082f6827 to your computer and use it in GitHub Desktop.
cmake_read_env
/tmp|⇒ mkdir cmake_read_env
/tmp|⇒ cd cmake_read_env
cmake_read_env|⇒ nano CMakeLists.txt
cmake_read_env|⇒ mkdir build
cmake_read_env|⇒ cd build
build|⇒ cmake ../
build|⇒ cat ../CMakeLists.txt
project(cmake_read_env)
message(STATUS "CMAKE_READ_YOU_ENV_VAR->$ENV{CMAKE_READ_YOU_ENV_VAR}")
build|⇒ CMAKE_READ_YOU_ENV_VAR=OLOLO cmake ..
-- The C compiler identification is GNU 6.1.1
-- The CXX compiler identification is GNU 6.1.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- CMAKE_READ_YOU_ENV_VAR->OLOLO
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/cmake_read_env/build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment