I'm using CMake to genenerate my Makefile's however I cannot generate the .clang_complete using the standard
make CC='~/.vim/bin/cc_args.py gcc' CXX='~/.vim/bin/cc_args.py g++' -B
nothing gets generated...
the tree structure looks like so
Root
|
|_core
| |_src
| | |_main.cpp
| | |_CMakeLists.txt (1)
| |_inc
| |_CMakeLists.txt (2)
|
|_lib
| |_rtaudio
|
|_CMakeLists.txt (3)
CMakeLists.txt (1) file:
include_directories("${Dunkel_SOURCE_DIR}/core/inc")
include_directories("${Dunkel_SOURCE_DIR}/lib/")
link_directories("${Dunkel_SOURCE_DIR}/lib/rtaudio")
add_executable(Dunkel main.cpp)
target_link_libraries(Dunkel rtaudio)
CMakeLists.txt (2) file:
subdirs(src)
CMakeLists.txt (3) file:
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(Dunkel)
SUBDIRS(core)
set(CMAKE_CXX_FLAGS "-g")
What am I doing wrong here?
Looks like contrary to make
cmake
doesn't expand tilde, hence it treats is as part of the path. To make it work as expected either use absolute path to the cc_args.py
script or do two simple changes in the command:
$HOME
.After the changes your command should look like this:
CXX="$HOME/.vim/bin/cc_args.py g++" cmake ..
And it should work.
You should run (in your build directory)
CXX='~/.vim/bin/cc_args.py g++' cmake ..
and then run make
as usual. Note that this will run the cc_args.py script every time you build the project with make
, if you want to disable this, re-run cmake
again.
The file .clang_complete
will be created in the build directory, move it if needed.
See also Vim: Creating .clang_complete using CMake
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With