SOLVED CMake whose "source directory" ?
-
First use of CMake, went relatively OK I did run CMake to build OpenCV , build it with "warning": CMake Warning at CMakeLists.txt:1250 (message): The source directory is the same as binary directory. "make clean" may damage the source tree What is "source directory" ? I did messed up some of the "destinations" , but before I'll try it again like to have an answer about "source directory". Thanks Cheers Vaclav The "source directory" CMake asked for was directory WERE CMakeLists.txt file is.
-
First use of CMake, went relatively OK I did run CMake to build OpenCV , build it with "warning": CMake Warning at CMakeLists.txt:1250 (message): The source directory is the same as binary directory. "make clean" may damage the source tree What is "source directory" ? I did messed up some of the "destinations" , but before I'll try it again like to have an answer about "source directory". Thanks Cheers Vaclav The "source directory" CMake asked for was directory WERE CMakeLists.txt file is.
Vaclav_Sal wrote:
What is "source directory" ?
isn't that where the source files live?
-
Vaclav_Sal wrote:
What is "source directory" ?
isn't that where the source files live?
-
OpenCV. it's complaining that cleaning the build products might damage the source because they're in the same directories.
-
OpenCV. it's complaining that cleaning the build products might damage the source because they're in the same directories.
-
First use of CMake, went relatively OK I did run CMake to build OpenCV , build it with "warning": CMake Warning at CMakeLists.txt:1250 (message): The source directory is the same as binary directory. "make clean" may damage the source tree What is "source directory" ? I did messed up some of the "destinations" , but before I'll try it again like to have an answer about "source directory". Thanks Cheers Vaclav The "source directory" CMake asked for was directory WERE CMakeLists.txt file is.
CMake expects you to run it "out of the source tree"... meaning that you run it from some "build" directory where all the build binaries will be stored. That keeps the source separate from any build artifacts. It's warning you that you're building from within your source directory. In simple terms... if you have a source tree that looks like this: OpenCV |-directory1 |-directory2 |-directory3 |-source_file1 |-source_file2 |-CMakeLists.txt When you run the CMake command, it should be from a separate, self contained directory: OpenCV |-build_dir |-directory1 |-directory2 |-directory3 |-source_file1 |-source_file2 |-CMakeLists.txt That keep all the build artifacts in "build_dir" so if you need to blow away your build, it's easy to do so without messing with the source. In this case, to launch cmake, go into your build_dir and launch with
cmake ../ -DANYOTHERCMAKEARGS
. -
CMake expects you to run it "out of the source tree"... meaning that you run it from some "build" directory where all the build binaries will be stored. That keeps the source separate from any build artifacts. It's warning you that you're building from within your source directory. In simple terms... if you have a source tree that looks like this: OpenCV |-directory1 |-directory2 |-directory3 |-source_file1 |-source_file2 |-CMakeLists.txt When you run the CMake command, it should be from a separate, self contained directory: OpenCV |-build_dir |-directory1 |-directory2 |-directory3 |-source_file1 |-source_file2 |-CMakeLists.txt That keep all the build artifacts in "build_dir" so if you need to blow away your build, it's easy to do so without messing with the source. In this case, to launch cmake, go into your build_dir and launch with
cmake ../ -DANYOTHERCMAKEARGS
.I think the problem is "descriptive terminology". I have a "mother directory" OpenCV with CMakeList.txt file I execute using CMake. I did not bother to find were CMake resides. Now CMake wants to know "source directory". That is why I asked - apparently it is the "mother directory" and not some specific real source code of OpenCV. ( I suppose analyzing CMake would give some clue ) Now CMake will build OpenCV library and again - where should this "build" be? Logically it belongs under the mother directory just to keep things under common directory. Apparently, and I do not discount I made some other mistake, that caused the warning. It all sounds pretty simple, but turns difficult to troubleshoot when things do not go right. For example CMake finishes the "build" gives no "option" to quit / exit -just ask for same "click this or that again ". But I am making some progress thanks to this forum. Cheers Vaclav
-
First use of CMake, went relatively OK I did run CMake to build OpenCV , build it with "warning": CMake Warning at CMakeLists.txt:1250 (message): The source directory is the same as binary directory. "make clean" may damage the source tree What is "source directory" ? I did messed up some of the "destinations" , but before I'll try it again like to have an answer about "source directory". Thanks Cheers Vaclav The "source directory" CMake asked for was directory WERE CMakeLists.txt file is.