Re: [CMake] Using CMake for the first time on an established project
Thanks for the great tips, and I welcome more suggestions too from others. I saw the ccmake command in the tutorial, but not having ccmake, I thought it was a typo in the documentation. I am eager to reproduce this. Thank you very much! Timothy D Legg On Sat, Jul 8, 2017 at 8:50 AM, Albrecht Schlosserwrote: > On 08.07.2017 15:06 timothylegg . wrote: > >> I have CMake installed via apt-get on a few Debian-derived operating >> systems. My question is version independent, and I haven't checked, >> but I think version 2.8.0+ describes all the machines. >> >> There is a software project that I am wanting to become involved in >> that uses cmake, but I have never used makefiles of any sort within >> the last 20 years. I have a vague understanding of how they function >> and what their goals are, it's just that I've never written anything >> that had a level of complexity to require it. > > > First thing to know here is that CMake is not another kind of make. It's a > build system generator that can - among others - generate Makefiles for you > to run 'make' to build your project. > >> So lets get to the specifics, the project is open62541.org. Somebody >> wrote a wonderful PDF tutorial (link below) that suggests that >> compilation flags, such as BUILD_SHARED_LIBS, UA_ENABLE_METHODCALLS, >> or UA_ENABLE_AMALGAMATION, but fails to explain exactly how they are >> enabled. Would these be passed as parameters to cmake or would they >> have to be inserted into a file that the CMake tool suite expects to >> find upon execution of cmake? > > > These are CMake options (aka "cache variables") that can either be specified > on the cmake command line [1] or changed later in one of the GUI tools that > come with CMake. On page 7 in the mentioned PDF file you can see (for Linux > builds): > > # select additional features > ccmake .. > make > > So you need ccmake to be installed with cmake. On Ubuntu the package name is > "cmake-curses-gui", so if you can't run 'ccmake' you need to install this. > Another option is mentioned under the "Windows" section in the tutorial, but > this is also availabel under Linux: cmake-gui (Ubuntu package name: > "cmake-qt-gui"). > > Once you launch one of these GUI tools (after running the initial 'cmake' > command, but optionally before 'make' you'll see the mentioned CMake > options/variables and can change them interactively. After changing > variables, be sure to run 'configure' and 'generate' within cmake-gui or > ccmake. > > Then, exit the GUI and run 'make'. > > [1] to specify CMake options on the command line use this syntax: > > cmake -D"OPTION=value" -D"OTHER_OPTION=other_value" .. > -- > > 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
Re: [CMake] Using CMake for the first time on an established project
On 08.07.2017 15:06 timothylegg . wrote: I have CMake installed via apt-get on a few Debian-derived operating systems. My question is version independent, and I haven't checked, but I think version 2.8.0+ describes all the machines. There is a software project that I am wanting to become involved in that uses cmake, but I have never used makefiles of any sort within the last 20 years. I have a vague understanding of how they function and what their goals are, it's just that I've never written anything that had a level of complexity to require it. First thing to know here is that CMake is not another kind of make. It's a build system generator that can - among others - generate Makefiles for you to run 'make' to build your project. So lets get to the specifics, the project is open62541.org. Somebody wrote a wonderful PDF tutorial (link below) that suggests that compilation flags, such as BUILD_SHARED_LIBS, UA_ENABLE_METHODCALLS, or UA_ENABLE_AMALGAMATION, but fails to explain exactly how they are enabled. Would these be passed as parameters to cmake or would they have to be inserted into a file that the CMake tool suite expects to find upon execution of cmake? These are CMake options (aka "cache variables") that can either be specified on the cmake command line [1] or changed later in one of the GUI tools that come with CMake. On page 7 in the mentioned PDF file you can see (for Linux builds): # select additional features ccmake .. make So you need ccmake to be installed with cmake. On Ubuntu the package name is "cmake-curses-gui", so if you can't run 'ccmake' you need to install this. Another option is mentioned under the "Windows" section in the tutorial, but this is also availabel under Linux: cmake-gui (Ubuntu package name: "cmake-qt-gui"). Once you launch one of these GUI tools (after running the initial 'cmake' command, but optionally before 'make' you'll see the mentioned CMake options/variables and can change them interactively. After changing variables, be sure to run 'configure' and 'generate' within cmake-gui or ccmake. Then, exit the GUI and run 'make'. [1] to specify CMake options on the command line use this syntax: cmake -D"OPTION=value" -D"OTHER_OPTION=other_value" .. -- 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
[CMake] Using CMake for the first time on an established project
Hello, I have CMake installed via apt-get on a few Debian-derived operating systems. My question is version independent, and I haven't checked, but I think version 2.8.0+ describes all the machines. There is a software project that I am wanting to become involved in that uses cmake, but I have never used makefiles of any sort within the last 20 years. I have a vague understanding of how they function and what their goals are, it's just that I've never written anything that had a level of complexity to require it. I don't necessarily need to be able to create any kind of makefiles, but I only need to know how to use them at compile time. I could be talked into authoring them in the future, but presently there is no need. The software project I am interested in has very few members where forum questions can take several days to answer (there seems to be only 1 or 2 active participants whom are mostly absent) So lets get to the specifics, the project is open62541.org. Somebody wrote a wonderful PDF tutorial (link below) that suggests that compilation flags, such as BUILD_SHARED_LIBS, UA_ENABLE_METHODCALLS, or UA_ENABLE_AMALGAMATION, but fails to explain exactly how they are enabled. Would these be passed as parameters to cmake or would they have to be inserted into a file that the CMake tool suite expects to find upon execution of cmake? Thanks, Timothy D Legg References: Documentation - refer to pages: 9-10 of 154, 13 of 154 https://open62541.org/doc/open62541-0.2.pdf Mailing list question I posted two days ago: https://groups.google.com/forum/#!topic/open62541/Ifkzrn-k-2s -- 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