Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Ian Collins Newsgroups: comp.lang.c++ Subject: Re: Examples of current platforms/architectures where sizeof(void*) > Date: Thu, 9 Sep 2021 22:19:03 +1200 Lines: 53 Message-ID: References: <3a825e94-940c-49c5-990a-554a6bcc35a4n@googlegroups.com> <_XsXI.31292$o45.12466@fx46.iad> <87a6kuhchx.fsf@nosuchdomain.example.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net RWHK/LA+J8Sf1VRP2FuZQA9wWsvoRPLS9Nq/2zNQm0cYy6f7CK Cancel-Lock: sha1:ys+2ZDm0+y50a/WjSVvSpvH/ILs= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 In-Reply-To: Content-Language: en-US Xref: csiph.com comp.lang.c++:81115 On 09/09/2021 20:55, MisterMule@stubborn.uk wrote: > On Thu, 9 Sep 2021 10:58:13 +1200 > Ian Collins wrote: >> On 08/09/2021 22:29, MisterMule@stubborn.uk wrote: >>> On Wed, 8 Sep 2021 09:38:24 +1200 >>> Ian Collins wrote: >>>> On 08/09/2021 04:41, Paavo Helde wrote: >>>>> >>>>> I guess one can write Fortran in any language, including CMake. My CMake >>>>> files are pretty clean, partially thanks to putting all common settings >>>>> into a common file which is included by the top-level CMakeLists.txt. >>>>> >>>>> In a typical CMakeLists.txt in a leaf directory I just say that what >>>>> files need to be compiled (typically *.cpp and *.h), into which library >>>>> they must be be linked into, and what third-party libraries are >>>>> involved. That's all what I'm interested in, and CMake will take care of >>>>> generating all the technical details. That's literally 5 CMake commands: >>>>> >>>>> target_include_directories(...) >>>>> target_link_directories(...) >>>>> target_link_libraries(...) >>>>> file(GLOB MY_SOURCES *.cpp *.h) >>>>> target_sources(... ${MY_SOURCES}) >>>>> >>>>> Cannot imagine it could be much simpler. All details I want to see and >>>>> control are visible, and all the technical details which I'm not >>>>> interested in are hidden. >>>> >>>> Not only that, you only have to change your top level rules to build for >>>> a new target and/or platform. Being able to emit ninja files or >>>> makefiles makes cross platform building on Unix like platforms and >>>> Windows trivial. >>> >>> I've written cross platform code for years. Generally its 1 or 2 lines in >>> the Makefile that need to be commented in/out. How is CMake any simpler? >> >> Windows? > > No, but then CMake and make are rarely used on Windows, its VC++ solution files. You said you've written cross platform code for years and asked how does CMake simplify things. If cross platform includes Windows, it certainly does. Even the Visual Studio team recommends it for cross platform development. https://docs.microsoft.com/en-us/cpp/build/get-started-linux-cmake?view=msvc-160 https://devblogs.microsoft.com/cppblog/cmake-support-in-visual-studio/ -- Ian.