Re: [CMake] Fwd: Linking GSL to cmake using command line

2019-09-24 Thread Avraham Shukron
No, setting a variable in cmake is done with the 'set(GSL_ROOT /path/to/gsl)' command. You can alternatively set a similarly named environment variable when invoking cmake: GSL_ROOT="/path/to/gsl" cmake On Wed, Sep 25, 2019, 05:15 Sachithra Weerasooriya wrote: > I did install it in a non st

Re: [CMake] Fwd: Linking GSL to cmake using command line

2019-09-24 Thread Sachithra Weerasooriya
I did install it in a non standard path. Which is why was trying to figure out how to link gsl. I couldn’t use homebrew since I don’t have root permissions on the machine. Do you just edit the text file just before calling find_package statement like this ? GSL_ROOT_DIR=\path\to\gsl Thanks! Be

[CMake] Single library with both shared and static binaries

2019-09-24 Thread Avraham Shukron
Hi! I have a library which I want to distribute in both shared object and static library forms. Is there a modern way to do it without creating two completely separate library targets? Since I want to be a good CMake citizen I use `target_*` and `set_target_properties` as much as possible, and cre

Re: [CMake] Fwd: Linking GSL to cmake using command line

2019-09-24 Thread Avraham Shukron
The macro looks fine (assuming you actually call it somewhere). And I also assume that the line that fails is the find_package(GSL REQUIRED) I suspect that it fails because you installed GSL in a local directory that is not in a location known to cmake (E.g not in /usr/local/lib or something simil

Re: [CMake] Fwd: Linking GSL to cmake using command line

2019-09-24 Thread Avraham Shukron
Hi Sachi! Could you paste a minimal CMakeLists.txt file that demonstrate the problem, along with details about your OS version and how did you install GSL? Thanks! On Tue, Sep 24, 2019 at 7:55 PM Raymond Wan wrote: > Hi Sachi and everyone, > > Sorry, I didn't realise her original message wasn'

[CMake] Fwd: Linking GSL to cmake using command line

2019-09-24 Thread Raymond Wan
Hi Sachi and everyone, Sorry, I didn't realise her original message wasn't CC'ed to the list. Please keep replies to the list, Sachi, unless there's a good reason you shouldn't. It will also allow someone to jump in if I've said something incorrectly about your problem. Ray -- Forwarde

Re: [CMake] Linking GSL to cmake using command line

2019-09-24 Thread Raymond Wan
Hi Sachi, Unfortunately, the short answer is "no". I think you misunderstand what CMake is. One way to summarise it is that it allows developers of programs to describe/explain how to compile and link software. For example, suppose there is a program X and it uses the GSL library. A programmer

[CMake] Linking GSL to cmake using command line

2019-09-24 Thread Sachithra Weerasooriya
Hi CMake community! I am having trouble linking GSL to cmake using command line. I am using a Mac. Can someone please help me? Thank you! Best regards, Sachi -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware

[CMake] MacOS and shared libraries from imported targets

2019-09-24 Thread Michael Welsh Duggan
I have a project that links against an external dynamic library for which I have written a Find module that creates an import target. I do this, in part, by setting the IMPORTED_LOCATION property of the target to the location of the dynamic library. Unfortunately, on OSX the library shows up in t

Re: [CMake] FindBoost Warnings

2019-09-24 Thread Brad Bell
CMake version 3.10.2 seems to have the problem and it seems to be fixed in 3.13.4. Thanks On 9/23/19 6:14 AM, Roger Leigh wrote: On 23/09/2019 14:05, Brad Bell wrote: When the target system does not have boost, the user gets the warning: CMake Warning at /usr/share/cmake-3.10/Modules/FindBo

Re: [CMake] Undocumented change of behavior when using EXCLUDE_FROM_ALL

2019-09-24 Thread Jakub Imriska
Thanks for letting me know. -- Jakub Imriška *Programmer and research developer*, Photoneo s. r. o. - Focused on 3D -- Meet us: CIIF , IAS , booth #C010, Hall 8.1 H, 17-21 September 2019, Shanghai (CN) MOTEK

Re: [CMake] file dependency not working in external projects

2019-09-24 Thread hex
hello Eric Doenges, You are correct. This has been given me headaches. Setting BUILD_ALWAYS to TRUE gives the desired behaviour. Thank you On 24/09/2019 14:59, Eric Doenges wrote: You're probably missing the BUILD_ALWAYS option to ExternalProject_Add: |BUILD_ALWAYS | Enabling this op

Re: [CMake] file dependency not working in external projects

2019-09-24 Thread Eric Doenges
You're probably missing the BUILD_ALWAYS option to ExternalProject_Add: |BUILD_ALWAYS | Enabling this option forces the build step to always be run. This can be the easiest way to robustly ensure that the external project’s own build dependencies are evaluated rather than relying on t

Re: [CMake] Undocumented change of behavior when using EXCLUDE_FROM_ALL

2019-09-24 Thread Brad King via CMake
On 9/23/19 10:24 AM, Jakub Imriska wrote: > Is there a way to retain the old behavior? We thought the change was backward compatible with existing projects but perhaps not. I've opened an issue: https://gitlab.kitware.com/cmake/cmake/issues/19753 Thanks, -Brad -- Powered by www.kitware.com

[CMake] file dependency not working in external projects

2019-09-24 Thread hex
hello, I have a problem with a build step. The following command is run every time somefile changes: add_custom_command( OUTPUT out.put     COMMAND touch out.put     DEPENDS somefile.txt ) add_custom_target( sometarget DEPENDS out.put ) I move this snippet inside an external project (with E

Re: [CMake] Return an Error Code (or something) from a CMake Script.

2019-09-24 Thread FRamold
Hi Michael, you probably figured this out by now, but for future reference: You have to log to stderr to make the script fail. This example works (as in /does not build/ ;) ): file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/skript.cmake" CONTENT "message(FATAL_ERROR \"Script failed!