Re: [CMake] Use GLOB to generate filelist for install package

2016-08-11 Thread CHEVRIER, Marc
Remove the quotes around the variable MY_INCLUDES_H in the INSTALL command because this is a list. Using quotes, you pass it as a single string. On 11/08/16 11:03, "CMake on behalf of Patrik Lehmann" wrote: Hello, I try to use GLOB to collect the files for my install package, but

Re: [CMake] add_compile_options query

2016-08-12 Thread CHEVRIER, Marc
Specify flags as strings rather than lists (i.e. add quotes): add_compile_options("--param l1-cache-size=24") add_compile_options("--param l1-cache-line-size=64") add_compile_options("--param l2-cache-size=512") On 12/08/16 11:08, "CMake on behalf of Alex Biddulph" wrote:

Re: [CMake] setting environment variable for ctest

2017-05-05 Thread CHEVRIER, Marc
Use the ENVIRONMENT property of your tests (see https://cmake.org/cmake/help/v3.7/prop_test/ENVIRONMENT.html). On 05/05/2017, 16:29, "CMake on behalf of Juan E. Sanchez" wrote: Hello, It appears that when I invoke ctest through cmake, the environment variables I export from m

Re: [CMake] Adding compile and build type tests to CMake/CTest

2017-09-07 Thread CHEVRIER, Marc
Rather than building a STATIC library, you can build an OBJECT library. In this case only compilation step is done. On 07/09/2017, 08:59, "CMake on behalf of Edward Diener" wrote: On 9/6/2017 11:39 PM, P F via CMake wrote: > The `add_test` function can run whatever command you want it

Re: [CMake] Adding compile and build type tests to CMake/CTest

2017-09-07 Thread CHEVRIER, Marc
Yes, exactly. I think so… On 07/09/2017, 16:04, "CMake on behalf of Edward Diener" wrote: On 9/7/2017 3:32 AM, CHEVRIER, Marc wrote: > Rather than building a STATIC library, you can build an OBJECT library. In this case only compilation step is done. So your ar

Re: [CMake] find_library not finding libraries - why?

2017-11-09 Thread CHEVRIER, Marc
The problem is on NAMES argument. You have to specify library names without prefix. So Clp must be used rather than libClp. FIND_LIBRARY(CLP_LIBRARY NAMES Clp PATHS ${CLP_LIB} NO_DEFAULT_PATH) From: CMake on behalf of "corne...@bockemuehl.ch" Date: Thursday 9 November 2017 at 00:0

Re: [CMake] How to force use of Windows 64bit link.exe?

2017-11-09 Thread CHEVRIER, Marc
For that purpose, set the environment variable PreferredToolArchitecture with value x64. On 08/11/2017 23:26, "CMake on behalf of Paul Smith" wrote: Hi all. I wonder if someone can help me get CMake to force Visual Studio to run the 64bit linker instead of the 32bit linker. By that I

Re: [CMake] Finding package for 7-zip comprehension

2017-11-21 Thread CHEVRIER, Marc
“cmake –E tar” supports 7-zip format. Use option –format=7zip (see https://cmake.org/cmake/help/v3.9/manual/cmake.1.html). On 21/11/2017 16:43, "CMake on behalf of Konstantin Tokarev" wrote: 21.11.2017, 18:38, "Michael Powell" : > Hello, > > Does anyone happen to kno

Re: [CMake] Using SET_TARGET_PROPERTIES and IMPORTED_LINK_INTERFACE_LIBRARIES

2017-12-14 Thread CHEVRIER, Marc
I think you can fill a bug about erroneous behaviour when a list is specified with command set_target_properties for property IMPORTED_LINK_INTERFACE_LIBRARIES. Another way to specify the property is to use command set_property which supports multiple values for a property: set_property(TARGET

Re: [CMake] Using SET_TARGET_PROPERTIES and IMPORTED_LINK_INTERFACE_LIBRARIES

2017-12-18 Thread CHEVRIER, Marc
ork as well. From: Saad Khattak Date: Saturday 16 December 2017 at 00:39 To: "CHEVRIER, Marc" Cc: Craig Scott , Cmake Mailing List Subject: Re: [CMake] Using SET_TARGET_PROPERTIES and IMPORTED_LINK_INTERFACE_LIBRARIES Thank you Marc. I found that the following also works: target_lin

Re: [CMake] configure_file: escaping (single) quotes

2018-01-09 Thread CHEVRIER, Marc
The problem comes from CMake evaluating variable VAR (i.e. expression ${VAR…}) and detect wrong syntax. The solution is to specify option @ONLY to command configure_file to avoid ${} evaluation. From: CMake on behalf of Franck Houssen Date: Tuesday 9 January 2018 at 10:24 To: CMake Mail List

Re: [CMake] configure_file: escaping (single) quotes

2018-01-09 Thread CHEVRIER, Marc
Yes, you have to rewrite your line as: CMD="mpirun -n @MPIEXEC_PREFLAGS@ @MPIEXEC_NUMPROC_FLAG@ @MPIEXEC_MAX_NUMPROCS@ @MPIEXEC_POSTFLAGS@" From: Franck Houssen Date: Tuesday 9 January 2018 at 11:23 To: "CHEVRIER, Marc" Cc: CMake Mail List Subject: Re: [CMake] conf

Re: [CMake] Get find_package to choose INSTALLed libraries instead of libraries in the build folder

2018-01-11 Thread CHEVRIER, Marc
Hi, During install step, installed libraries and executables are relinked to generate binaries without absolute paths so installed artifacts are independent from your build tree. During build step, build binaries are used as well as absolute paths so produced binaries can be used during build

Re: [CMake] Source file property INCLUDE_DIRECTORIES

2018-01-12 Thread CHEVRIER, Marc
Because this property is not yet supported for source files (see #17507). FYI, I worked on this support and the merge request is under process… (see !1596). From: CMake on behalf of

Re: [CMake] Source file property INCLUDE_DIRECTORIES

2018-01-12 Thread CHEVRIER, Marc
Sure. APPEND keyword is handled at a high level (i.e. regardless the property evolved). From: J Decker Date: Friday 12 January 2018 at 15:03 To: "CHEVRIER, Marc" Cc: CMake Mail List Subject: Re: [CMake] Source file property INCLUDE_DIRECTORIES On Fri, Jan 12, 2018 at 5:26 AM

Re: [CMake] How to add files to Visual Studio 'Utility' project

2018-02-02 Thread CHEVRIER, Marc
This approach is not possible for Java because the command add_jar is implemented using commands add_custom_command and add_custom_target. And command target_sources implies that the target was created by one the commands add_library or add_executable. From: CMake on behalf of "J. Caleb Wherr

Re: [CMake] MSYS2 broken CMAKE_PREFIX_PATH

2018-02-12 Thread CHEVRIER, Marc
Be aware that MSYS2 environment is a "dual" environment: * Unix like environment. Executables are in /usr/bin * Windows like (i.e. understand windows paths but with slashes rather than back-slashes). Executables are in / mingw(64|32)/bin. So, if you want a pure unix like usage, you have to instal

Re: [CMake] find_package() for static only / shared only

2018-03-22 Thread CHEVRIER, Marc
Another possibility is to customize the variable CMAKE_FIND_LIBRARY_SUFFIXES. For example, on linux: * shared only: set (CMAKE_FIND_LIBRARY_SUFFIXES ".so") * static only: set (CMAKE_FIND_LIBRARY_SUFFIXES ".a") On Windows, it is more problematic because static and "import" shared libraries have sa

Re: [CMake] find_package() for static only / shared only

2018-03-22 Thread CHEVRIER, Marc
atic library. Is there a good solution for MSVC too? All the best, Mario On 22.03.2018 09:41, CHEVRIER, Marc wrote: > Another possibility is to customize the variable CMAKE_FIND_LIBRARY_SUFFIXES. > For example, on

Re: [CMake] Generator expression for "is in list"?

2018-04-09 Thread CHEVRIER, Marc
Operator IN_LIST in generator expressions will be available in CMake version 3.12, (i.e. the next version). In the meantime, I am afraid there is no solution in the context of generator expressions. However, you can directly use the contents of the property in your CMakeLists.txt. Example: get_p

Re: [CMake] find_package and get_target_property

2018-04-13 Thread CHEVRIER, Marc
The creation of “imported” target is the responsibility of the package. May be the package “LibA” does not create a such target. In this case, you have to rely on variables (like LibA_LIBRARIES and so on…). The documentation of the package, if any, generally describe how to use the package. Fr

Re: [CMake] find_package and get_target_property

2018-04-13 Thread CHEVRIER, Marc
Using ‘install(EXPORT …)’ you can generate required files to manage imported targets BUT building and exporting targets must be done in a different build environment from the one which imports the targets. From: Saad Khattak Date: Friday 13 April 2018 at 15:02 To: "CHEVRIER, Marc"

Re: [CMake] Generator expressions containing spaces

2018-04-23 Thread CHEVRIER, Marc
The space is used to separate arguments passed to COMMAND. So your generator expression is splitted before evaluation and elements are no longer valid generator expression. So, to solve your problem, encapsulate the generator expression inside quotes. And apply the following advices for correct

Re: [CMake] swig module add -fPIC flag

2018-04-25 Thread CHEVRIER, Marc
swig modules created with command SWIG_ADD_LIBRARY are "standard" CMake targets so, same approach apply. >From convenience, you can use command SWIG_LINK_LIBRARIES (same semantic as >TARGET_LINK_LIBRARIES) to manage custom link flags. Now, regarding specifically flag -fPIC you can manage more

Re: [CMake] [cmake-developers] Identify used source files

2015-04-28 Thread CHEVRIER, Marc
May be more clean and efficient to use CMake property SOURCES: For example: add_library (MY_LIB src1.cpp src2.cpp) get_target_property (lib_sources MY_LIB SOURCES) And variable lib_sources now contains list of sources associated with target. On 28/04/15 10:30, "Roman Wüger" wrote: >If som

[CMake] Alias of imported target

2015-05-05 Thread CHEVRIER, Marc
Hi, Currently it is not possible to create an alias target for an imported target (I.e. add_library with ALIAS keyword). But I don’t understand what is the technical constraint or semantic reason behind this limitation. If anybody can explain this limitation, it will be nice. -- Powered by

Re: [CMake] Alias of imported target

2015-05-05 Thread CHEVRIER, Marc
far, less elegant and coherent with target handling. On 05/05/15 19:01, "Stephen Kelly" wrote: >CHEVRIER, Marc wrote: > >> >> Hi, >> >> Currently it is not possible to create an alias target for an imported >> target (I.e. add_library with ALIAS k

Re: [CMake] How URL_MD5 is computed in ExternalProject_Add?

2015-05-19 Thread CHEVRIER, Marc
You can use FILE (MD5 ) command to compute MD5 value. From: CMake on behalf of Cedric Doucet Date: Tuesday 19 May 2015 13:14 To: "cmake@cmake.org" Subject: Re: [CMake] How URL_MD5 is computed in ExternalProject_Add? I managed to obtain the same MD5 code by running the m

Re: [CMake] Setting install dir based on Debug or Release

2015-05-20 Thread CHEVRIER, Marc
Multi-configurations is a bit complex to handle regarding install directories but it is doable. Here is my solution: 1. Handle various possibilities (multi-configs or mono-config). In case of multi-config, you have to rely on variable CMAKE_CFG_INTDIR which be contains information enabling

Re: [CMake] Prefix header for Makefiles

2015-08-26 Thread CHEVRIER, Marc
Hi, You are wrong. CMake, during configuration/generation phase generates dependencies over C/C++ files. So, the simple approach to handle dependency between Cpp and h files is to let CMake handle it: add_executable (my_exe Main.cpp) And, that it! By default current source directory is passed

Re: [CMake] Patch on Windows?

2015-09-01 Thread CHEVRIER, Marc
FYI, the latest version (2.5.1) of git for Windows (available https://github.com/git-for-windows/git/releases and http://git-scm.com/) includes again the patch tool. Marc From: CMake on behalf of "Macumber, Daniel" Date: Tuesday 1 September 2015 17:51 To: "cmake@cmake.org

Re: [CMake] CMAKE_CXX_COMPILE_OBJECT not set with ADD_SUBDIRECTORY

2015-09-11 Thread CHEVRIER, Marc
PROJECT instruction MUST BE the first one after CMAKE_MINIMUM_REQUIRED: -- lib CMakeLists.txt { CMAKE_MINIMUM_REQUIRED (VERSION 2.8.8) PROJECT(lib) ADD_SUBDIRECTORY(libtest) } From: CMake on behalf of Emmanuel HOUITTE Date: Friday 11 September 2015 15:26 To: "cmake@cmake.org

[CMake] How to check if test exists

2015-10-06 Thread CHEVRIER, Marc
Hi, What is the best way to check if a test is already defined using function add_test? My initial though was that if() can be used for that purpose but, unfortunately, if (TEST ) is not supported for now. Thanks. Marc -- Powered by www.kitware.com Please keep messages on-topic and check

Re: [CMake] How to link archives (.a) into shared object (.so) with cmake ?

2015-11-17 Thread CHEVRIER, Marc
Hi, Shared libraries required position independent code (PIC) for objects. By default, in CMake, static libraries objects are not compiled with this mode… So your problem. The easiest solution is to add this line to your CMakeLists.txt file: Set (CMAKE_POSITION_INDEPENDENT_CODE ON) Marc On

Re: [CMake] How to link archives (.a) into shared object (.so) with cmake ?

2015-11-17 Thread CHEVRIER, Marc
that does not work !... But indeed, for me, it should >have ?!... > >Franck > >Le 2015-11-17 12:34, CHEVRIER, Marc a écrit : >> Hi, >> >> Shared libraries required position independent code (PIC) for >> objects. >> By default, in CMake, static lib

Re: [CMake] How to generate for Ninja + MSVC?

2015-12-02 Thread CHEVRIER, Marc
Alternate solution is to define following environment variables: * CC=cl.exe * CXX=cl.exe In this case, CMake will search these compilers rather than the standard choices (starting with c++ and g++ for C++ language). And you don’t have any longer constraints about your environment. Marc On

Re: [CMake] CMake and a simple java example

2015-12-07 Thread CHEVRIER, Marc
Hi, You didn’t specify nothing in variable JAVA_SOURCE_DIRECTORY, so java source path is effectively /HelloWorld.java. By the way, you can specify relative paths to the CMakeLists.txt directory for java sources, so: set(JAVA_SOURCE_FILES HelloWorld.java) add_jar(${JAR_NAME} ${JAVA_SOURCE_FILES

Re: [CMake] ExternalProject_Add and inheritance

2015-12-10 Thread CHEVRIER, Marc
With CMake, you can control compilation and link flags with the following environment variables: * CC: specify C compiler * CFLAGS: C compiler flags * CXX: specify C++ compiler * CXXFLAGS: C++ compiler flags * LDFLAGS: linker flags And to finish you can overload make command

Re: [CMake] ExternalProject_Add and inheritance

2015-12-15 Thread CHEVRIER, Marc
The problem is not a CMake one but a runtime environment one. You built an executable with a specific environment (GCC 5) but try to execute it in a different environment (default platform): When an executable is built, system libraries paths are not stored as part of the executable so without s

Re: [CMake] test endian ness

2016-01-13 Thread CHEVRIER, Marc
Hi, May be to include the module before using it: include (TestBigEndian) On 13/01/16 15:25, "CMake on behalf of Vania Joloboff" wrote: >Hi > >I am familiar with autoconf and trying to migrate our project to cmake. >Thus newbie. I am running cmake 3.2.2 on Linux Mint 17 > >I have seen in t

Re: [CMake] find_library

2016-01-14 Thread CHEVRIER, Marc
Defining a variable using -D option does not put this one in the environment (i.e. system environment) so using ENV will fails... On 14/01/16 10:28, "CMake on behalf of Vania Joloboff" wrote: >I am running cmake 3.2.2 on Linux 64 bits > >I run cmake with > > cmake -G "Unix Makefiles" -DSYST

Re: [CMake] Adding definitions to compile one file ?

2016-01-21 Thread CHEVRIER, Marc
Use APPEND keyword: set_property( SOURCE source.cpp APPEND PROPERTY COMPILE_DEFINITIONS VAR1=${MY_VAR1} VAR2=${MY_VAR2} ) On 21/01/16 15:26, "CMake on behalf of Vania Joloboff" wrote: >HI Petr > >Thanks for the suggestion. >But this will erase the existing compile definitions, won't

Re: [CMake] string regexp replace removes the semicolons

2016-01-22 Thread CHEVRIER, Marc
Hi, Command file(GLOB) returns a CMake list (in a CMake list, items are separated by ;) Now you pass to command string the content of the list, so the list is expanded: in your example, string(REGEX REPLACE "foo.*cc" " " COMPILE_ONLY ${ALL_SOURCES}) Is equivalent to: string(REGEX REPLACE "foo.

Re: [CMake] Build from Source on Solaris

2016-03-02 Thread CHEVRIER, Marc
Hi, Some help can be found in this thread: http://public.kitware.com/pipermail/cmake-developers/2015-September/026550.html Marc From: CMake mailto:cmake-boun...@cmake.org>> on behalf of Matthew Gidden mailto:matthew.gid...@gmail.com>> Date: Wednesday 2 March 2016 at 09:44 To: "cmake@cmake.org<

Re: [CMake] Build from Source on Solaris

2016-03-02 Thread CHEVRIER, Marc
mpilers/CC-gcc/include/c++/4.8.2/cmath", line 562: Error: std::fpclassify(float) already had a body defined. ``` Cheers, Matt On Wed, Mar 2, 2016 at 9:54 AM, CHEVRIER, Marc mailto:marc.chevr...@sap.com>> wrote: Hi, Some help can be found in this thread: http://public.kitware.com

[CMake] CTest usage

2016-03-08 Thread CHEVRIER, Marc
Hi, Is there someone able to help me regarding ctest usage with labels? Here is the problem: I have various tests which have labels attached to them: set_property (TEST test1 PROPERTY LABELS LABEL1) set_property (TEST test2 PROPERTY LABELS LABEL1 LABEL2) set_property (TEST test3 PROPERTY LABELS

Re: [CMake] File names with unbalanced square brackets

2016-03-19 Thread CHEVRIER, Marc
I think you can resolve your problem with the following syntax for foreach command: Foreach (FILE IN LISTS FILES) In this case the list is not expanded in your source so square brackets is no longer interpreted… From: CMake mailto:cmake-boun...@cmake.org>> on behalf of Petr Kmoch mailto:petr.

Re: [CMake] project command not working, when used via macro (from an included file)

2016-04-27 Thread CHEVRIER, Marc
May be using keyword NO_POLICY_SCOPE in include command will solve your problem… From: CMake mailto:cmake-boun...@cmake.org>> on behalf of Chuck Atkins mailto:chuck.atk...@kitware.com>> Date: Tuesday 26 April 2016 at 20:04 To: aj neu mailto:ajn...@gmail.com>> Cc: "cmake@cmake.org