[CMake] Finding all the libraries except for one located in the last path dir

Salazar De Troya, Miguel salazardetro1 at llnl.gov
Tue Apr 5 17:31:49 EDT 2016


Sorry for the spam, but I found out that there is a line break added by CMake


execute_process(COMMAND bash "../grab_libraries.sh" "lib_dirs" "${METHOD}" OUTPUT_VARIABLE lib_dirs)


grab_libraries.sh is located in the same folder than CMakeLists.txt and I call cmake .. from a build folder inside the same folder than CMakeLists.txt . The output for the script ./grab_libraries.sh is:


/usr/lib;/lib;/usr/lib64;/usr/local/tools/vtk-6.1.0/lib;/g/g92/miguel/petsc-3.6.2/miguel-opt/lib;/usr/local/tools/openmpi-intel-1.8.4/lib;/usr/local/tools/ic-14.0.174/composer_xe_2013_sp1.3.174/compiler/lib/intel64;/usr/lib/gcc/x86_64-redhat-linux/4.4.7;/g/g92/miguel/code/libmesh_2D/lib;


with no line break, whereas the output variable lib_dirs:

message(${lib_dirs})


/usr/lib/lib/usr/lib64/usr/local/tools/vtk-6.1.0/lib/g/g92/miguel/petsc-3.6.2/miguel-opt/lib/usr/local/tools/openmpi-intel-1.8.4/lib/usr/local/tools/ic-14.0.174/composer_xe_2013_sp1.3.174/compiler/lib/intel64/usr/lib/gcc/x86_64-redhat-linux/4.4.7/g/g92/miguel/code/libmesh_2D/lib


does have a line break and also the semicolons are removed. What’s happening here and how can I get rid of that?


Thanks

Miguel


From: Miguel Salazar <salazardetro1 at llnl.gov<mailto:salazardetro1 at llnl.gov>>
Date: Tuesday, April 5, 2016 at 1:57 PM
To: Miguel Salazar <salazardetro1 at llnl.gov<mailto:salazardetro1 at llnl.gov>>, "cmake at cmake.org<mailto:cmake at cmake.org>" <cmake at cmake.org<mailto:cmake at cmake.org>>
Subject: Re: [CMake] Finding all the libraries except for one located in the last path dir

My apologies, the previous error was because of a trailing whitespace. Although I would still like to know why the terminal variable

/usr/lib;/lib;/usr/lib64;/usr/local/tools/vtk-6.1.0/lib;/g/g92/miguel/petsc-3.6.2/miguel-opt/lib;/usr/local/tools/openmpi-intel-1.8.4/lib;/usr/local/tools/ic-14.0.174/composer_xe_2013_sp1.3.174/compiler/lib/intel64;/usr/lib/gcc/x86_64-redhat-linux/4.4.7;/g/g92/miguel/code/libmesh_2D/lib;

is transformed into

/usr/lib/lib/usr/lib64/usr/local/tools/vtk-6.1.0/lib/g/g92/miguel/petsc-3.6.2/miguel-opt/lib/usr/local/tools/openmpi-intel-1.8.4/lib/usr/local/tools/ic-14.0.174/composer_xe_2013_sp1.3.174/compiler/lib/intel64/usr/lib/gcc/x86_64-redhat-linux/4.4.7/g/g92/miguel/code/libmesh_2D/lib

Miguel
From: CMake <cmake-bounces at cmake.org<mailto:cmake-bounces at cmake.org>> on behalf of Miguel Salazar <salazardetro1 at llnl.gov<mailto:salazardetro1 at llnl.gov>>
Date: Tuesday, April 5, 2016 at 12:55 PM
To: "cmake at cmake.org<mailto:cmake at cmake.org>" <cmake at cmake.org<mailto:cmake at cmake.org>>
Subject: [CMake] Finding all the libraries except for one located in the last path dir

Hello

I am calling find_library in a loop, using the same variable for HINTS. This variable (lib_dirs) is set using a script, and when I simply print it using message(), I obtain this output:

message(${lib_dirs})


/usr/lib/lib/usr/lib64/usr/local/tools/vtk-6.1.0/lib/g/g92/miguel/petsc-3.6.2/miguel-opt/lib/usr/local/tools/openmpi-intel-1.8.4/lib/usr/local/tools/ic-14.0.174/composer_xe_2013_sp1.3.174/compiler/lib/intel64/usr/lib/gcc/x86_64-redhat-linux/4.4.7/g/g92/miguel/code/libmesh_2D/lib


The variable lib_dirs is the output variable of a script that I call using execute_process(). The actual script output (in the terminal) is


/usr/lib;/lib;/usr/lib64;/usr/local/tools/vtk-6.1.0/lib;/g/g92/miguel/petsc-3.6.2/miguel-opt/lib;/usr/local/tools/openmpi-intel-1.8.4/lib;/usr/local/tools/ic-14.0.174/composer_xe_2013_sp1.3.174/compiler/lib/intel64;/usr/lib/gcc/x86_64-redhat-linux/4.4.7;/g/g92/miguel/code/libmesh_2D/lib;


but cmakes removes all the semicolons and puts them all together, why?


Now when I call find_library() for several libraries, I can find them all except the one located in /g/g92/miguel/code/libmesh_2D/lib, why?


Thanks

Miguel



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20160405/0be308e2/attachment-0001.html>


More information about the CMake mailing list