Re: [CMake] Spaces in conditional output of generator expressions

2018-06-03 Thread Neil Carlson
lt;$:-assume;realloc_lhs>") On Sun, Jun 3, 2018 at 7:33 AM Neil Carlson wrote: > > On Sun, Jun 3, 2018 at 7:08 AM Marc CHEVRIER > wrote: > >> [...] >> GOOD: target_compile_options(someTarget PRIVATE >> "$<$:-Wall;-Wextra>") >&g

Re: [CMake] Spaces in conditional output of generator expressions

2018-06-03 Thread Neil Carlson
On Sun, Jun 3, 2018 at 7:08 AM Marc CHEVRIER wrote: > [...] > GOOD: target_compile_options(someTarget PRIVATE > "$<$:-Wall;-Wextra>") > Ah, that's it. Never occurred to me to quote the whole thing, thinking that would turn the generator expression into a literal string and not be interpreted.

Re: [CMake] Spaces in conditional output of generator expressions

2018-06-03 Thread Neil Carlson
wrote: > Did you try with $ rather than the ; character? > > Le dim. 3 juin 2018 à 06:24, Craig Scott a > écrit : > >> On Sun, Jun 3, 2018 at 12:34 PM, Neil Carlson >> wrote: >> >>> On Sat, Jun 2, 2018 at 4:53 PM Stephen McDowell >>> wrote: &g

Re: [CMake] Spaces in conditional output of generator expressions

2018-06-02 Thread Neil Carlson
On Sat, Jun 2, 2018 at 4:53 PM Stephen McDowell wrote: > It should be a CMake list, which is delineated by semicolons. > > add_compile_options($<$-Wall;-Wextra>) > > I am writing this from a phone so untested, but that has worked for me in > the past. > Right about the list, and is one of the th

[CMake] Spaces in conditional output of generator expressions

2018-06-02 Thread Neil Carlson
I'm attempting to use a generator expression to conditionally add compile options. No problem if it is a single option, but I can't figure out how to manage multiple options (in a single command). For example, this works: add_compile_options($<$-Wall>) As does this: add_compile_options(-Wall -Wex

Re: [CMake] Defining dependent compile and run tests using CMake/CTest

2017-11-26 Thread Neil Carlson
On Sun, Nov 26, 2017 at 12:42 PM, Craig Scott wrote: > Please post your CMakeLists.txt so we can see how you've got the fixtures > and tests defined. > Here's what I've got (I put the run test first to verify that the reordering takes place): add_test(NAME intel-20171126-run COMMAND intel-20171

[CMake] Defining dependent compile and run tests using CMake/CTest

2017-11-26 Thread Neil Carlson
I have a test code (think compiler regression test) that want to compile as a test, and if it compiles and links successfully, to go on to run as a subsequent test. I found a thread from Sept that pointed to a method used in boost-cmake for the first compile test. It moves execution of the compil

[CMake] dependencies between external projects (not DEPENDS)

2016-08-15 Thread Neil Carlson
I'm struggling with how to handle dependencies between external projects in a superbuild. The issue is different than simply ensuring that one gets built before another using the DEPENDS keyword -- that's trivial. Suppose I have two external libraries A and B, where B depends on A. It is not alw

[CMake] Bad option -fPIE for NAG Fortran compiler

2016-08-07 Thread Neil Carlson
I'm updating an older cmake configuration system, and tried using CMAKE_POSITION_INDEPENDENT_CODE. While it mostly does the right thing, I found that the flag -fPIE was being used for a source file that gets compiled into an executable. The NAG Fortran compiler doesn't recognize this flag and exi

[CMake] Proper way to redefine build type compiler options

2016-03-19 Thread Neil Carlson
What is considered best practice for (re)defining build-type compiler options for a project, especially one that may find itself as a subproject of something larger? To be concrete, say for Debug I want the project to use a set of warn/check options. Should I set (or add to) CMAKE_C_FLAGS_DEBUG,

[CMake] Link library file name with version suffix

2016-02-26 Thread Neil Carlson
cmake is generating a library link line that looks like: /.../nagfor -PIC -Wl,-shared -Wl,-Xlinker,-soname,-Xlinker,libnetcdff.so.6 -o libnetcdff.so.6.1.1 [...] /.../libnetcdf.so.11.0.0 /.../libhdf5_hl.so ... My issue is with the "11.0.0" suffix on the libnetcdf.so library. This particular c

[CMake] Alternative to configure_file

2015-04-17 Thread Neil Carlson
I'm working within a very large project on a python script. The script gets passed through configure_file to replace some @VAR@ strings with some file paths that are defined when cmake is run; this generates the final script. The side effect is that whenever I modify the file and run make, it re-

[CMake] ExternalProject_Add: directing cmake to a different

2015-02-07 Thread Neil Carlson
I'm trying to get ExternalProject_Add to build a TPL that doesn't have a CMakeLists.txt file in the top-level directory. The TPL untars as foo/{A,B} where A and B each contain a CMakeLists.txt file and are independent of each other. I only want to build "A" and would like to have cmake run with "

[CMake] Running a Find module only once

2013-11-27 Thread Neil Carlson
I've created a "find" module for a library (following the example for zlib) which I use in a standalone project. A second project has it as a subdirectory, but the second project also uses the same find module for its own purposes. I'm confused about how to best ensure that the "find" doesn't get

Re: [CMake] Spurious test failure in CMakeTestFortranCompiler

2013-07-01 Thread Neil Carlson
.g.) that ought to be used for the latter category of flags which get appended automatically to the flags from CMAKE_Fortran_FLAGS when compiling actual project code? (I'm still very new to cmake) -Neil On Mon, Jul 1, 2013 at 9:20 AM, Brad King wrote: > On 6/30/2013 11:10 PM, Neil

[CMake] Spurious test failure in CMakeTestFortranCompiler

2013-06-30 Thread Neil Carlson
I've run into a problem with CMakeTestFortranCompiler reporting that the Fortran compiler does not support Fortran 90, when in fact it does. I've set CMake_Fortran_FLAGS at the outset to include the "-u" flag which has the effect of making "implicit none" the default (this is the NAG compiler, but

Re: [CMake] How to install Fortran module files?

2013-05-14 Thread Neil Carlson
On Sun, May 12, 2013 at 9:22 AM, Zaak Beekman wrote: > I'm curious why you want to install the .mod files. As far as I know, I > don't think you need these at run time, but I could be wrong. (I know this > to be true at least for statically linked binaries.) > When application code that use the

Re: [CMake] How to install Fortran module files?

2013-05-14 Thread Neil Carlson
On Fri, May 10, 2013 at 4:01 PM, Yngve Inntjore Levinsen < yngve.levin...@gmail.com> wrote: > If you set the CMAKE_Fortran_MODULE_DIRECTORY variable, then all module > files by default will be built into this folder. In our case we set this to > ${CMAKE_BINARY_DIR}/fortran. Since nothing else is

[CMake] How to install Fortran module files?

2013-05-10 Thread Neil Carlson
I'm trying to figure out how to install the module (.mod) files that are generated by the Fortran compiler. I've only found one thread on the topic from 3 years ago. The solution there was to find the appropriate directory in the build tree where these files were created and scarf up everything t

Re: [CMake] Bad flags being passed to NAG Fortran compiler

2013-02-18 Thread Neil Carlson
Thanks Petr, the ID variable was exactly what I needed. On Mon, Feb 18, 2013 at 1:24 AM, Alan W. Irwin wrote: > I would also try setting > > set(CMAKE_Fortran_COMPILE_**OPTIONS_PIC "-PIC") > > in Modules/Compiler/NAG-Fortran.**cmake as well to see if that > completely satisfies your needs. > I s

[CMake] Bad flags being passed to NAG Fortran compiler

2013-02-17 Thread Neil Carlson
When building a shared library using the NAG Fortran compiler, cmake is invoking the compiler with the "-fPIC" option. This is wrong. The correct option is "-PIC". I've found I can get things to work if I add the following two lines to my CMakeLists.txt file (probably not the right way to fix thi