[CMake] How to find a specific version of a library?

2015-07-19 Thread Yaron Cohen-Tal
Hi, For example, I currently have both versions 2 and 3 of the GLFW library installed on my Linux computer, named libglfw.so.2 and libglfw.so.3. Is it possible to tell CMake to find a specific version of GLFW (say, version 3), and it would be smart enough to look for libglfw.so.3 or

Re: [CMake] How to find a specific version of a library?

2015-07-19 Thread Yaron Cohen-Tal
a workaround? (Other than building from source) On Sun, Jul 19, 2015 at 1:06 PM, Nils Gladitz nilsglad...@gmail.com wrote: On 19.07.2015 08:38, Yaron Cohen-Tal wrote: Hi, For example, I currently have both versions 2 and 3 of the GLFW library installed on my Linux computer, named libglfw.so.2

[CMake] How to assign a boolean expression to a variable?

2015-07-19 Thread Yaron Cohen-Tal
I want to set FOO to TRUE iff both COND_A and COND_B are true.I tried the following: set (FOO (${COND_A} AND ${COND_B})) but then FOO get's a value like (;TRUE;AND;TRUE;) instead of TRUE. So I had to write instead: if (${COND_A} AND ${COND_B}) set (FOO TRUE) else () set (FOO FALSE)

[CMake] Unable to locate the project's shared library when running the tests

2015-09-02 Thread Yaron Cohen-Tal
Hi, My project is a shared library, and my tests are linked to that shared library. When I try to run the tests, they fail because they can't find the DLL of the project. The "CMakeLists.txt" of the tests is in a different folder ("test/") than that of the shared lib ("src/"), and therefore

Re: [CMake] Unable to locate the project's shared library when running the tests

2015-09-02 Thread Yaron Cohen-Tal
codelibre.net> wrote: > On 02/09/2015 08:40, Yaron Cohen-Tal wrote: > >> Hi, >> >> My project is a shared library, and my tests are linked to that shared >> library. When I try to run the tests, they fail because they can't find >> the DLL of the project. The

[CMake] Build a program and get its output during "cmake" run

2016-06-07 Thread Yaron Cohen-Tal
Hi, I'd like to build a C++ program and get its output during "cmake" run, not during the project build. "CHECK_CXX_SOURCE_RUNS" only gives me the exit code, but I need the output from the program. Anyway to do it? Thanx, Yaron -- Powered by www.kitware.com Please keep messages on-topic and

Re: [CMake] Build a program and get its output during "cmake" run

2016-06-07 Thread Yaron Cohen-Tal
rg/cmake/help/latest/command/try_run.html > > Petr > > On 7 June 2016 at 09:15, Yaron Cohen-Tal <yaro...@gmail.com> wrote: > >> Hi, >> >> I'd like to build a C++ program and get its output during "cmake" run, >> not during the project build.

[CMake] FindLibXml2.cmake: rename "LIBXML2_DEFINITIONS"

2016-07-30 Thread Yaron Cohen-Tal
Hi, In FindLibXml2.cmake, the name of the variable "LIBXML2_DEFINITIONS" is confusing coz it describes actually what should be added to the "COMPILE_FLAGS" property, not "COMPILE_DEFINITIONS". I think it should b renamed to "LIBXML2_COMPILE_FLAGS". If u wish, I can submit a patch. Thanx, Yaron

Re: [CMake] FindLibXml2.cmake: rename "LIBXML2_DEFINITIONS"

2016-08-01 Thread Yaron Cohen-Tal
Ok, looking at other "FindXXX.cmake" modules I see that you're right, it indeed always denotes what should be added to the "COMPILE_FLAGS" target property, rather than "COMPILE_DEFINITIONS" property. I understand if u don't want to rename it coz it'll break current usage, but just wanna note, it's

Re: [CMake] Creating dependencies between static imported targets.

2016-08-21 Thread Yaron Cohen-Tal
e (or a file invoked by the config-module, usually > generated with install(EXPORT...) ) > > On Sun, Aug 21, 2016 at 4:23 PM, Yaron Cohen-Tal <yaro...@gmail.com> > wrote: > >> Thanx! >> >> I think it would b nice though if the "target_XXX" comm

Re: [CMake] Creating dependencies between static imported targets.

2016-08-21 Thread Yaron Cohen-Tal
Thanx! I think it would b nice though if the "target_XXX" commands would also work for imported targets, e.g.. by adding the dependency to "INTERFACE_LINK_LIBRARIES'. That way I sometimes can use the same command without checking if the depentent is imported. -- Powered by www.kitware.com

[CMake] Creating dependencies between static imported targets.

2016-08-21 Thread Yaron Cohen-Tal
Hi, Using ""target_link_libraries" between static libraries is allowed, however doing it with static imported targets fails with: "Cannot specify link libraries for target "" which is not built by this project. However, this is necessary in order to define dependencies between the targets,

Re: [CMake] Using a pathless library in an imported target.

2016-08-29 Thread Yaron Cohen-Tal
39 GMT+02:00 Yaron Cohen-Tal <yaro...@gmail.com>: > >> Hi, >> >> I try to make an imported target out of OpenGL, and I have some >> difficulty. Usually "OPENGL_gl_LIBRARY" is a full path (found with >> "find_library"), but sometimes (on Win

[CMake] Using a pathless library in an imported target.

2016-08-27 Thread Yaron Cohen-Tal
Hi, I try to make an imported target out of OpenGL, and I have some difficulty. Usually "OPENGL_gl_LIBRARY" is a full path (found with "find_library"), but sometimes (on Windows) it's a pathless library (e.g. "opengl32", set with the cmake command "set"). However an imported library requires the