Re: [CMake] Fwd: set_target_properties and language specific COMPILE_FLAGS

2014-08-04 Thread Nicolas Bock
Hi Chuck, seems a bit hackish, but works for me :) Thanks for the trick! nick On Fri, Aug 1, 2014 at 12:37 PM, Chuck Atkins chuck.atk...@kitware.com wrote: Hi Nick, You could split your target in to two object libraries that combine into a singe real library: add_library(foo_f OBJECT

Re: [CMake] Fwd: set_target_properties and language specific COMPILE_FLAGS

2014-08-04 Thread Nicolas Bock
Hi Chuck, I am building both static and shared libraries using the object files. After splitting the Fortran and C source as you suggest, I get the following linker error: /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/../../../../x86_64-pc-linux-gnu/bin/ld:

Re: [CMake] Fwd: set_target_properties and language specific COMPILE_FLAGS

2014-08-04 Thread Nicolas Bock
The solution is to add the POSITION_INDENPENDENT_CODE target property to the C and Fortran convenience library targets. Thanks again for the help, nick On Mon, Aug 4, 2014 at 3:35 PM, Nicolas Bock nicolasb...@gmail.com wrote: Hi Chuck, I am building both static and shared libraries using the

[CMake] Fwd: set_target_properties and language specific COMPILE_FLAGS

2014-08-01 Thread Nicolas Bock
Hi, I am building a library containing Fortran and C sources. I would like to add language specific compile flags without affecting the global compile flags: set_target_properties( foo PROPERTIES C_FLAGS -fopenmp Fortran_FLAGS -openmp ) However, it seems there is only COMPILE_FLAGS which

Re: [CMake] Fwd: set_target_properties and language specific COMPILE_FLAGS

2014-08-01 Thread Chuck Atkins
Hi Nick, You could split your target in to two object libraries that combine into a singe real library: add_library(foo_f OBJECT ${FOO_F_SOURCES}) # set necessary compile flags specific to the Fortran components # on the foo_f target add_library(foo_c OBJECT ${FOO_C_SOURCES}) # set necessary