On 26/07/2016 17:10, LMH wrote:
Csaba Raduly wrote:


Steps for building in a separate build directory:

mkdir _build
cd    _build
cmake ..

Csaba


I looked for the syntax for this when I first started. I assumed the the
author put the CMakeLists.txt file in the right place. I almost never
have my make file in the src directory when using gnu make, so this
looked the same to me. I didn't find any doc about how to have the
CMakeLists.txt and the src in different directories.


Csaba was clear but it seems you are misunderstanding,
the call to cmake is

       cmake [options] <path-to-source>

so I will put together his suggestion and Tony's one:

$ git pull https://bitbucket.org/tomilov/quickhull/src
$ ls src/
CMakeLists.txt  include  README.md  src  test
$ mkdir build
$ cd build
$ cmake -DCMAKE_CXX_COMPILER=clang  ../src

the "build" directory is in this case parallel to the "src" one.

Unfortunately it will fail on "Compiler does not support C++1z standard"
and you will need to modify the original CMakeLists.txt.
I cut
-------------------------------------------------------------------
-CHECK_CXX_COMPILER_FLAG("-std=gnu++1z" COMPILER_SUPPORTS_CXX1Z)
-if(NOT COMPILER_SUPPORTS_CXX1Z)
-    message(FATAL_ERROR "Compiler does not support C++1z standard")
-endif()
-add_compile_options("-std=gnu++1z")
-------------------------------------------------------------------

But there are other issues on the road; I passed some with

cmake -DCMAKE_CXX_COMPILER=clang -DCMAKE_CXX_FLAGS="-std=gnu++1z -I/usr/lib/gcc/x86_64-pc-cygwin/5.4.0/include/c++/ -I/usr/lib/gcc/x86_64-pc-cygwin/5.4.0/include/c++/x86_64-pc-cygwin/" ../src

but the build stop here
--------------------------------------------------------------------------
/pub/temp/src/src/simple_use.cpp:146:16: fatal error: no member named 'chrono' in namespace 'std'
    using std::chrono::duration_cast;
          ~~~~~^
15 warnings and 1 error generated.
make[2]: *** [CMakeFiles/qh.dir/build.make:66: CMakeFiles/qh.dir/src/simple_use.cpp.o] Error 1
---------------------------------------------------------------------------

and I am out of my C++ knowledge

Regards
Marco

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply via email to