[CMake] unexpected behavior with TARGET_FILE_DIR and Visual Studio 2010

2014-12-05 Thread Michael Ellery
Hi cmake-users, I have the following setup: CMAKE: 3.0.2 Visual Studio 2010 In one of my cmake files, I’m trying to create a preprocessor definition based on the TARGET_FILE_DIR of a different target … so I’m trying this: target_compile_definitions(my_target_B PUBLIC

Re: [CMake] Generate a file with a custom command as part of build

2017-01-24 Thread Michael Ellery
ubdirectory (maybe public/) and calling > `add_subdirectory(public)` from my top-level file? > I've tried this a couple of ways, but so far haven't got it working. > Am I on the right sort of approach, or have I wandered far from the beaten > track? > Thanks again for your help, >

Re: [CMake] externalproject_add and generating sources

2017-01-26 Thread Michael Ellery
> On Jan 26, 2017, at 1:23 AM, David Jobet wrote: > > Hello, > > suppose I want to use protobuf and integrate it in my project with > externalproject_add. (actually, I just have precompiled binaries and libs + > header files, I don't have the full sources) > Once the

Re: [CMake] Generate a file with a custom command as part of build

2017-01-25 Thread Michael Ellery
> On Jan 24, 2017, at 11:22 PM, doug livesey wrote: > > Is there any way that I can make the files webpack compiles into dependencies > for the Webpack task? So that any changes to those are picked up for > recompilation? > No worries if not, I just thought it would be

Re: [CMake] Generate a file with a custom command as part of build

2017-01-21 Thread Michael Ellery
add_custom_command is the probably the right thing…but it needs to be triggered by a dependency relationship. You will specify public/bundle.js as the OUTPUT parameter of the add_custom_command and then some other target or install command needs to have that file listed in its sources, and then

Re: [CMake] Forcing linking compatability to old libc / libstdc++ (Linux)

2017-01-26 Thread Michael Ellery
> On Jan 26, 2017, at 1:23 PM, Gonzalo Garramuño wrote: > > I currently own an Ubuntu Xenial 14.04.1 LTS box in which I do all my work. > I distribute a binary image viewer. However, recently one of my users > tried to run the viewer on a CentOS 7 distro and found out

Re: [CMake] Forcing linking compatability to old libc / libstdc++ (Linux)

2017-01-26 Thread Michael Ellery
> On Jan 26, 2017, at 1:45 PM, Gonzalo Garramuño <ggarr...@gmail.com> wrote: > > > > El 26/01/2017 a las 18:35, Michael Ellery escribió: >> In what way is the stdlib incompatible? Does it have bugs, or is this more a >> matter of cpp standard support? > I

Re: [CMake] installing source (or object) files

2017-01-19 Thread Michael Ellery
I think my initial reaction to installing a source (cxx) file is that you should install a static library instead (.a) - which is basically what you are suggesting. Just define a new static library target that includes the cxx file and install it…should work fine. If there are headers needed to

Re: [CMake] cmake source tree pollution ?

2016-09-09 Thread Michael Ellery
This kinda’ sounds like you are doing an in-source build. Are you certain that your currrent/working directory is different from your source tree root when you run cmake? The typical way of doing this is just to make a subdirectory of your source root: mkdir my_build cd my_build cmake

Re: [CMake] after running cmake, getting an error cannot find -levent

2016-09-15 Thread Michael Ellery
that seems to refer to libevent and the linker is not finding it - so you probably need to build/install that lib for your toolchain. It doesn’t look like there is a standard finder module for libevent currently, but if there were then find_package(LibEvent) would have likely alerted you when

Re: [CMake] Time each target

2016-08-25 Thread Michael Ellery
> On Aug 25, 2016, at 9:58 AM, Moreland, Kenneth wrote: > > Does anyone know of a simple way to get CMake to time how long it takes to > compile each target? As it stands now, when compiling a CMake-managed project > a status is printed before each target is built. What I

[CMake] additional arguments with CMAKE_CXX_CLANG_TIDY variable

2016-11-08 Thread Michael Ellery
I asked this question on SO and am repeating here with the hope someone knows the answer: http://stackoverflow.com/questions/40433573/how-can-i-specify-additional-arguments-for-use-with-cmake-cxx-clang-tidy-variabl —— I'm trying to use make use of clang-tidy integration with cmake and I'd like

Re: [CMake] additional arguments with CMAKE_CXX_CLANG_TIDY variable

2016-11-08 Thread Michael Ellery
> On Nov 8, 2016, at 10:06 AM, Bill Hoffman <bill.hoff...@kitware.com> wrote: > > On 11/8/2016 11:20 AM, Michael Ellery wrote: >> /usr/local/Cellar/cmake/3.6.2/bin/cmake -E __run_iwyu >> --tidy="/usr/local/opt/llvm38/bin/clang-tidy-3.8;-checks=*

Re: [CMake] Custom clang compiler unrecognised on OS-X

2016-10-19 Thread Michael Ellery
This is a complete stab in the dark, but I wonder if your clang (Xcode tools…) needs reactivation. I know some people have reported that they’ve needed to re-accept the license and/or reinstall the Xcode tools following the upgrade. Again, this is just a wild guess. > On Oct 19, 2016, at 2:44

Re: [CMake] CXX_CLANG_TIDY doesn't handle multiple arguments correctly

2016-11-16 Thread Michael Ellery
> On Nov 16, 2016, at 2:32 PM, Nikita wrote: > > Indeed, specifying '-line-filter=[]' doesn't cause any troubles. > Should I file a bug about this? > > Regards, > Nikita > FWIW, I brought up the same issue a few weeks ago:

Re: [CMake] List all "include_directories" for a given project or target

2016-11-21 Thread Michael Ellery
> On Nov 21, 2016, at 5:04 AM, Michael Jackson > wrote: > > Is there a command or variable or a code snippet from someone that > essentially has a list of all the "include_directories" that have been > used/created in a given project? Or can I get a list of all

Re: [CMake] Install destination problem

2016-12-28 Thread Michael Ellery
This might be helpful: http://stackoverflow.com/questions/39481958/setting-cmake-install-prefix-from-cmakelists-txt-file/39485990#39485990 Also, FWIW, the generated makefile (if you are using the makefile generator) supports DESTDIR which will get prepended to the CMAKE_INSTALL_PREFIX path

Re: [CMake] Handling generated headers

2017-03-27 Thread Michael Ellery
> On Mar 27, 2017, at 6:31 AM, Bruce Stephens > wrote: > > I have a build with two or three tools that generate headers and > source files. Getting the source files compiled is easy enough: when > they're mentioned as source files (in add_library or add_executable)

Re: [CMake] Include file in the Makefile

2017-03-23 Thread Michael Ellery
> On Mar 22, 2017, at 2:07 PM, Hom Nath Gharti wrote: > > Dear all, > > I use PETSc in my package and I need to use the following line in my > GNU Makefile: > > include ${PETSC_DIR}/lib/petsc/conf/variables > > What is the equivalent command for CMakeLists.txt for this?

Re: [CMake] Handling generated headers

2017-03-27 Thread Michael Ellery
> If I'm not missing something silly and all this is expected behaviour > (as it appears to be) it's not a disaster. We can add > a few explicit dependencies and get things to work. But maybe I'm > missing something and this should work more > smoothly. > > > On Mon, Ma

Re: [CMake] Overriding the include path, library path of OpenSSL, Zlib and libcurl

2017-04-20 Thread Michael Ellery
It doesn’t look like that find module directly supports HINTS or PATHS, so you can try setting CMAKE_LIBRARY_PATH and CMAKE_INCLUDE_PATH (https://cmake.org/cmake/help/v3.7/variable/CMAKE_LIBRARY_PATH.html) before calling the curl finder. I think you can add to those variables whatever paths

Re: [CMake] Overriding the include path, library path of OpenSSL, Zlib and libcurl

2017-04-21 Thread Michael Ellery
alf of Alex Chen > <alex_c...@filemaker.com> > Date: Friday, April 21, 2017 at 10:28 AM > To: CMake <cmake@cmake.org> > Subject: Re: [CMake] Overriding the include path, library path of OpenSSL, > Zlib and libcurl > > Thanks for the help. I will try that. >

Re: [CMake] Error from GenerateExportHeader.cmake (configure_file)

2017-03-03 Thread Michael Ellery
> On Mar 3, 2017, at 9:23 AM, Miroslav Drahos wrote: > > Hi, > I am getting errors emanating from GenerateExportHeader.cmake and hope > someone has any pointers on this. The error: > > CMake Error at /usr/share/cmake-3.5/Modules/GenerateExportHeader.cmake:362 >

Re: [CMake] Tell cmake use /usr/include/db.h, not /usr/local/include/db.h

2017-07-09 Thread Michael Ellery
> On Jul 9, 2017, at 4:16 AM, Larry Hynes wrote: > > Hi > > I'm building nvi2[0], on (Mac OS X Yosemite (10.10.5)), which uses > cmake. > > nvi2 depends on a reasonably sane BSD environment, which would > include Berkeley DB V1 which is found at /usr/include/db.h. > > I

Re: [CMake] How to have build steps operate on files in a copied directory?

2017-07-10 Thread Michael Ellery
> On Jul 10, 2017, at 11:19 AM, Christopher E Robison > wrote: > > The INSTALL(SCRIPT ...) syntax might be just the answer I need, thanks!. > > As I mentioned, the index creating script in the custom step needs to operate > on the copied directory tree in its final

Re: [CMake] How to have build steps operate on files in a copied directory?

2017-07-10 Thread Michael Ellery
> On Jul 10, 2017, at 10:46 AM, Christopher E Robison > wrote: > > I've recently begun using CMake on an existing project I've taken over, and I > feel like I'm mostly getting used to it, though there is still a vast amount > to learn. I've got nearly the entire

Re: [CMake] Can not get C++ 11 support enabled

2017-07-10 Thread Michael Ellery
> On Jul 10, 2017, at 10:07 PM, Florian Lindner wrote: > > Hello, > > my complete cmake file looks like that: > > cmake_minimum_required (VERSION 3.1) > project(Preallocation) > add_executable(prealloc prealloc_parallel.cpp) > > set(CMAKE_CXX_STANDARD 11) >

Re: [CMake] What is the default build type?

2017-07-31 Thread Michael Ellery
> On Jul 31, 2017, at 8:48 PM, Florian Lindner wrote: > > Hello > > ccmake shows CMAKE_BUILD_TYPE as unset. From the compile commands it looks > like also nothing like Debug nor Release. > > Why is there no well-defined default set? How can I set a default? > > Thanks,

Re: [CMake] Platform dSPACE

2017-06-23 Thread Michael Ellery
> On Jun 23, 2017, at 1:11 PM, Robin Verschueren > wrote: > > Thank you, that makes sense. > > If I do that, how can I set specific settings for this Platform only? It > seems that e.g. > > set(CMAKE_INCLUDE_FLAG_C "-J") > > in the Toolchain file is overwritten

Re: [CMake] Platform dSPACE

2017-06-23 Thread Michael Ellery
> On Jun 23, 2017, at 1:01 PM, Michael Ellery <mellery...@gmail.com> wrote: > > >> On Jun 23, 2017, at 12:47 PM, Robin Verschueren >> <robin.verschue...@gmail.com> wrote: >> >> Dear CMake, >> >> We are trying to build our application

Re: [CMake] Platform dSPACE

2017-06-23 Thread Michael Ellery
> On Jun 23, 2017, at 12:47 PM, Robin Verschueren > wrote: > > Dear CMake, > > We are trying to build our application for the dSPACE embedded system > (www.dspace.com), more specifically their MicroAutobox-II. This makes > use of a specific compiler called mccppc

[CMake] rpath linker args

2017-05-19 Thread Michael Ellery
I’m wondering if anyone knows the details of rpath linker args. In particular, I have two paths in my CMAKE_BUILD_RPATH. On macOS, I end-up with something like this: …. -Wl,rpath=/path/number/one -Wl,rpath=/path/number/two …. and on linux with the same CMakeLists.txt file, I get: ….

Re: [CMake] Generating include files

2017-05-19 Thread Michael Ellery
> On May 19, 2017, at 2:00 PM, Urs Thuermann <u...@isnogud.escape.de> wrote: > > Michael Ellery <mellery...@gmail.com> writes: > >> if your source can be generated by simple substitution of variable >> values (like a template file), then configure_file()

Re: [CMake] Generating include files

2017-05-19 Thread Michael Ellery
> On May 19, 2017, at 1:00 PM, Urs Thuermann wrote: > > How can I write a CMakeFile that will include a generated source file > into another C source? I have read the FAQ, searched the mailing list > archives and have tried for two hours without success. > > With

Re: [CMake] Forcing CMake to find static library

2017-06-09 Thread Michael Ellery
if you know exactly where the library is (via the ENV), then I guess you want to specify the NO_DEFAULT_PATH option to find_library. Alternatively, see if you can use the standard find module included with cmake: https://github.com/Kitware/CMake/blob/master/Modules/FindLAPACK.cmake ..and in

Re: [CMake] Release flags on one target in debug build type

2017-05-05 Thread Michael Ellery
> On May 5, 2017, at 11:45 AM, Konstantin Tokarev wrote: > > Hello, > > Is there any clear way to build specific target in "Debug" mode with flags > that it would have in "Release"? > > In particular, build this specific target without effect of > CMAKE_CXX_FLAGS_DEBUG

Re: [CMake] linking boost to cmake under OSX 10.12.1 , boost 1.63 , cmake 2017.11

2017-05-03 Thread Michael Ellery
> On May 3, 2017, at 8:20 PM, Sean Wayland wrote: > > Hi all, > > I am very new to cmake and boost. Sorry if my question is basic thanks for > your help in advance. > > I am having trouble linking a project to boost. I am using OSX 10.12.1 > I am using clion 2017.1.1

Re: [CMake] Generating include files

2017-05-19 Thread Michael Ellery
> On May 19, 2017, at 3:48 PM, Urs Thuermann wrote: > > Craig Scott writes: > >> A bit of a long-shot, have you tried generating the file with the extension >> .h instead of .c? That might allow it to be picked up by the dependency >> scanner

Re: [CMake] Generate headers and inherit include_directories

2017-10-03 Thread Michael Ellery
maybe a CMake snippet of what you are trying would help clarify, but are you using an interface library for your header-only? I would assume yes - and then have to tried add_dependency() for that library to trigger the file generation? The dependency will only be resolved when the library is

[CMake] advice for resolving errors with CMake 3.8

2018-05-02 Thread Michael Ellery
I generally develop on a latest cmake (provided by homebrew) and that works well for me. Unfortunately, I also need to support Visual Studio builds and it looks like the cmake that is bundled with VS is 3.8. I’m apparently using bleeding-edge features related to IMPORTED libraries, judging by

Re: [CMake] advice for resolving errors with CMake 3.8

2018-05-02 Thread Michael Ellery
> On May 2, 2018, at 3:55 PM, Alan W. Irwin <ir...@beluga.phys.uvic.ca> wrote: > > On 2018-05-02 09:45-0700 Michael Ellery wrote: > >> I generally develop on a latest cmake (provided by homebrew) and that works >> well for me. Unfortunately, I also need t

[CMake] CMake + mdvc + --build + jenkins

2018-02-01 Thread Michael Ellery
I know this is a long-shot, but I’m wondering if anyone has encountered this scenario: CMake (3.10) being used to generate a project for Visual Studio 15 (the current latest) the build is running on a windows machine under a jenkins slave process The generation step runs fine I then run

Re: [CMake] Parallel build setup question

2018-02-16 Thread Michael Ellery
I don’t know anything about QTCreator, but the question really boils down to how to get your IDE to pass extra args to the build tool - it’s not really a cmake issue except to the extent that CMake can be used to invoke the build step (after it has been used to generate the build). It sounds

Re: [CMake] Beginning to compiling CMake file

2018-08-01 Thread Michael Ellery
to build the binaries; I'm then > prompt for a generator for the project. Up to this point am I doing this > correctly ? > > Thank You > > > > > On 7/31/2018 12:56 PM, Michael Ellery wrote: >> typical usage would be something like (assuming you are at repo root) : &g

Re: [CMake] Can't find boost libs on VS2017 CMake 3.12

2018-08-02 Thread Michael Ellery
did you build boost yourself or download a pre-built package? What subdirectory are the import libraries (.lib) located in? Do you set any boost-finder variables before calling find_package(Boost)? I have at times in the past had to set BOOST_LIBRARYDIR when the package I was using had an odd

Re: [CMake] Beginning to compiling CMake file

2018-07-31 Thread Michael Ellery
typical usage would be something like (assuming you are at repo root) : mkdir mybuild && cd mybuild cmake -DCMAKE_BUILD_TYPE=Release .. cmake —build . you can also opt to configure cmake (the equivalent of the first cmake command above) using a GUI like ccmake or cmake-gui if you prefer. The

Re: [CMake] Linker and archiver options

2018-08-14 Thread Michael Ellery
This seems like something that would be best-suited for a toolchain file: https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html Have you given that a try? Also, I wonder if STATIC_LIBRARY_FLAGS is a custom setting, because I don’t think that one is a standard cmake variable. -Mike

Re: [CMake] Modular build system for repository with libraries shared between multiple targets.

2018-08-13 Thread Michael Ellery
it’s not clear to me why you are trying to do this multiple project thing…I mean why not just?: project(myrepo) add_subdirectory(util) add_subdirectory(tool) add_subdirectory(app) and then if you only want to build util for instance: cd build && cmake .. && cmake --build . --target=util is

Re: [CMake] Problem with FindXercesC.cmake

2018-09-27 Thread Michael Ellery
> On Sep 27, 2018, at 2:55 PM, Mateusz Loskot wrote: > > > >> I use to rely on a custom FindXercesC.cmake file that was using XercesC_ROOT >> to figure all this out. >> Is there any way to do the same here? > > There seem to be no Xxx_ROOT_DIR handled by this module >

Re: [CMake] About FindBoost.cmake

2018-10-29 Thread Michael Ellery
I’m guessing you want to set Boost_USE_DEBUG_RUNTIME: https://github.com/Kitware/CMake/blob/master/Modules/FindBoost.cmake#L1467 > On Oct 29, 2018, at 4:29 PM, Osman Zakir wrote: > > Hi again, everyone. > > I noticed that FindBoost.cmake has "-d" set as the Boost debug ABI tag even > though

Re: [CMake] Problem with using CMake on Windows with Visual Studio 2017

2018-10-26 Thread Michael Ellery
look at the error message specifically:LDFLAGS=-static-libstdc++ -static-libgcc Did you add something to your environment recently? Those look like gcc/clang flags - msvc is not going to like them. Also, have you wiped your CMakeCache completely (clean configure)? I’d have a look at your

Re: [CMake] Problems with EnternalProjectAdd

2019-02-18 Thread Michael Ellery
CMAKE_BUILD_DIR is not a standard variable (did you mean CMAKE_BINARY_DIR ?) - and the error seems to indicate that the variable is indeed empty so it tries to create the project directory at the root level. -Mike > On Feb 18, 2019, at 8:58 PM, workbe...@gmx.at wrote: > > Hi again, > > i

Re: [CMake] OBJECT libraries getting fully support?

2019-02-12 Thread Michael Ellery
https://cmake.org/cmake/help/latest/release/3.12.html says that target_link_libraries got OBJECT in 3.12 - is that what you had in mind? -Mike > On Feb 12, 2019, at 3:35 PM, Paul Smith wrote: > > Don't want to be a noodge but wondering if anyone has any thoughts > about this question or ideas

Re: [CMake] Problems with EnternalProjectAdd

2019-02-19 Thread Michael Ellery
>> BUILD_COMMAND "cd ${CMAKE_BUILD_DIR}/freetype/src/freetype && >>>> ./autgen.sh && ./configure && make" >>>> LOG_DOWNLOAD ON >>>> LOG_INSTALL ON >>>> LOG_CONFIGURE ON >>>&g

Re: [CMake] Support for Boost 1.70.0

2019-04-12 Thread Michael Ellery
se. > > On Fri, Apr 12, 2019 at 4:02 PM Michael Ellery wrote: > whenever I use bleeding-edge boost, I try to grab the latest FindBoost: > https://github.com/Kitware/CMake/commits/master/Modules/FindBoost.cmake > > ..in particular, you probably want > htt

Re: [CMake] Support for Boost 1.70.0

2019-04-12 Thread Michael Ellery
whenever I use bleeding-edge boost, I try to grab the latest FindBoost: https://github.com/Kitware/CMake/commits/master/Modules/FindBoost.cmake ..in particular, you probably want

Re: [CMake] ExternalProject_Add() setting build command to run external project's makefile

2019-05-31 Thread Michael Ellery
It seems like the error might be related to the download/extract step. I think the fact that you are using the same dir for PREFIX, SOURCE_DIR and DOWNLOAD_DIR might be confusing things. I would try commenting out those three properties and see if it makes any difference, and then you can

Re: [CMake] Question about properties.

2019-06-02 Thread Michael Ellery
I think you can refer to https://cmake.org/cmake/help/latest/manual/cmake-properties.7.html or “cmake —help-properties”. > On Jun 2, 2019, at 5:07 AM, Steven Truppe wrote: > > Hi again, > > > i'm reading up on properties and i see how to use set_properties and > get_properties but i don't

Re: [CMake] Question about running C code from within cmake

2019-06-02 Thread Michael Ellery
have a look at https://cmake.org/cmake/help/latest/module/ProcessorCount.html If you still think you really need to compile/run code for this, have a look at https://cmake.org/cmake/help/latest/command/try_run.html#command:try_run, but that is harder to get working and maintain. > On Jun 2,

Re: [CMake] install multiple versions of CMake on your system

2019-06-23 Thread Michael Ellery
If you are using the shell archive from cmake.org, it supports a —prefix and —exclude-subdir option, e.g.: cd /tmp CM_INSTALLER=cmake-3.14.0-Linux-x86_64.sh CM_VER_DIR=/opt/local/cmake/3.14 wget https://cmake.org/files/v3.14/$CM_INSTALLER chmod a+x $CM_INSTALLER mkdir -p $CM_VER_DIR

Re: [CMake] How to use Ninja on Windows with MSVC?

2019-05-22 Thread Michael Ellery
> On May 22, 2019, at 6:58 AM, Robert Dailey wrote: > > From the command line, I want to generate Ninja build scripts that > utilize a specific version of MSVC compiler. Basically I'd like the > combination of `-G"Visual Studio 15 2017"` with regards to its ability > to find the C and C++

Re: [CMake] CHECK_CXX_COMPILER_FLAG doesn't give correct result for -fsanitize=address

2019-10-24 Thread Michael Ellery
I’ve dealt with that using something like this: set (_saved_CRL ${CMAKE_REQUIRED_LIBRARIES}) set (CMAKE_REQUIRED_LIBRARIES “-fsanitize=address;asan") check_cxx_compiler_flag (-fsanitize=address COMPILER_SUPPORTS_SAN) set (CMAKE_REQUIRED_LIBRARIES ${_saved_CRL}) the second item in

[CMake] target_sources vs. PUBLIC_HEADER for libraries

2019-10-11 Thread Michael Ellery
I’d like to make sure I understand two different aspects of header files management for libraries: (1) typically you can add header files to target_sources, but it’s only helpful for IDEs..so that the IDE will show the header files in its sources list, correct?. In theory, cmake does not