c++ - CMake not detecting CXX but detecting CPP files -
i'm trying learn cmake http://www.cmake.org/cmake/help/cmake_tutorial.html , running trouble first step of running simple file tutorial.cpp.
the issue when have command in cmakelists.txt file
add_executable(tutorial tutorial.cpp)
it builds fine.
however, when change to
add_executable(tutorial tutorial.cxx)
it gives following error
-- configuring done cmake error @ src/cmakelists.txt:6 (add_executable): cannot find source file: tutorial.cxx tried extensions .c .c .c++ .cc .cpp .cxx .m .m .mm .h .hh .h++ .hm .hpp .hxx .in .txx -- build files have been written to: /home/vaisagh/workspace/test/build
my directory structure this:
. ├── build ├── cmakelists.txt └── src ├── cmakelists.txt └── tutorial.cpp 2 directories, 3 files
cmakelists.txt
#specify version being used aswell language cmake_minimum_required(version 2.8.11) #name project here project(tutorial) add_subdirectory(src)
src/cmakelists.txt
#specify version being used aswell language cmake_minimum_required(version 2.8.11) add_executable(tutorial tutorial.cxx)
tried extensions .c .c...
indicates cmake tried search tutorial.cxx.c
, tutorial.cxx.c
, etc.
the source filename given add_executable
must match actual filename on disc.
- rename
tutorial.cpp
tutorial.cxx
-or- - change
add_executable(tutorial tutorial.cxx)
add_executable(tutorial tutorial.cpp)
Comments
Post a Comment