Re: [CMake] ExternalProject git clone hangs on windows

2015-08-17 Thread Petr Kmoch
Hi Avi. On Sat, Aug 15, 2015 at 1:54 AM, Tevet, Avi A avi.a.te...@intel.com wrote: Hi all, [...] I don’t know if this is related, but when I look inside the generated VS projects for the dependencies, I see the “CMake Rules” directory full of *.rule files, but they are all effectively

Re: [CMake] Possible to dynamically construct macro/function names to invoke?

2015-08-10 Thread Petr Kmoch
Hi, Eric. On Mon, Jul 20, 2015 at 12:52 AM, Eric Wing ewmail...@gmail.com wrote: I would like to dynamically construct a macro or function name to invoke. I basically have a core CMake system I want users to be able to extend/plug stuff into without knowing about a lot of the core CMake

Re: [CMake] config-specific compiler definitions don't work properly

2015-07-17 Thread Petr Kmoch
Hi. Looking at the documentation ( http://www.cmake.org/cmake/help/v3.3/manual/cmake-properties.7.html#properties-on-directories , http://www.cmake.org/cmake/help/v3.3/manual/cmake-properties.7.html#properties-on-targets ), you will find that neither the directory property nor the target property

Re: [CMake] Finding internal libraries

2015-07-13 Thread Petr Kmoch
Hi John. I have no first-hand experience with it, but I believe the ExternalProject module could be just what you're looking for ( http://www.cmake.org/cmake/help/v3.2/module/ExternalProject.html ). It allows you to configure and build several projects at build time under a CMake superbuild

Re: [cmake-developers] Wrapping functions in CMake

2015-07-13 Thread Petr Kmoch
On Thu, Jul 9, 2015 at 7:35 PM, Clifford Yapp cliffy...@gmail.com wrote: [...] 2. Second we maintain global lists of all exec, library, and custom targets. This allows us to run timestamping build targets that run at the very beginning and very end of the build process, by setting up

Re: [CMake] cmake: Duplicate file name conflict

2015-07-08 Thread Petr Kmoch
and sameName.cpp of the library is different from those of the application it doesn't build. However, it would be confusing to name them differently since their job is the same. Thanks in advance, Jan On Wed, Jul 8, 2015 at 9:03 AM Petr Kmoch petr.km...@gmail.com wrote: Hi Jan

Re: [CMake] cmake: Duplicate file name conflict

2015-07-08 Thread Petr Kmoch
Hi Jan, it'simpossible to answer such questions without seeing your setup. Can you post your CMakeList and your directory structure? Petr On Tue, Jul 7, 2015 at 6:36 PM, Jan Steinke jan.stei...@gmail.com wrote: Dear all, I came across a problem, for me it seems that cmake does not allow

Re: [cmake-developers] C# support?

2015-06-30 Thread Petr Kmoch
On Tue, Jun 30, 2015 at 9:21 AM, Stuermer, Michael SP/HZA-ZSEP michael.stuer...@schaeffler.com wrote: [...] About the language: Would it be ok to name the language in CMake CS instead of CSharp? I did everything as CS so far... If I may provide an outsider's comment on this point, I

Re: [CMake] Recursively include target include directories only

2015-06-18 Thread Petr Kmoch
On Thu, Jun 18, 2015 at 1:43 AM, Robert Dailey rcdailey.li...@gmail.com wrote: On Wed, Jun 17, 2015 at 4:31 PM, Dan Liew d...@su-root.co.uk wrote: On 17 June 2015 at 12:28, Robert Dailey rcdailey.li...@gmail.com wrote: Is there a way to only take (recursively) the include directiories from

Re: [CMake] How do I set an Xcode property on the global/root project?

2015-06-15 Thread Petr Kmoch
On Sun, Jun 14, 2015 at 10:21 PM, Eric Wing ewmail...@gmail.com wrote: On 6/14/15, Gregor Jasny gja...@googlemail.com wrote: Hi Eric, On 14/06/15 14:38, Eric Wing wrote: I have been successful at setting Xcode properties on specific targets with CMake via: set_property (TARGET

[cmake-developers] Issue #14894 fixed version

2015-06-11 Thread Petr Kmoch
Hi all, we've been hit by #14894 (http://public.kitware.com/Bug/view.php?id=14894) in our project when using CMake 3.0.2. According to Mantis, it's fixed in 3.0, but neither tag v3.0.0 nor v3.0.2 seem to contain the fix. v3.1.0 does contain it. Would it be possible to update the Fixed in version

Re: [CMake] How to skip steps and use default values in ExternalProject_Add command?

2015-05-21 Thread Petr Kmoch
Hi Cedric. When doing things like that, remember that CMake's named arguments are arguments just like any other. So you can easily obtain them from variable expansion; something like this: if(${LIBRARY}_CONFIGURE_COMMAND) set(the_configure_command CONFIGURE_COMMAND

Re: [CMake] How to skip steps and use default values in ExternalProject_Add command?

2015-05-21 Thread Petr Kmoch
} ${the_configure_command} ) ExternalProject_Add(${${LIBRARY}_LOWERNAME} PREFIX ${${LIBRARY}_PREFIX} URL ${${LIBRARY}_URL} ) I guess the default value of CONFIGURE_COMMAND will be used, right? Cédric -- *De: *Petr Kmoch petr.km...@gmail.com *À: *Cedric Doucet

Re: [CMake] Unknown argument in FOREACH

2015-05-18 Thread Petr Kmoch
Hi Cedric. If you check the documentation of foreach() ( http://www.cmake.org/cmake/help/v3.2/command/foreach.html), you will see there is no IN item item... syntax. Either LISTS or ITEMS has to follow after IN, or IN must be omitted altogether. So either do this: foreach(LIBRARY IN LISTS

Re: [CMake] What is the correct way to manage a possibly user-defined directory?

2015-05-18 Thread Petr Kmoch
Hi Cedric. if(EXISTS) does not automatically dereference its argument. So your current code is testing for the existence of a directory literally named FOO_DIR. You want to dereference the variable: if(NOT EXISTS ${FOO_DIR}) Second, option() is intended for on/off options only (a checkbox).

Re: [CMake] Problem with multiple expressions with if()

2015-05-15 Thread Petr Kmoch
`if(${LINUX64})` will expand to `if()` if LINUX64 is either not defined, or holds an empty string. In both cases, it's a syntax error. If you want to check whether LINUX64 is set to a truthy value, either quote it, or don't dereference it: if((CMAKE_SYSTEM_NAME MATCHES SunOS) OR LINUX64) Note

Re: [CMake] CMAKE_CXX_COMPILER_VERSION quite a useful variable, right?

2015-05-14 Thread Petr Kmoch
Hi Niels. I can't comment on the useful variable list, but I'd just like to point out that the variable is not undocumented. It's listed normally in the variables for languages section ( http://www.cmake.org/cmake/help/v3.2/manual/cmake-variables.7.html#variables-for-languages) of the

Re: [CMake] Switching configuration to icc

2015-05-10 Thread Petr Kmoch
And you need to do with in a *totally clean* binary directory. The compiler cannot be changed once the buildsystem has been configured at least once. Simply delete the buildsystem and start over, with the proper CC (and CXX) environment variable(s). Petr On Sun, May 10, 2015 at 7:00 PM, Tom

Re: [CMake] cmp0026, file(GENERATE...), and configure_file

2015-04-23 Thread Petr Kmoch
I hope you don't mind an outsider chipping in with a potential 5th possibility: 5. parse the file to be configured to discover which variables will be necessary for the configuration, and save only *their* values. For any but the most insane configure_file() calls, that should be a tiny subset of

Re: [CMake] JOIN generator expression not working

2015-04-17 Thread Petr Kmoch
Hi Daniel. Your generator expression contains a space (between , and -I). Is it quoted? Generator expressions are just normal strings until generate time, and space normally separates CMake arguments. In other words, like this: target_compile_options(trgt

Re: [CMake] linking question

2015-04-16 Thread Petr Kmoch
Hi Bill. Probably the easiest way to set the interface properties to just what you need is to use the PUBLIC (which is the default), PRIVATE and INTERFACE keywords when specifying dependencies. In your case, you'd apply them like this: add_library(joe STATIC joe.c joe_a.c) add_library(fred

Re: [CMake] variable substitution for command arguments

2015-03-20 Thread Petr Kmoch
Hi. You're already (partially) doing it, with the CMAKE_SOURCE_DIR and Boost_INCLUDE_DIRS variables. You can store whatever list of arguments you want in a variable and expand it in the proper place. For example this: set(MyArgs -d sqlite --sqlite-override-null --std c++11 --profile boost

Re: [CMake] nonstandard C++ source filename extension

2015-03-17 Thread Petr Kmoch
Hi Dave. This looks like a message directly from your compiler. Does it work if you try to compile the file manually (no CMake)? Petr On Tue, Mar 17, 2015 at 5:10 AM, Dave Yost d...@yost.com wrote: From what I can glean online, I’ve tried this: set_source_files_properties(foo.bar

Re: [CMake] Inconsistency with INSTALL(TARGETS) destinations...

2015-03-11 Thread Petr Kmoch
Do you even *have* any LIBRARY targets on Windows? Quoting the docs ( http://www.cmake.org/cmake/help/v3.2/command/install.html#installing-targets ): Static libraries are always treated as ARCHIVE targets. Module libraries are always treated as LIBRARY targets. For non-DLL platforms shared

Re: [CMake] missing bin folder

2015-03-11 Thread Petr Kmoch
Hi Chiara, just a sanity check: have you actually run a build? Or is it that even the buildsystem (Makefiles, VS projects, what have you) is not there? Petr On Wed, Mar 11, 2015 at 8:35 AM, Domen Vrankar domen.vran...@gmail.com wrote: however I am facing a quite dramatic issue: after

Re: [CMake] control dependencies in cmake stage

2015-03-10 Thread Petr Kmoch
Hi Tomasz, the if() command also supports this operator: if(file1 IS_NEWER_THAN file2) Perhaps you could use this to make it work for you. Petr Per On Tue, Mar 10, 2015 at 7:05 AM, Mark Abraham mark.j.abra...@gmail.com wrote: Hi, What are you generating that must be done at cmake time?

Re: [CMake] Problem with different #include for precompiled Headers

2015-03-04 Thread Petr Kmoch
Hi Matthieu. This has nothing to do with CMake, it's a property of MSVC. The precompiled header must always be included in exactly the same way, no path changes. In other words, the name of the precompiled header as specified to /Yc and /Yu must match exactly. Pretty much the only sane way to do

Re: [CMake] Creating DLL from FORTRAN code

2015-02-25 Thread Petr Kmoch
Hi Doron, it would be helpful if you provided the error you're getting from add_library(), and also showed the exact CMake code you used. Petr On Wed, Feb 25, 2015 at 1:57 PM, Doron Klepach klepa...@gmail.com wrote: Hello there, I am new to CMake and I am trying to convert a project to work

Re: [CMake] Creating DLL from FORTRAN code

2015-02-25 Thread Petr Kmoch
}) SET_TARGET_PROPERTIES(micro_linMatl_I PROPERTIES LINKER_LANGUAGE Fortran) target_link_libraries (micro_linMatl_I ${EXTRA_LIBS}) and here is the one in the folder Modules add_library(Modules mod1.F90 mod2.F90 ...) Thank you for your help, Doron On Wed, Feb 25, 2015 at 3:07 PM, Petr Kmoch petr.km

Re: [CMake] Module CMakeParseArguments: confusing last paragraph in documentation

2015-02-24 Thread Petr Kmoch
My guess is there's a not missing between would and result in MY_INSTALL_DESTINATION set to Petr On Tue, Feb 24, 2015 at 12:05 PM, Marcel Loose lo...@astron.nl wrote: Hi all, Several times I've read the last paragraph of the documentation of module CMakeParseArguments, but I can't get my

Re: [CMake] Make add_custom_target depends on cmake macro/function

2015-02-23 Thread Petr Kmoch
You could have the custom target execute CMake in script mode: add_custom_target( dummy ALL COMMAND ${CMAKE_COMMAND} -P timescript.cmake ) The file timescript.cmake could look like this: string(TIMESTAMP curdate UTC) message(${curdate}) Feel free to play around with stdout/stderr

Re: [CMake] How to disable specific warnings in VS IDE

2015-02-22 Thread Petr Kmoch
Hi, Simply pass the appropriate compiler flags to the compiler. The flag in question is /wd1234 To disable warning C1234 (more info on MSDN: https://msdn.microsoft.com/en-us/library/thxezb7y%28v=vs.120%29.aspx ) How you pass them to the compiler depends on what you normally use. The options

Re: [CMake] install(files...

2015-02-18 Thread Petr Kmoch
Hi Micha, these parameters, which are common to several install() commands, are described in the initial section of the command's docs: http://www.cmake.org/cmake/help/v3.2/command/install.html#introduction Petr On Wed, Feb 18, 2015 at 8:46 AM, Micha Renner micha.ren...@t-online.de wrote:

Re: [CMake] ExternalProject_add and add_subdirectory in one step

2015-02-06 Thread Petr Kmoch
Hi Franz. The canonical approach to ExternalProject is to use a superbuild setup. Design your top-level CMakeList so that it *only* contains ExternalProject_add() calls, treating your original project as just another external project. Build the superbuild once, getting all the dependencies

Re: [CMake] Generated files?

2015-01-30 Thread Petr Kmoch
. That is, I want myprog to be compiled, and then all of the files processed by it with just one build command. I assume that's possible, but have not quite yet been able to make it happen. On Fri, Jan 30, 2015 at 9:11 AM, Petr Kmoch petr.km...@gmail.com wrote: As you say, **make** is fairly

Re: [CMake] Generated files?

2015-01-30 Thread Petr Kmoch
for is to automate the creation of the brute-force solution. -- Cheers, ..chris On Fri, Jan 30, 2015 at 4:32 AM, Petr Kmoch petr.km...@gmail.com wrote: It's not clear to me what you mean with run time. There are the following times involved in a CMake-based project: * Configure time

Re: [CMake] Generated files?

2015-01-30 Thread Petr Kmoch
It's not clear to me what you mean with run time. There are the following times involved in a CMake-based project: * Configure time: CMake is parsing CMakeLists.txt files and files included from those and executing ALL CMake commands found in them. Variables expansion takes place. Data structures

Re: [CMake] Generated files?

2015-01-29 Thread Petr Kmoch
Hi Chris. I believe a function should do the trick: function(ProcessFile inFile) get_filename_component(outFile ${inFile} NAME_WE) set(outFile ${outFile}.out) add_custom_command( OUTPUT ${outFile} COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/${inFile}

Re: [CMake] CTest + Catch Framework

2015-01-27 Thread Petr Kmoch
Hi all. I've run into this problem as well - I think first-class support for this in CTest would be a most useful feature. And I would like to nominate Boost.Test into the list of frameworks considered for support, if possible. Petr On Wed, Jan 28, 2015 at 1:38 AM, Robert Dailey

Re: [CMake] Bug in SLN generation

2015-01-06 Thread Petr Kmoch
be implemented. HTH, David C. On Tue, Jan 6, 2015 at 2:50 AM, Petr Kmoch petr.km...@gmail.com wrote: Hi Scott. To file a bug, use the Mantis tracker at http://public.kitware.com/Bug/ As for running custom processing post-generation, there is no way hook this, and a request

Re: [CMake] Bug in SLN generation

2015-01-05 Thread Petr Kmoch
Hi Scott. To file a bug, use the Mantis tracker at http://public.kitware.com/Bug/ As for running custom processing post-generation, there is no way hook this, and a request for it was explicitly declined: http://public.kitware.com/Bug/view.php?id=13020 Petr On Mon, Jan 5, 2015 at 8:53 PM,

Re: [CMake] CMP0043 policy warning

2014-12-11 Thread Petr Kmoch
Hi Scott. Policy state is changed by explicit calls to cmake_policy() and implicitly by calls to cmake_minimum_required(). So you need to set the policy to the setting you want whenever each of these occurs (or modify them so that they set the policy the way you want it). The documentation of

[CMake] Get native build command with CMake 3+

2014-12-05 Thread Petr Kmoch
Hi all. I'm converting a small Makefile-based project to CMake. The project is not mine, so I am trying to match its existing buildsystem as closely as possible. One of the rules in the original Makefile is (simplified) as follows: examples: all make -C example_dir all This gives a target

Re: [CMake] Get native build command with CMake 3+

2014-12-05 Thread Petr Kmoch
directory, and assumes you're in the top level build tree...) On Fri, Dec 5, 2014 at 5:46 AM, Petr Kmoch petr.km...@gmail.com wrote: Hi all. I'm converting a small Makefile-based project to CMake. The project is not mine, so I am trying to match its existing buildsystem as closely

Re: [CMake] Get native build command with CMake 3+

2014-12-05 Thread Petr Kmoch
solution, you may want to take a look at the external_project module. With kind regards, Micha Hergarden 2014-12-05 11:46 GMT+01:00 Petr Kmoch petr.km...@gmail.com: Hi all. I'm converting a small Makefile-based project to CMake. The project is not mine, so I am trying to match its existing

Re: [CMake] Get native build command with CMake 3+

2014-12-05 Thread Petr Kmoch
with dependencies. But thanks for your help. Petr On Fri, Dec 5, 2014 at 4:19 PM, David Cole dlrd...@aol.com wrote: No, I meant exactly what I said. --target takes a CMake target name. HTH, D On Fri, Dec 5, 2014 at 9:23 AM, Petr Kmoch petr.km...@gmail.com wrote: I assume you actually meant 'cmake

Re: [CMake] include problems

2014-12-03 Thread Petr Kmoch
Hi. The difference is that if there are any variables defined in something, they will be defined in the scope of the function in the second case, making them invisible outside of the function. If that is your problem, you could help this by turning the function into a macro (which has its own

Re: [CMake] Looking for a way to post-process Visual Studio projects generated by CMake

2014-11-24 Thread Petr Kmoch
Hi Parag. There is no way to hook arbitrary postprocessing, and as per http://public.kitware.com/Bug/view.php?id=13020 , that is by design. For your specific issue, CMake has some support for customising a .vc[x]proj using target properties like VS_KEYWORD or VS_GLOBAL_AnyVariableName. You can

Re: [CMake] L

2014-11-11 Thread Petr Kmoch
Hi all. I am not using OpenBLAS so this is really just a tangential comment, but I can understand that in a production setting, it can be easier to update a library than to update something as fundamental to the build process as CMake. To the point where the former is authorisable on a much lower

Re: [CMake] Calling of find_package from function

2014-11-07 Thread Petr Kmoch
Hi Andrey. As a workaround, you could make the calling context a macro instead of a function. Macros don't introduce variable scope. Petr On Fri, Nov 7, 2014 at 4:23 PM, Andrey Upadyshev oli...@gmail.com wrote: Hello! I'm writing a wrapper around find_package so I call find_package from my

Re: [CMake] Concatenating lists back to string

2014-10-23 Thread Petr Kmoch
Hi Domen. This is what helps me reason about it: A string with a ';' in it is a list. An unqouted ';' separates arguments to CMake commands. string(REPLACE ...) simply concatenates all of its 'input' parameters. So, when you expand ${list_1} in the last line, it will simply replace in the

Re: [CMake] INSTALL DIRECTORY patterns highly confusing

2014-10-16 Thread Petr Kmoch
Hi Dan. Single quotes have no special meaning in CMake syntax, so it was literally treating them as part of the pattern. This is not special to the install() command in any way, it's just how CMake works. Petr On Thu, Oct 16, 2014 at 4:13 AM, Dan Kegel d...@kegel.com wrote: This turned out

Re: [CMake] Quoting and Escapes

2014-10-10 Thread Petr Kmoch
Hi Christian. Were you perhaps looking for INCLUDE_DIRECTORIES(C:/Program Files (x86)/somepath) instead? Petr On Fri, Oct 10, 2014 at 12:07 PM, Nils Gladitz nilsglad...@gmail.com wrote: On 10/10/2014 11:48 AM, Dr. Christian Verbeek wrote: INCLUDE( C:/Program Files (x86)/somepath ) -

Re: [CMake] ninja generator and add_custom_target bug

2014-10-03 Thread Petr Kmoch
Hi Russell, you might want to add VERBATIM to the custom target, so that command-line arguments are escaped properly: ADD_CUSTOM_TARGET(uninstall COMMAND echo \nRemoving installed files: COMMAND cat ${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt | xargs rm -fv VERBATIM ) See the docs:

Re: [CMake] CMAKE_INSTALL_PREFIX problem

2014-09-24 Thread Petr Kmoch
Hi Jeremy. Does ${BUILD_BIN} perhaps start with a slash? If so, it would be interpreted as an absolute path, which of course ignores CMAKE_INSTALL_PREFIX. Petr On Wed, Sep 24, 2014 at 7:58 AM, Jeremy Ardley jeremy.ard...@gmail.com wrote: I am using cmake 2.8.9 on debian wheezy. I'm fairly

Re: [CMake] CMAKE_INSTALL_PREFIX problem

2014-09-24 Thread Petr Kmoch
? I need to discover more about value substitution :=( @somekey@ vs ${somekey} On 24/09/14 14:39, Petr Kmoch wrote: Hi Jeremy. Does ${BUILD_BIN} perhaps start with a slash? If so, it would be interpreted as an absolute path, which of course ignores CMAKE_INSTALL_PREFIX. Petr On Wed

Re: [CMake] how to force assign sequence in multi-thread in cmake

2014-09-16 Thread Petr Kmoch
Hi. I've never worked with ExternalProject myself, so I can't comment with certainty, but from what I understand, the correct way of using ExternalProject is to add your own project as an ExternalProject as well. Basically, the toplevel CMakeList becomes a superbuild which *only* does

Re: [CMake] Incorrect object file name on cmake compilation

2014-09-11 Thread Petr Kmoch
Hi Ravi. In what sense is the name incorrect? There is no correct/incorrect way to name object files in relation to the source file name; it can be arbitrary, as long as it's correctly passed on to the linker. I believe CMake chooses to append .obj to the whole file name if there is more than one

Re: [CMake] Incorrect object file name on cmake compilation

2014-09-11 Thread Petr Kmoch
I was wondering about this as well. Ravi, what is your motivation for having object file names of a particular format? I don't think I've ever had to care what object files in our builds are called. Petr On Thu, Sep 11, 2014 at 10:01 AM, Andreas Mohr a...@lisas.de wrote: Hi, Date: Thu, 11

Re: [CMake] Need to know the ASM flag that needs to be modified in cmake

2014-08-27 Thread Petr Kmoch
Hi Ravi, I've never used ASM_MASM (or any other language beside C, CXX and Fortran), but if it follows normal CMake language rules, the following variables should exist: CMAKE_ASM_MASM_FLAGS CMAKE_ASM_MASM_FLAGS_CONFIG (where CONFIG is a placeholder for uppercase configuration name). See the

Re: [CMake] Global dependency

2014-08-27 Thread Petr Kmoch
Hi Jonas. As a hacky solution, you could override add_library() and add_executable(), like this: function(add_library targetName) _add_library(${targetName} ${ARGN}) add_dependencies(${targetName} BuildInfoDateTime) endfunction() Petr On Wed, Aug 27, 2014 at 5:44 AM, Jonas Lippuner

Re: [CMake] compilation order dependencies,

2014-08-27 Thread Petr Kmoch
Hi Lukasz. I believe you could put `main.cpp` into an object library: add_library(foo ${foosources}) add_library(bar ${barsources}) add_library... ... ... add_library(main_sources OBJECT main.cpp) add_executable(foo_exe $TARGET_OBJECTS:main_sources) target_link_libraries(foo_exe foo bar ... ...

Re: [CMake] Fail target if buildtype is not RelWithDebInfo

2014-08-27 Thread Petr Kmoch
Hi Thomas, you should be able to make this work using the variable CMAKE_CFG_INTDIR: if (WIN32) add_custom_target(msi-installer COMMAND IF NOT ${CMAKE_CFG_INTDIR} == RELWITHDEBINFO (echo msi-installer only works for build type RELWITHDEBINFO exit 1) COMMAND ...) endif() Petr On

Re: [CMake] add_custom_command and CONFIG-dependent output

2014-08-25 Thread Petr Kmoch
On Mon, Aug 25, 2014 at 1:07 PM, David Cole via CMake cmake@cmake.org wrote: Ah, thanks... Though, I think there may be a general disconnect here: that is, it seems likely that one would want to construct output with a pattern composed from generator expressions. ... While I gather from

Re: [CMake] Using a custom preprocessor

2014-08-18 Thread Petr Kmoch
Hi Paul. The straightfroward way to do thisis with custom commands: add_custom_command( OUTPUT ${CMAKE_BINARY_DIR}/foo.f COMMAND custom_preproc foo.fs -o ${CMAKE_BINARY_DIR}/foo.f MAIN_DEPENDENCY foo.fs COMMENT Custom-preprocessing foo.fs VERBATIM ) add_executable(myexe

Re: [CMake] Resetting CMAKE_Fortran_FLAGS for a specific file

2014-08-13 Thread Petr Kmoch
Hi Marco. Sane compilers allow later command-line options to override earlier ones, so what you're doing should be fine. Unfortunately, I know some Fortran compilers are not sane in this regard. If you really need to solve this by explicitly modifying the global list for a particular file, the

Re: [CMake] Passing empty arguments to add_custom_command

2014-06-30 Thread Petr Kmoch
I think it should work if you put quotes around the expansion - otherwise, an empty variable expands to nothing, not to an empty string: *add_custom_command(* *OUTPUT ${some_files}* *COMMAND ${PYTHON_EXECUTABLE} test.py ${prefix} ${src} ${dst}* *DEPENDS ${... all deps ..}

Re: [CMake] How do I create a dependency to copy (touched) resource files when building an executable?

2014-06-30 Thread Petr Kmoch
Hi Eric. It seems to me that you're copying from source dir to binary dir, but all dependencies are on the source dir file only. Therefore, there is nothing to trigger the generation of the binary-dir file. Perhaps you wanted 'fooresources' to depend on the binary-dir file instead? Petr On

Re: [CMake] How do I create a dependency to copy (touched) resource files when building an executable?

2014-06-30 Thread Petr Kmoch
.) Thanks, Eric On 6/30/14, Petr Kmoch petr.km...@gmail.com wrote: Hi Eric. It seems to me that you're copying from source dir to binary dir, but all dependencies are on the source dir file only. Therefore, there is nothing to trigger the generation of the binary-dir file

Re: [CMake] Wanted: Interface link options

2014-06-13 Thread Petr Kmoch
Hi Andres. I cannot comment on the property request itself, but you should be able to work around its absence by using `-` instead of `/` to introduce the linker option - the Visual Studio tools understand both, AFAIK. Petr On Fri, Jun 13, 2014 at 1:42 PM, Anders Lindgren andl...@gmail.com

Re: [CMake] Delay Cache File Reading

2014-05-12 Thread Petr Kmoch
Hi Ryan. If the only thing you need delay-loaded in this are the target names, you should just get rid of the variables and use the target names directly. The decision whether an argument of `target_link_libraries()` is a target or a library path is done at generate time, when all CMakeLists have

Re: [CMake] Adding explicit dependencies to a target

2014-05-08 Thread Petr Kmoch
Hi Tarjei. add_custom_command() has a DEPENDS argument where you can list any number of files which will act as dependencies for the custom command. So you could extend your custom command like this: add_custom_command( OUTPUT ... #as before COMMAND ... #as before MAIN_DEPENDENCY a.idl

Re: [CMake] get_directory_property and get_property

2014-04-17 Thread Petr Kmoch
Hi James. Quoting the docs at http://www.cmake.org/cmake/help/v2.8.12/cmake.html: get_property(variable GLOBAL | DIRECTORY [dir]| ... DIRECTORY scope defaults to the current directory but another directory (already processed by CMake) may be

Re: [CMake] Index CMake strings

2014-03-13 Thread Petr Kmoch
Hi Micha, the CMake equivalent code would be: string(SUBSTRING ${Str} 3 1 c) Petr On Thu, Mar 13, 2014 at 10:27 AM, Micha Renner micha.ren...@t-online.dewrote: Hallo, is it possible to index CMake strings. In C it would something like this: char c = Str[3]; Micha -- Powered by

Re: [CMake] Dependencies

2014-02-05 Thread Petr Kmoch
Hi Phil. If your FOO.asm is used as a source file (i.e. it's listed in an add_executable() or add_library() command), then you can use the source file property OBJECT_DEPENDS for that: add_executable(myexe FOO.asm other.file one.more) set_property(SOURCE FOO.asm PROPERTY OBJECT_DEPENDS

Re: [CMake] How to manage dependencies between projects in Visual Studio

2014-02-05 Thread Petr Kmoch
Hi Luca. You could look into the CMake command include_external_msproject(), or into the ExternalProject module. Petr On Wed, Feb 5, 2014 at 12:19 PM, Luca Gherardi luca.ghera...@unibg.itwrote: I'm working with Visual Studio and I need to create the CMakeLists files for the following

Re: [CMake] How to manage dependencies between projects in Visual Studio

2014-02-05 Thread Petr Kmoch
in the solution, however when I try to build the solution VS returns the following error: The operation could not be completed. The parameter is incorrect No other information. Any idea? Thanks, Luca *From:* Petr Kmoch [mailto:petr.km...@gmail.com] *Sent:* mercoledì 5 febbraio

Re: [CMake] ctest dependencies

2014-02-03 Thread Petr Kmoch
Hi Tom. You might want to look into the DEPENDS property of tests. Petr On Sat, Feb 1, 2014 at 7:17 PM, Tom Browder tom.brow...@gmail.com wrote: I have a ctest test (say, TESTA) whose success I would like to have as a dependency for a lot of other tests (say, TESTB, etc.). Can I do

Re: [CMake] ctest dependencies

2014-02-03 Thread Petr Kmoch
Your tests B, C and D *depend on* test A. Therefore, you're (I believe) looking for this: set_test_properties(TESTB TESTC TESTD PROPERTY DEPENDS TESTA ) Petr On Mon, Feb 3, 2014 at 12:48 PM, Tom Browder tom.brow...@gmail.com wrote: On Mon, Feb 3, 2014 at 3:20 AM, Petr Kmoch petr.km

Re: [cmake-developers] add_custom_command changes, was [Introductions and questions]

2014-01-30 Thread Petr Kmoch
Hi. I am only a CMake user, not a developer, but I wholeheartedly support adding the CONFIG keyword to add_custom_*(). While variations in COMMAND can be handled by generator expressions, variations in OUTPUT can't (see e.g. bug 12877). Thus, adding the CONFIG keyword would kill two (very

Re: [CMake] How to tell an executable where to look for libraries it depends on

2014-01-23 Thread Petr Kmoch
Hi Lucas. There's no portable way to do that, simply because not all systems support something like this (e.g. Windows doesn't ). For Linux, you can look into the various options of handling RPATH (such as BUILD_WITH_INSTALL_RPATH, SKIP_BUILD_RPATH, INSTALL_RPATH etc.). Petr On Thu, Jan 23,

[CMake] List of places supporting generator expressions

2013-12-05 Thread Petr Kmoch
Hi all, I was trying to figure out whether the source file property COMPILE_DEFINITIONS supports generator expressions and I found no clear way how to do so (so I assume it does not, because genexes aren't mentioned in its docs). This got me thinking: is there a list somewhere of all contexts

Re: [CMake] Set executable for dll project in vs2010 with cmake

2013-11-25 Thread Petr Kmoch
Hi Elizabeta. Unfortunately, that is not possible (directly). The reason is that settings in the Debugging subtree of Configuration Properties are not stored in the project files (.vc[x]proj), but in host-and-machine-specific .user files, and CMake does not generate those (they are generated by

Re: [CMake] Select the Visual C++ Compiler November 2013 CTP with CMake generated projects?

2013-11-20 Thread Petr Kmoch
*From:* Petr Kmoch [mailto:petr.km...@gmail.com] *Sent:* Tuesday, November 19, 2013 9:28 AM *To:* Thompson, K T *Cc:* cmake@cmake.org *Subject:* Re: [CMake] Select the Visual C++ Compiler November 2013 CTP with CMake generated projects? Hi Kelly. This should be possible using CMake's

Re: [CMake] Select the Visual C++ Compiler November 2013 CTP with CMake generated projects?

2013-11-19 Thread Petr Kmoch
Hi Kelly. This should be possible using CMake's command-line option -T which specifies the toolset to use. Petr On Tue, Nov 19, 2013 at 4:41 PM, Thompson, K T k...@lanl.gov wrote: Hi, Is there a way to tell CMake to generate Visual Studio 2013 projects that use the November 2013 CTP

Re: [CMake] ctest - how to specify tests that must not run in parallel

2013-11-15 Thread Petr Kmoch
Hi. There is a test property RUN_SERIAL ( http://cmake.org/cmake/help/v2.8.12/cmake.html#prop_test:RUN_SERIAL) which prevents the test from running parallel with other tests; I believe that's what you're looking for. Petr On Fri, Nov 15, 2013 at 3:39 PM, Miller Henry

Re: [cmake-developers] CMakeParseArguments: Do not skip empty arguments

2013-11-06 Thread Petr Kmoch
Hi all. I hope I don't derail the conversation, but since there's now discussion of providing a new interface and perhaps behaviour-changing parameters for cmake_parse_arguments(), I'd like to mention another behaviour switch I would find useful. I maintain a CMake framework for a large

Re: [CMake] linkage order of static libraries and object files (ENABLE_EXPORTS)

2013-11-02 Thread Petr Kmoch
Hi Ivan. The correct use of OBJECT libraries is not to link against them, but to list them as sources (using a special syntax), like this: add_executable(project main.c $TARGET_OBJECTS:serial) (Assuming 'serial' is the name of the object library). This is outlined in the documentation for

Re: [CMake] Generating stand-alone Visual Studio projects?

2013-10-15 Thread Petr Kmoch
Hi Magnus. I am afraid that's not really possible (safely). CMake uses absolute paths all over the place (by design), so all output file paths etc. are hardcoded in the .sln and .vc[x]proj files to the paths applicable where they were generated. You can experiment with the variable

Re: [CMake] How to install files produced by custom targets

2013-09-06 Thread Petr Kmoch
Hi Lucas, you could look into install(CODE ...) or its escaping-hell-avoiding brother, install(SCRIPT ...). The code/script could then be something like execute_process(COMMAND make install ...) or perhaps even execute_process(COMMAND ${CMAKE_BUILD_TOOL} install ...). Petr On Fri, Sep 6, 2013

Re: [CMake] How to install files produced by custom targets

2013-09-06 Thread Petr Kmoch
lucas.sol...@orange.fr wrote: Le 6 sept. 2013 à 12:58, Petr Kmoch petr.km...@gmail.com a écrit : Hi Lucas, you could look into install(CODE ...) or its escaping-hell-avoiding brother, install(SCRIPT ...). The code/script could then be something like execute_process(COMMAND make install

Re: [CMake] CMake with Team Foundation Server?

2013-08-28 Thread Petr Kmoch
Hi Fabian. CMake has support for generating Scc* properties in projects; see target properties VS_SCC_* Since version 2.8.11, there's also support for generating arbitrary GlobalSections in .sln files; see directory properties VS_GLOBAL_SECTION_* You should be able to use these to generate the

[CMake] Why install(TARGETS ...) from current CMakeList only?

2013-07-29 Thread Petr Kmoch
Hi all. We have a setup where subprojects register items they wish to install, and the top-project later processes them (removing some, modifying others etc.) and issues install(...) commands for them. Currently, this does not work for install(TARGETS ...), as that command can only be given in

Re: [CMake] Custom targets dependencies causing unintended builds

2013-06-10 Thread Petr Kmoch
Hi Robert. Whether a target is included in Visual Studio's Build solution is controlled by target property EXCLUDE_FROM_DEFAULT_BUILD. Would setting it for your custom target(s) help? Petr On Sat, Jun 8, 2013 at 11:57 PM, Robert Dailey rcdailey.li...@gmail.comwrote: I have two custom targets

Re: [CMake] Running install by default, or alternatives?

2013-05-30 Thread Petr Kmoch
Hi Paul. Look up generator expressions in the CMake docs (for example in add_custom_command), particularly $CONFIGURATION. It might help in solving your issue. Petr On Wed, May 29, 2013 at 10:52 PM, Paul Smith p...@mad-scientist.net wrote: No love for this question apparently :-/ I tried

Re: [CMake] Phony targets - FAQ?

2013-05-29 Thread Petr Kmoch
Hi Dan. Note that the docs don't say that a custom target will always be built, but that it's always considered out of date. That's something else. It means that it will always be built *if building it is considered*. So 'make' will never skip it as up to date, but will not build it unless told

Re: [CMake] Fwd: Problems setting CMAKE_CONFIGURATION_TYPES for Visual Studio

2013-05-29 Thread Petr Kmoch
Hi Janosch. A solution to this problem which works for me is: if the configurations are not those I want, set them correctly and abort the generation (with a help message). I put the following code into the CMakeList after the call to project(): if(CMAKE_CONFIGURATION_TYPES AND NOT

Re: [CMake] Fwd: Problems setting CMAKE_CONFIGURATION_TYPES for Visual Studio

2013-05-29 Thread Petr Kmoch
at 1:34 PM, Petr Kmoch petr.km...@gmail.com wrote: Hi Janosch. A solution to this problem which works for me is: if the configurations are not those I want, set them correctly and abort the generation (with a help message). I put the following code into the CMakeList after the call

Re: [CMake] Problem with get_filename_component() and CMAKE_CXX_COMPILER when finding Qt4

2013-04-29 Thread Petr Kmoch
Any idea on this? Or should I file a bug report? On Mon, Apr 22, 2013 at 3:15 PM, Petr Kmoch petr.km...@gmail.com wrote: If you look at the trace, you'll see the following few lines before the error: C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindQt4.cmake(738): set

Re: [CMake] Excluding targets from a solution config in a Visual Studio build

2013-04-23 Thread Petr Kmoch
Hi Alessio. There is a target property EXCLUDE_FROM_DEFAULT_BUILD. If you set this on a target to true, the target will be removed from Build Solution. 2.8.11 should introduce a per-config variant of this property, EXCLUDE_FROM_DEFAULT_BUILD_CONFIG. Petr On Mon, Apr 22, 2013 at 7:15 PM,

<    1   2   3   4   >