Q:

port a variable form make to Cmake

Our Library uses Cmake while the Overall system uses Make file for build.  
I want to port the value of a variable (preprocessor macro) defined in the makefile to Cmakefile and use it as preprocessor marco in source codes of my library. 
How to do that? 

A:

You can define variable at CMake invocation like so:
cmake -DMY_VAR=ON <path_to_CMakeLists.txt>

Then later in your CMake file:
if (MY_VAR)
    add_definitions(-DENABLE_MY_VAR)
endif()

And finally in your code:
#ifdef ENABLE_MY_VAR
    // Your code
#endif

