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

2016-04-05 Thread Nils Gladitz

On 05.04.2016 23:31, Salazar De Troya, Miguel wrote:



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?




message() concatenates its (semicolon separated) arguments.

try:
message("${lib_dirs}")

Note the quotes.

Nils


-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

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

2016-04-05 Thread Salazar De Troya, Miguel
I resolved this using the option OUTPUT_STRIP_TRAILING_WHITESPACE in 
execute_process(). 
https://cmake.org/cmake/help/v3.0/command/execute_process.html I had not seen 
it.

From: Miguel Salazar >
Date: Tuesday, April 5, 2016 at 2:31 PM
To: Miguel Salazar >, 
"cmake@cmake.org" 
>
Subject: Re: [CMake] Finding all the libraries except for one located in the 
last path dir

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 >
Date: Tuesday, April 5, 2016 at 1:57 PM
To: Miguel Salazar >, 
"cmake@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 > on behalf 
of Miguel Salazar >
Date: Tuesday, April 5, 2016 at 12:55 PM
To: "cmake@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



-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

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

2016-04-05 Thread Salazar De Troya, Miguel
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 >
Date: Tuesday, April 5, 2016 at 1:57 PM
To: Miguel Salazar >, 
"cmake@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 > on behalf 
of Miguel Salazar >
Date: Tuesday, April 5, 2016 at 12:55 PM
To: "cmake@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



-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

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

2016-04-05 Thread Salazar De Troya, Miguel
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 > on behalf 
of Miguel Salazar >
Date: Tuesday, April 5, 2016 at 12:55 PM
To: "cmake@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



-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

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

2016-04-05 Thread Salazar De Troya, Miguel
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



-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake