[CMake] CMAKE & Linux Environment variable

Kevyn-Alexandre Paré kapare at rogue-research.com
Fri Jul 15 17:27:04 EDT 2011


Hi,

How do I make cmake to use environment variable?

My context is that I want to have environment variable that represent my svn ROOT PATH (developer ENV.) and my open embedded path (in case of cross compiling). What's the best way to have something reusable for each developer?


EX:

SOMEWHERE on my HD:

SVN_ROOT_PATH
	Project
		trunk
			Config
				Config-Generic-cache.txt   #ARCH, COMPILER, FLAGS, build type
				Config-Project-specific-cache.txt # COMPILATION PROJECT SPECIFIC
			CMakeLists.txt
			build

SOMEWHERE else on my HD:
OE_PATH

So for now I do this and hardcode the SVN_ROOT_PATH in Config-Generic-cache.txt:

cd SVN_ROOT_PATH/Project/trunk/build 
cmake -DCMAKE_SYSTEM_PROCESSOR:STRING=x86_64 -DCMAKE_BUILD_TYPE:STRING=debug -C ../Config/Config-Generic-cache.txt  ../


Any suggestion to add the SVN_ROOT_PATH, best solution / best practice?

Best Regards

Kevyn-Alexandre




More information about the CMake mailing list