cmake error "CMake Error: The source directory ".../p4c/build/[-DCMAKE_BUILD_TYPE=RELEASE" does not exist

Viewed 6930

I'm getting the cmake error when installing p4c. Below is the cmake command to be run

cmake .. [-DCMAKE_BUILD_TYPE=RELEASE|DEBUG] [-DCMAKE_INSTALL_PREFIX=<path>] [-DENABLE_DOCS=ON (default off)] [-DENABLE_P4RUNTIME_TO_PD=OFF (default on)]

I'm getting the below error

CMake Error: The source directory "/home/users/phani/p4c/build/[-DCMAKE_BUILD_TYPE=RELEASE" does not exist. Specify --help for usage, or press the help button on the CMake GUI. DEBUG]: command not found

source files, CmakeLists.txt are in path "/home/users/phani/p4c", build is done is seperate subdirectory as shown in the link. Please help me to resolve the error

1 Answers

The syntax:

cmake .. [-DCMAKE_BUILD_TYPE=RELEASE|DEBUG] [-DCMAKE_INSTALL_PREFIX=<path>] [-DENABLE_DOCS=ON (default off)] [-DENABLE_P4RUNTIME_TO_PD=OFF (default on)]

is commonly used to quickly describe what options can be added or not to a command line.

To perform a simple build, do

cmake ..

If you want to specify the build type, you do:

cmake .. -DCMAKE_BUILD_TYPE=RELEASE

or

cmake .. -DCMAKE_BUILD_TYPE=DEBUG

etc.

In other words, when you see

command [option] [option=val1|val2]

arguments under [] are optional, and char | means "or". You should not write these characters in the real command line you type in your terminal

Related