Re: [CMake] Setting build type
Hello all, You were correct, when CGAL is built it overrides CMAKE_BUILD_TYPE, as documented here: http://doc.cgal.org/latest/Manual/installation.html The solution is to invoke: cmake -DCGAL_DONT_OVERRIDE_CMAKE_FLAGS=True -DCMAKE_BUILD_TYPE=Debug .. Thanks for your help! Adam On Sun, Mar 1, 2015 at 1:41 PM, Mark Abraham mark.j.abra...@gmail.com wrote: Hi, Looks like one of your find_package calls is setting the build type variable, which it should not... Mark On 27/02/2015 5:47 pm, Adam Getchell adam.getch...@gmail.com wrote: Thanks for the help! It still runs Release mode: Here's my project: https://github.com/acgetchell/CDT-plusplus ┌─[*adam*][Hapkido][*±*][master *✗*][~/CDT-plusplus] └─▪ tree . |.git | |config | |description | |HEAD | |hooks | | |applypatch-msg.sample | | |commit-msg.sample | | |post-update.sample | | |pre-applypatch.sample | | |pre-commit.sample | | |pre-push.sample | | |pre-rebase.sample | | |prepare-commit-msg.sample | | |update.sample | |index | |info | | |exclude | |logs | | |HEAD | | |refs | | | |heads | | | | |master | | | |remotes | | | | |origin | | | | | |HEAD | |objects | | |info | | |pack | | | |pack-a9db5eb5c90025a8ca13bddf15822cb0e57cbead.idx | | | |pack-a9db5eb5c90025a8ca13bddf15822cb0e57cbead.pack | |packed-refs | |refs | | |heads | | | |master | | |remotes | | | |origin | | | | |HEAD | | |tags |.gitignore |.travis-linux.yml |.travis-macosx.yml |.travis.yml |build.sh |CMakeLists.txt |Doxyfile |LICENSE |README.md |scan-build.sh |src | |cdt.cpp | |Delaunay.h | |docopt | | |docopt.cpp | | |docopt.h | | |docopt_private.h | | |docopt_util.h | | |docopt_value.h | | |examples | | | |naval_fate.cpp | | |LICENSE-Boost-1.0 | | |LICENSE-MIT | | |main.cpp | | |README.rst | | |run_testcase.cpp | | |run_tests.py | | |testcases.docopt | |grid_d.cpp | |grid_d.h | |periodic_3_complex.h | |periodic_3_triangulations.h | |Point.h | |S3Action.h | |S3ErgodicMoves.h | |S3Triangulation.h | |sphere_d.h | |utilities.h |unittests | |.gitignore | |main.cpp | |PointTest.cpp | |S3BulkActionTest.cpp | |S3ErgodicMovesTest.cpp | |S3TetrahedronTest.cpp | |SdTriangulationTest.cpp | |SphereTest.cpp | |Triangulated2SphereTest.cpp | |VertexTest.cpp ┌─[*adam*][Hapkido][*±*][master *✗*][~/CDT-plusplus] └─▪ mkdir build-d ┌─[*adam*][Hapkido][*±*][master *✗*][~/CDT-plusplus] └─▪ cd build-d ┌─[*adam*][Hapkido][*±*][master *✗*][~/CDT-plusplus/build-d] └─▪ cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=out .. -- The C compiler identification is AppleClang 6.0.0.656 -- The CXX compiler identification is AppleClang 6.0.0.656 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Build type: Release -- USING CXXFLAGS = ' -O3 -DNDEBUG' -- USING EXEFLAGS = ' -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib ' -- Targetting Unix Makefiles -- Using /usr/bin/c++ compiler. -- DARWIN_VERSION=14 -- Mac Leopard detected -- Requested component: Core -- Requested component: MPFR -- Requested component: GMP -- Found Eigen3: /usr/local/include/eigen3 (found suitable version 3.2.4, minimum required is 3.1.0) -- Found Intel TBB -- Configuring done -- Generating done -- Build files have been written to: /Users/adam/CDT-plusplus/build-d ┌─[*adam*][Hapkido][*±*][master *✗*][~/CDT-plusplus/build-d] On Wed, Feb 25, 2015 at 1:37 AM, J Decker d3c...@gmail.com wrote: mkdir build-d cd build-d cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=out ../your/source/procject cmake --build . cd .. mkdir build-r cd build-r cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=out ../your/source/procject cmake --build . --target install cd .. On Wed, Feb 25, 2015 at 1:16 AM, Adam Getchell adam.getch...@gmail.com wrote: Thanks for your reply. I'm not sure I follow your answer. I do delete the directory each time I build, but I'm still not understanding how you're building release or debug versions to begin with. I'm just automatically getting Release, unless I edit CMakeCache.txt
Re: [CMake] Setting build type
Thanks for the help! It still runs Release mode: Here's my project: https://github.com/acgetchell/CDT-plusplus ┌─[*adam*][Hapkido][*±*][master *✗*][~/CDT-plusplus] └─▪ tree . |.git | |config | |description | |HEAD | |hooks | | |applypatch-msg.sample | | |commit-msg.sample | | |post-update.sample | | |pre-applypatch.sample | | |pre-commit.sample | | |pre-push.sample | | |pre-rebase.sample | | |prepare-commit-msg.sample | | |update.sample | |index | |info | | |exclude | |logs | | |HEAD | | |refs | | | |heads | | | | |master | | | |remotes | | | | |origin | | | | | |HEAD | |objects | | |info | | |pack | | | |pack-a9db5eb5c90025a8ca13bddf15822cb0e57cbead.idx | | | |pack-a9db5eb5c90025a8ca13bddf15822cb0e57cbead.pack | |packed-refs | |refs | | |heads | | | |master | | |remotes | | | |origin | | | | |HEAD | | |tags |.gitignore |.travis-linux.yml |.travis-macosx.yml |.travis.yml |build.sh |CMakeLists.txt |Doxyfile |LICENSE |README.md |scan-build.sh |src | |cdt.cpp | |Delaunay.h | |docopt | | |docopt.cpp | | |docopt.h | | |docopt_private.h | | |docopt_util.h | | |docopt_value.h | | |examples | | | |naval_fate.cpp | | |LICENSE-Boost-1.0 | | |LICENSE-MIT | | |main.cpp | | |README.rst | | |run_testcase.cpp | | |run_tests.py | | |testcases.docopt | |grid_d.cpp | |grid_d.h | |periodic_3_complex.h | |periodic_3_triangulations.h | |Point.h | |S3Action.h | |S3ErgodicMoves.h | |S3Triangulation.h | |sphere_d.h | |utilities.h |unittests | |.gitignore | |main.cpp | |PointTest.cpp | |S3BulkActionTest.cpp | |S3ErgodicMovesTest.cpp | |S3TetrahedronTest.cpp | |SdTriangulationTest.cpp | |SphereTest.cpp | |Triangulated2SphereTest.cpp | |VertexTest.cpp ┌─[*adam*][Hapkido][*±*][master *✗*][~/CDT-plusplus] └─▪ mkdir build-d ┌─[*adam*][Hapkido][*±*][master *✗*][~/CDT-plusplus] └─▪ cd build-d ┌─[*adam*][Hapkido][*±*][master *✗*][~/CDT-plusplus/build-d] └─▪ cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=out .. -- The C compiler identification is AppleClang 6.0.0.656 -- The CXX compiler identification is AppleClang 6.0.0.656 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Build type: Release -- USING CXXFLAGS = ' -O3 -DNDEBUG' -- USING EXEFLAGS = ' -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib ' -- Targetting Unix Makefiles -- Using /usr/bin/c++ compiler. -- DARWIN_VERSION=14 -- Mac Leopard detected -- Requested component: Core -- Requested component: MPFR -- Requested component: GMP -- Found Eigen3: /usr/local/include/eigen3 (found suitable version 3.2.4, minimum required is 3.1.0) -- Found Intel TBB -- Configuring done -- Generating done -- Build files have been written to: /Users/adam/CDT-plusplus/build-d ┌─[*adam*][Hapkido][*±*][master *✗*][~/CDT-plusplus/build-d] On Wed, Feb 25, 2015 at 1:37 AM, J Decker d3c...@gmail.com wrote: mkdir build-d cd build-d cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=out ../your/source/procject cmake --build . cd .. mkdir build-r cd build-r cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=out ../your/source/procject cmake --build . --target install cd .. On Wed, Feb 25, 2015 at 1:16 AM, Adam Getchell adam.getch...@gmail.com wrote: Thanks for your reply. I'm not sure I follow your answer. I do delete the directory each time I build, but I'm still not understanding how you're building release or debug versions to begin with. I'm just automatically getting Release, unless I edit CMakeCache.txt after I've built once. I just checked CGAL_CreateSingleSourceCGALProgram.cmake which is invoked in my CMakeLists.txt, but I do not see it setting the build type to Release. https://github.com/acgetchell/CDT-plusplus/blob/master/CMakeLists.txt On Tue, Feb 24, 2015 at 12:20 PM, J Decker d3c...@gmail.com wrote: I use a different directory to build release and debug versions if you didn't delete, then when it goes to build partial things, the .obj files will still be newer than the .c files and will cause mixed release-debug builds which generally results in bizarre crashes. Once chosen, can't change the build type of a build; although if you could it
Re: [CMake] Setting build type
mkdir build-d cd build-d cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=out ../your/source/procject cmake --build . cd .. mkdir build-r cd build-r cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=out ../your/source/procject cmake --build . --target install cd .. On Wed, Feb 25, 2015 at 1:16 AM, Adam Getchell adam.getch...@gmail.com wrote: Thanks for your reply. I'm not sure I follow your answer. I do delete the directory each time I build, but I'm still not understanding how you're building release or debug versions to begin with. I'm just automatically getting Release, unless I edit CMakeCache.txt after I've built once. I just checked CGAL_CreateSingleSourceCGALProgram.cmake which is invoked in my CMakeLists.txt, but I do not see it setting the build type to Release. https://github.com/acgetchell/CDT-plusplus/blob/master/CMakeLists.txt On Tue, Feb 24, 2015 at 12:20 PM, J Decker d3c...@gmail.com wrote: I use a different directory to build release and debug versions if you didn't delete, then when it goes to build partial things, the .obj files will still be newer than the .c files and will cause mixed release-debug builds which generally results in bizarre crashes. Once chosen, can't change the build type of a build; although if you could it should do a clean also. On Tue, Feb 24, 2015 at 11:42 AM, Adam Getchell adam.getch...@gmail.com wrote: Hello all, I've browsed this thread: http://www.cmake.org/pipermail/cmake/2008-September/023808.html But it doesn't work. My project is set to Release regardless, whether I do: project( CDT-plusplus_ ) set(CMAKE_BUILD_TYPE RelWithDebInfo) Or: # # If the user specifies -DCMAKE_BUILD_TYPE on the command line, take their definition # and dump it in the cache along with proper documentation, otherwise set CMAKE_BUILD_TYPE # to Debug prior to calling PROJECT() # IF(DEFINED CMAKE_BUILD_TYPE) SET(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.) ELSE() SET(CMAKE_BUILD_TYPE Debug CACHE STRING Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.) ENDIF() project( CDT-plusplus_ ) The only way I can change the build type is by going into my build directory and editing CMakeCache.txt. However, I use an out of source build, so my build directory is generated automatically by scripts such as: https://github.com/acgetchell/CDT-plusplus/blob/master/scan-build.sh What's the correct method for being able to set the type of build via the command line? -- Adam Getchell about.me/adamgetchell Invincibility is in oneself, vulnerability in the opponent. -- Sun Tzu -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake -- Adam Getchell about.me/adamgetchell Invincibility is in oneself, vulnerability in the opponent. -- Sun Tzu -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
Re: [CMake] Setting build type
Thanks for your reply. I'm not sure I follow your answer. I do delete the directory each time I build, but I'm still not understanding how you're building release or debug versions to begin with. I'm just automatically getting Release, unless I edit CMakeCache.txt after I've built once. I just checked CGAL_CreateSingleSourceCGALProgram.cmake which is invoked in my CMakeLists.txt, but I do not see it setting the build type to Release. https://github.com/acgetchell/CDT-plusplus/blob/master/CMakeLists.txt On Tue, Feb 24, 2015 at 12:20 PM, J Decker d3c...@gmail.com wrote: I use a different directory to build release and debug versions if you didn't delete, then when it goes to build partial things, the .obj files will still be newer than the .c files and will cause mixed release-debug builds which generally results in bizarre crashes. Once chosen, can't change the build type of a build; although if you could it should do a clean also. On Tue, Feb 24, 2015 at 11:42 AM, Adam Getchell adam.getch...@gmail.com wrote: Hello all, I've browsed this thread: http://www.cmake.org/pipermail/cmake/2008-September/023808.html But it doesn't work. My project is set to Release regardless, whether I do: project( CDT-plusplus_ ) set(CMAKE_BUILD_TYPE RelWithDebInfo) Or: # # If the user specifies -DCMAKE_BUILD_TYPE on the command line, take their definition # and dump it in the cache along with proper documentation, otherwise set CMAKE_BUILD_TYPE # to Debug prior to calling PROJECT() # IF(DEFINED CMAKE_BUILD_TYPE) SET(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.) ELSE() SET(CMAKE_BUILD_TYPE Debug CACHE STRING Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.) ENDIF() project( CDT-plusplus_ ) The only way I can change the build type is by going into my build directory and editing CMakeCache.txt. However, I use an out of source build, so my build directory is generated automatically by scripts such as: https://github.com/acgetchell/CDT-plusplus/blob/master/scan-build.sh What's the correct method for being able to set the type of build via the command line? -- Adam Getchell about.me/adamgetchell Invincibility is in oneself, vulnerability in the opponent. -- Sun Tzu -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake -- Adam Getchell about.me/adamgetchell Invincibility is in oneself, vulnerability in the opponent. -- Sun Tzu -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
Re: [CMake] Setting build type
I use a different directory to build release and debug versions if you didn't delete, then when it goes to build partial things, the .obj files will still be newer than the .c files and will cause mixed release-debug builds which generally results in bizarre crashes. Once chosen, can't change the build type of a build; although if you could it should do a clean also. On Tue, Feb 24, 2015 at 11:42 AM, Adam Getchell adam.getch...@gmail.com wrote: Hello all, I've browsed this thread: http://www.cmake.org/pipermail/cmake/2008-September/023808.html But it doesn't work. My project is set to Release regardless, whether I do: project( CDT-plusplus_ ) set(CMAKE_BUILD_TYPE RelWithDebInfo) Or: # # If the user specifies -DCMAKE_BUILD_TYPE on the command line, take their definition # and dump it in the cache along with proper documentation, otherwise set CMAKE_BUILD_TYPE # to Debug prior to calling PROJECT() # IF(DEFINED CMAKE_BUILD_TYPE) SET(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.) ELSE() SET(CMAKE_BUILD_TYPE Debug CACHE STRING Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.) ENDIF() project( CDT-plusplus_ ) The only way I can change the build type is by going into my build directory and editing CMakeCache.txt. However, I use an out of source build, so my build directory is generated automatically by scripts such as: https://github.com/acgetchell/CDT-plusplus/blob/master/scan-build.sh What's the correct method for being able to set the type of build via the command line? -- Adam Getchell about.me/adamgetchell Invincibility is in oneself, vulnerability in the opponent. -- Sun Tzu -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake