Re: [CMake] Question about list ordering

2019-11-12 Thread Eric Doenges
The list  command 
is what you want. Specifically, list(GET ...) will return the index of a 
string in the list, and list(INSERT ...) and list(REMOVE_ITEM ...) or 
list(REMOVE_AT ...) to insert and remove items.


Am 13.11.19 um 00:56 schrieb Unnamed User:

Hello everyone,

i'm relative new to CMake and i need a function that does change the
order of a list. So for example when i have a list like

set(LIBS_TO_BUILD "BOOST;EIGEN;PYTHON;GLUT;GLFW;NLOHMANNJSON")

i need a function to swap places like

listSwapString("GLUT", "GLFW", ${LIBS_TO_BUILD}).


The base code for the function look like this, but i don't even know how
to get the index of a string inside of a list or how to insert a string
at a certain position and move the other strings to the back.

function(bsListInsertBefore)
    set(options)
    set(oneValueArgs SEARCH INSERT RESULT)
    set(multiValueArgs LIST)
    cmake_parse_arguments(var
    "${options}"
    "${oneValueArgs}"
    "${multiValueArgs}"
    "${ARGN}"
    )
endfunction()


I hope i can count on you, for me as a CMake newbie this is a great
task, i stil have a bit of a problem with the syntax.


best regards,

Steven Truppe


--

*Dr. Eric Dönges*
Senior Software Engineer

MVTec Software GmbH | Arnulfstr. 205 | 80634 Munich | Germany
doen...@mvtec.com  | Tel: +49 89 457 695-0 
| www.mvtec.com 


Find our privacy policy here .

Sign up  for our MVTec Newsletter!

Geschäftsführer: Dr. Wolfgang Eckstein, Dr. Olaf Munkelt
Amtsgericht München HRB 114695

MVTec Software GmbH Logo
-- 

Powered by kitware.com/cmake

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit https://cmake.org/services

Visit other Kitware open-source projects at https://www.kitware.com/platforms

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

This mailing list is deprecated in favor of https://discourse.cmake.org


[CMake] Question about list ordering

2019-11-12 Thread Unnamed User

Hello everyone,

i'm relative new to CMake and i need a function that does change the
order of a list. So for example when i have a list like

set(LIBS_TO_BUILD "BOOST;EIGEN;PYTHON;GLUT;GLFW;NLOHMANNJSON")

i need a function to swap places like

listSwapString("GLUT", "GLFW", ${LIBS_TO_BUILD}).


The base code for the function look like this, but i don't even know how
to get the index of a string inside of a list or how to insert a string
at a certain position and move the other strings to the back.

function(bsListInsertBefore)
    set(options)
    set(oneValueArgs SEARCH INSERT RESULT)
    set(multiValueArgs LIST)
    cmake_parse_arguments(var
    "${options}"
    "${oneValueArgs}"
    "${multiValueArgs}"
    "${ARGN}"
    )
endfunction()


I hope i can count on you, for me as a CMake newbie this is a great
task, i stil have a bit of a problem with the syntax.


best regards,

Steven Truppe

--

Powered by kitware.com/cmake

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit https://cmake.org/services

Visit other Kitware open-source projects at https://www.kitware.com/platforms

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

This mailing list is deprecated in favor of https://discourse.cmake.org


[CMake] MSVC Version Location for VisualStudio Install

2019-11-12 Thread J. Caleb Wherry
All,

I have been adding support for VS2019 to our build and ran into some CMake
code that was hard coded for a specific version related to MSVC.
Specifically, it is the folder under the VS install dir with version like
"14.23.28105". It is in the path for where the compiler is found but I
can't find an actual variable that contains this version, is there one? I
need access to this folder because we ship the vc_redist and MergeModules
and need to install those. Since they are different between VS2017 and
VS2019 (and we have support for building in multiple VS versions at a
time), I need a way to get this version. I know I can parse it but was
hoping it was exposed some other way... FWIW: I already get the path to VS
version to use as a generator with vswhere so I am open to using that as
well if need be.

Here is the output of CMake with the version bolded for what I am referring
to.

---
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.
-- The C compiler identification is MSVC 19.23.28106.4
-- The CXX compiler identification is MSVC 19.23.28106.4
-- The ASM compiler identification is MSVC
-- Found assembler: C:/Program Files (x86)/Microsoft Visual
Studio/2019/Professional/VC/Tools/MSVC/*14.23.28105*/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual
Studio/2019/Professional/VC/Tools/MSVC/*14.23.28105*/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual
Studio/2019/Professional/VC/Tools/MSVC/*14.23.28105*/bin/Hostx64/x64/cl.exe
-- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual
Studio/2019/Professional/VC/Tools/MSVC/*14.23.28105*/bin/Hostx64/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual
Studio/2019/Professional/VC/Tools/MSVC/*14.23.28105*/bin/Hostx64/x64/cl.exe
-- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done



---

Thanks,
Caleb
-- 

Powered by kitware.com/cmake

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit https://cmake.org/services

Visit other Kitware open-source projects at https://www.kitware.com/platforms

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

This mailing list is deprecated in favor of https://discourse.cmake.org


Re: [CMake] CMake link to external library

2019-11-12 Thread Andrew Bell
On Tue, Nov 12, 2019 at 7:39 AM .  wrote:

> Hi,
> I used instruction for CMake linking external library from
> https://stackoverflow.com/questions/8774593/cmake-link-to-external-library(for
> example)
> And it works on Ubuntu 16 only.
>
> When I try it made on Ubuntu 18 I got problem during start application:
> error while loading shared libraries: libfoo.so.3: cannot open shared
> object file: No such file or directory
>
> Could anybody help me in this problem?
>

https://unix.stackexchange.com/questions/22926/where-do-executables-look-for-shared-objects-at-runtime

-- 
Andrew Bell
andrew.bell...@gmail.com
-- 

Powered by kitware.com/cmake

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit https://cmake.org/services

Visit other Kitware open-source projects at https://www.kitware.com/platforms

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

This mailing list is deprecated in favor of https://discourse.cmake.org


[CMake] CMake link to external library

2019-11-12 Thread .
Hi,
I used instruction for CMake linking external library from 
https://stackoverflow.com/questions/8774593/cmake-link-to-external-library(for 
example)
And it works on Ubuntu 16 only.

When I try it made on Ubuntu 18 I got problem during start application: 
error while loading shared libraries: libfoo.so.3: cannot open shared object 
file: No such file or directory

Could anybody help me in this problem?
Thanks, Serge.
-- 

Powered by kitware.com/cmake

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit https://cmake.org/services

Visit other Kitware open-source projects at https://www.kitware.com/platforms

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

This mailing list is deprecated in favor of https://discourse.cmake.org