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/FindBoost.cmake:567 (message):
  Imported targets and dependency information not available for Boost version
  (all versions older than 1.33)
Call Stack (most recent call first):
  /usr/share/cmake-3.10/Modules/FindBoost.cmake:907 
(_Boost_COMPONENT_DEPENDENCIES)
  /usr/share/cmake-3.10/Modules/FindBoost.cmake:1558 
(_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:245 (FIND_PACKAGE)

This is not a problem because if the user's system does not have boost,
they will no be using the case that the examples cover.

How do I suppress this warning ?


I think it's already fixed in more recent CMake versions.  It now only prints that message when 
Boost is found, and older than 1.33.



Regards,

Roger




--

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:
https://cmake.org/mailman/listinfo/cmake


[CMake] FindBoost Warnings

2019-09-23 Thread Brad Bell

I am using FindBoost in a cmake script
to determine if certain components of the boost package are available on the 
target system.

If so, the script builds examples that use my package with boost.
If not, these example are not built and tested.

When the target system does not have boost, the user gets the warning:

CMake Warning at /usr/share/cmake-3.10/Modules/FindBoost.cmake:567 (message):
  Imported targets and dependency information not available for Boost version
  (all versions older than 1.33)
Call Stack (most recent call first):
  /usr/share/cmake-3.10/Modules/FindBoost.cmake:907 
(_Boost_COMPONENT_DEPENDENCIES)
  /usr/share/cmake-3.10/Modules/FindBoost.cmake:1558 
(_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:245 (FIND_PACKAGE)

This is not a problem because if the user's system does not have boost,
they will no be using the case that the examples cover.

How do I suppress this warning ?
--

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:
https://cmake.org/mailman/listinfo/cmake


Re: [CMake] PROJECT( LANGUAGES ) and m4

2017-01-08 Thread Brad Bell
Using a custom_command (not custom_target) and a looping over the output 
file names, I was able to get cmake to properly track the m4 output 
files and create them when necessary; see

https://cmake.org/pipermail/cmake/2009-June/029909.html
This seems to me like a good solution.

On 01/06/2017 05:37 AM, Brad Bell wrote:

If one looks at the documentation
https://cmake.org/cmake/help/v3.0/command/project.html
one sees
project( [LANGUAGES] [...])
and the following text: 'By default C and CXX are enabled if no 
language options are given.'


It there a list of available languages ?

I have a project that has m4 input files. A single m4 input file can 
be used to generate output in Perl, Octave, Python, or C++ language. 
Can CMake handle this type of dependency, or would I have to use 
custom targets in this case ?





--

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] PROJECT( LANGUAGES ) and m4

2017-01-06 Thread Brad Bell

If one looks at the documentation
https://cmake.org/cmake/help/v3.0/command/project.html
one sees
project( [LANGUAGES] [...])
and the following text: 'By default C and CXX are enabled if no language 
options are given.'


It there a list of available languages ?

I have a project that has m4 input files. A single m4 input file can be 
used to generate output in Perl, Octave, Python, or C++ language. Can 
CMake handle this type of dependency, or would I have to use custom 
targets in this case ?


--

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] detecting if c++11 available

2013-02-19 Thread Brad Bell
My goal is to use some new c++11 features if they are available, 
otherwise to stick to the c++03 features. I need to build test programs 
that check for correctness as well as distribute an include file library.


Is there a way in cmake to detect if c++11 is available and to use it 
when it is available ? I would like this to be system and compiler 
independent.




--

Powered by www.kitware.com

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

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

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


Re: [CMake] ADD_CUSTOM_TARGET

2013-01-17 Thread Brad Bell

On 01/16/2013 02:21 PM, Andreas Pakulat wrote:

Hi,

On Wed, Jan 16, 2013 at 11:01 PM,   wrote:

The problem is that the script fails when using cmake 2.6. I want to know
if this is expected or a bug ?

I filed a bug report with Red-Hat 6, but they just decided to ignore it. See
 https://bugzilla.redhat.com/show_bug.cgi?id=896116

Perhaps someone knows a way around this problem ?

Download and extract an up-to-date cmake tarball and use that cmake
version would be one way to workaround a possible bug in an older
cmake version and a distro unwilling/unable to upgrade cmake.

Andreas

The problem is that am building an el6 package that yum will install for 
the user and must use packages from their standard locations when doing so.


It seems that bug fixes are no longer being applied to CMake 2.6 and 
that the version on Red-Hat 6 is no longer supported ?

--

Powered by www.kitware.com

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

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

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


[CMake] ADD_CUSTOM_TARGET

2013-01-15 Thread Brad Bell
I am trying to build a project for Red-hat 6 which uses the following 
cmake version

bradbell@gorst trash]$ cmake --version
cmake version 2.6-patch 4

While doing so I am having trouble with the ADD_CUSTOM_TARGET. To be 
specifc, after building a custom target, cmake seems to forget it has 
done so.


Below is an example CMakeLists for which
make check
works with cmake 2.8.9 and fails with 2.6-patch 4:
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
#
PROJECT(hello)
#
ADD_EXECUTABLE(hello_one EXCLUDE_FROM_ALL hello_one.cpp )
ADD_EXECUTABLE(hello_two EXCLUDE_FROM_ALL hello_two.cpp )
#
ADD_CUSTOM_TARGET(check_one hello_one DEPENDS hello_one)
ADD_CUSTOM_TARGET(check_two hello_two DEPENDS hello_two)
#
ADD_CUSTOM_TARGET(check DEPENDS check_one check_two)

I am attaching a bash script that creates the necessary files and runs 
the make check command. The output I get on Red-Hat 6 is


[bradbell@gorst trash]$ ./cmake_target.sh
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: /homes/bradbell/trash/build
Scanning dependencies of target hello_two
[ 50%] Building CXX object CMakeFiles/hello_two.dir/hello_two.cpp.o
Linking CXX executable hello_two
[ 50%] Built target hello_two
Scanning dependencies of target check_two
hello_two

[ 50%] Built target check_two
Scanning dependencies of target hello_one
[100%] Building CXX object CMakeFiles/hello_one.dir/hello_one.cpp.o
Linking CXX executable hello_one
[100%] Built target hello_one
Scanning dependencies of target check_one
hello_one

[100%] Built target check_one
Scanning dependencies of target check
make[3]: *** No rule to make target `check_one', needed by 
`CMakeFiles/check'.  Stop.

make[2]: *** [CMakeFiles/check.dir/all] Error 2
make[1]: *** [CMakeFiles/check.dir/rule] Error 2
make: *** [check] Error 2
[bradbell@gorst trash]$






cmake_target.sh
Description: application/shellscript
--

Powered by www.kitware.com

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

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

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

Re: [CMake] Building a library for both C and C++

2013-01-09 Thread Brad Bell
I have the same problem. The reason for the problem is that I am 
comparing the speed of the exact same source code compiled by C and C++. 
I have heard folk lore that C is faster, so I want an automated test to 
check for this for an arbitrary hardware and compiler.


What I did was to create two source files, copied from the exact same 
original file, but with the .c and .cpp extensions using CONFIGURE_FILE. See

https://projects.coin-or.org/CppAD/browser/trunk/compare_c/CMakeLists.txt


On 01/09/2013 02:27 AM, Andreas Pakulat wrote:

Hi,

On Wed, Jan 9, 2013 at 1:17 AM, kgardenia42  wrote:

I am trying to write a CMakeLists.txt where the same source files are
compiled separately to both a C library and a C++ library.

So, lets say I have foo.c, bar.c and baz.c and I would like to build
mylib.a and mylib++.a

My intuition is to use one CMakefile and add multiple targets for each
library I want to build.  Does that seem like a reasonable approach?
Other suggestions welcome.  Also, can anyone point me to an open
source library that uses cmake and builds both a C and C++ version.

I'd say this does not make any sense. The mylib++.a will still be a C
library because all the compiled code in it will be C code unless your
c files are somehow using a preprocessor macro to enable C and C++
code. And if they I'd say you'd be better off to split the files into
a .c and a .cpp one and drop the macro.

A C++ program can link to C libraries just fine, so there's really no
need for that that I can see right now.

Andreas



--

Powered by www.kitware.com

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

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

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


[CMake] CMAKE_C_FLAGS and CMAKE_CXX_FLAGS

2012-11-11 Thread Brad Bell
Would someone please point me to the specifications for CMAKE_C_FLAGS 
and CMAKE_CXX_FLAGS in

http://www.cmake.org/cmake/help/cmake2.6docs.html
(or perhaps for CMAKE_C_FLAGS_ and CMAKE_CXX_FLAG_ where  
is DEBUG or RELEASE).


These flags are used by the Modules distributed with CMAKE, but I cannot 
find their documentation.

--

Powered by www.kitware.com

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

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

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


[CMake] CMakeLists.txt options.

2012-10-28 Thread Brad Bell

The CMakeLists.txt command
option(  "help string describing option" [initial 
value] )

Provides an option for the user to select as ON or OFF; i.e., a BOOL.

How does one provide an option for the user to select that is a PATH ?

--

Powered by www.kitware.com

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

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

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


[CMake] Changing name of CMakeLists.txt file

2010-01-17 Thread Brad Bell

Is it possible to use a different name in place of CMakeLists.txt ?

I am considering using CMake, but I want to conform the to one of the 
boost guidelines at

http://www.boost.org/development/requirements.html
In particular, under the heading
Directory Structure and Filenames
the following guideline appears:
"Names must contain onl**y lowercase ASCII letters (|'a'|-|'z'|), 
numbers (|'0'|-|'9'|), underscores (|'_'|), hyphens (|'-'|), and periods 
(|'.'|). Spaces are not allowed."



___
Powered by www.kitware.com

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

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

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