Re: [CMake] target_sources vs. PUBLIC_HEADER for libraries

2019-10-11 Thread Alex Turbov
Hi,

On Fri, Oct 11, 2019 at 9:33 PM Michael Ellery  wrote:

> I’d like to make sure I understand two different aspects of header files
> management for libraries:
>
> (1) typically you can add header files to target_sources, but it’s only
> helpful for IDEs..so that the IDE will show the header files in its sources
> list, correct?. In theory, cmake does not actually need header files
> explicitly specified for dependency tracking, although I guess listing them
> makes it explicit.
>

yep, correct


> (2) setting the PUBLIC_HEADER property for a target then makes header
> files available for installation via the PUBLIC_HEADER destination. Is this
> the preferred way to install the library interface/public headers? How do
> you handle a header directory hierarchy — for example maybe you have detail
> and impl subdirectories if you are following boost/stdlib conventions.
>
>
Nowadays this feature useless if you have a directory hierarchy %( So
pity...


> I found Craig’s article about target_sources very helpful (
> https://crascit.com/2016/01/31/enhanced-source-file-handling-with-target_sources/),
> but I don’t think it addresses the PUBLIC_HEADER installation use case.
>

Yep, it describes a trivial ("Hello World" level) projects.

Some time ago I've started a discussion about improvements to
`target_sources` addressed to resolve directory hierarchy install problem,
but it ends w/ no outcome... %(


> Thanks,
> Mike Ellery
> --
>
> 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
>
-- 

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] Shortcomings with exporting and importing targets

2019-07-25 Thread Alex Turbov
Unfortunately, your approach won't work %(

- first of all to write a `*-config.cmake` file the user gonna use
`configure_package_config_file` (which is end up w/ `configure_file`).
there is no place to use `file(GENERATE...)` since its result appears too
late...
- Ok, I can imagine that in the middle of `*-config.cmake` one can do
`include(genex-expanded-blah-blah.cmake)` which is the result of
`file(GENERATE...)` from the CMake run. But, the next problem is to match
imported targets (obviously generated as a list variable) to the package
names, versions, and components suitable for `find_package`...
- The next problem: some finders could be tuned via variables (e.g.
`OPENSSL_USE_STATIC_LIBS`, `Boost_USE_MULTITHREADED`, &etc) or even worse
-- finder was given a path hint to load particular build of the third-party
dependency (e.g. `XXX_ROOT_DIR`)...

So, I'd be happy if CMake could take care of imported targets (loaded via
`find_package`) for me and allows me to easily generate an export targets
file with required `find_packages` *really used* by my target...



On Thu, Jul 25, 2019 at 6:22 PM Robert Maynard 
wrote:

> In general you match every find_package call in your project with one
> in your generate config file. If you have complicated conditional
> dependencies you might be able to use file(GENERATE to determine which
> ones will be used.
>
>
> On Thu, Jul 25, 2019 at 11:02 AM Alex Turbov  wrote:
> >
> > > It is than up to each project to generate an Config module that does
> > the required find_package calls to re-locate ZLIB.
> >
> > Problems begin when mentioned dependencies are wrapped into generator
> expressions (e.g. $ or smth even more
> complicated) -- how do I know what `find_packages` to include to my
> `*-config.cmake`??
> >
> > On Thu, Jul 25, 2019 at 5:49 PM Robert Maynard <
> robert.mayn...@kitware.com> wrote:
> >>
> >> target_link_libraries() when given an explicit path+filename as PUBLIC
> >> ( not PRIVATE ) will be part of the transitive dependencies. An
> >> explicit path+filename is not a target to CMake, nor will CMake
> >> compute that it maps to an existing target ( be it imported or a
> >> 'normal' target ).
> >>
> >> > This makes me think that install(TARGETS ...) not supporting imported
> targets is likely an oversight by the CMake developers
> >>
> >> When exporting targets CMake exports what import targets something it
> >> depends on. So if you have target_link_libraries(my_target PUBLIC
> >> ZLIB::ZLIB) CMake when exporting my_target will export it depends on
> >> ZLIB::ZLIB. It does this so that export information is machine
> >> relocatable.
> >> It is than up to each project to generate an Config module that does
> >> the required find_package calls to re-locate ZLIB.
> >>
> >> On Wed, Jul 24, 2019 at 6:36 PM Benjamin Shadwick <
> benshadw...@gmail.com> wrote:
> >> >
> >> > As a followup to my previous email dated 7/15/19, I learned from a
> co-worker this week that if Project A's target_link_libraries() links
> against an explicit path+filename of an external library, a subsequent
> install(TARGETS ...) command will actually include that dependency in the
> exported target for Library A1, such that it will be picked up as a
> transitive dependency when later linking Library A1 into a binary in
> Project B.
> >> >
> >> > This makes me think that install(TARGETS ...) not supporting imported
> targets is likely an oversight by the CMake developers. This ought to be
> fixed, because it effectively discourages people from following the "modern
> CMake" approach of using targets wherever possible.
> >> > --
> >> >
> >> > 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
> >> --
> >>
> >> Powered by www.kitware.com
> >>
> >&g

Re: [CMake] Shortcomings with exporting and importing targets

2019-07-25 Thread Alex Turbov
> It is than up to each project to generate an Config module that does
the required find_package calls to re-locate ZLIB.

Problems begin when mentioned dependencies are wrapped into generator
expressions (e.g. $ or smth even more
complicated) -- how do I know what `find_packages` to include to my `
*-config.cmake`??

On Thu, Jul 25, 2019 at 5:49 PM Robert Maynard 
wrote:

> target_link_libraries() when given an explicit path+filename as PUBLIC
> ( not PRIVATE ) will be part of the transitive dependencies. An
> explicit path+filename is not a target to CMake, nor will CMake
> compute that it maps to an existing target ( be it imported or a
> 'normal' target ).
>
> > This makes me think that install(TARGETS ...) not supporting imported
> targets is likely an oversight by the CMake developers
>
> When exporting targets CMake exports what import targets something it
> depends on. So if you have target_link_libraries(my_target PUBLIC
> ZLIB::ZLIB) CMake when exporting my_target will export it depends on
> ZLIB::ZLIB. It does this so that export information is machine
> relocatable.
> It is than up to each project to generate an Config module that does
> the required find_package calls to re-locate ZLIB.
>
> On Wed, Jul 24, 2019 at 6:36 PM Benjamin Shadwick 
> wrote:
> >
> > As a followup to my previous email dated 7/15/19, I learned from a
> co-worker this week that if Project A's target_link_libraries() links
> against an explicit path+filename of an external library, a subsequent
> install(TARGETS ...) command will actually include that dependency in the
> exported target for Library A1, such that it will be picked up as a
> transitive dependency when later linking Library A1 into a binary in
> Project B.
> >
> > This makes me think that install(TARGETS ...) not supporting imported
> targets is likely an oversight by the CMake developers. This ought to be
> fixed, because it effectively discourages people from following the "modern
> CMake" approach of using targets wherever possible.
> > --
> >
> > 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
> --
>
> 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
>
-- 

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] Does CMake support the --question option for GNU Makefiles?

2018-11-27 Thread Alex Tzonkov
Thanks for the quick response it makes more sense now. Looking at our CMake
files, I see now that all our targets are indeed PHONY, because we use
*add_custom_target
*to create those targets. So no matter what they are always considered out
of date. For now I'll have to assume that whoever wrote the CMake files had
a good reason for doing that. Is that considered a recommend way to set up
a project, or perhaps each and every project is unique so it does not make
sense to even have a recommendation?

On Tue, Nov 27, 2018 at 12:06 PM frodak  wrote:

> I think this is just a misunderstanding and not related to CMake.
>
> Make --question mode always returns a 1 if the target is PHONY because
> these targets are always out of date.
> The Makefiles generated by CMake use a top level PHONY target (and other
> PHONY targets as well)
>
> zzz@i7-lab:~/temp/bldlibvnc$ make -q
> CMakeFiles/vncserver.dir/libvncserver/zrleoutstream.c.o
> zzz@i7-lab:~/temp/bldlibvnc$ echo $?
> 0
> zzz@i7-lab:~/temp/bldlibvnc$ make -q
> zzz@i7-lab:~/temp/bldlibvnc$ echo $?
> 1
>
> OR
>
> zzz@i7-lab:~/temp/bldlibvnc$ make -q vncclient
> zzz@i7-lab:~/temp/bldlibvnc$ echo $?
> 1
> zzz@i7-lab:~/temp/bldlibvnc$ make -q libvncclient.so
> zzz@i7-lab:~/temp/bldlibvnc$ echo $?
> 0
>
> So you'll need to discern the actual target you want to check.
>
> Best regards...
>
> On Tue, Nov 27, 2018 at 11:51 AM Alex Tzonkov 
> wrote:
>
>> We are using cmake for our project and recently discovered that the
>> generated Makefiles do not seem to work correctly with the '--question' or
>> '-q' option. The return code is always '1' even if there are no changes
>> which would require rebuilding/recompiling anything. I am not sure if this
>> is an issue with our CmakeLists.txt files or *.cmake files or a general
>> issue with cmake. Any pointers would be greatly appreciated.
>>
>> I apologize if this is an answered question, I tried really hard to
>> search the archives, but searching for "--question" is futile, as the
>> searches return pretty much every question.
>>
>> --
>>
>> 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
>>
>
-- 

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] Does CMake support the --question option for GNU Makefiles?

2018-11-27 Thread Alex Tzonkov
We are using cmake for our project and recently discovered that the
generated Makefiles do not seem to work correctly with the '--question' or
'-q' option. The return code is always '1' even if there are no changes
which would require rebuilding/recompiling anything. I am not sure if this
is an issue with our CmakeLists.txt files or *.cmake files or a general
issue with cmake. Any pointers would be greatly appreciated.

I apologize if this is an answered question, I tried really hard to search
the archives, but searching for "--question" is futile, as the searches
return pretty much every question.
-- 

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] Help with GNU Make --question option

2018-11-13 Thread Alex Tzonkov
We are using cmake for our project and recently discovered that the
generated Makefiles do not seem to work correctly with the '--question' or
'-q' option. They always exit with return code '1' even if there are no
changes which would require rebuilding anything. I am not sure if this is
an issue with our CmakeLists.txt files or *.cmake files or a general issue
with cmake. Any pointers would be greatly appreciated.

I apologize if this is an answered question, I tried really hard to search
the archives, but searching for "--question" is futile, as the searches
return pretty much every question.
-- 

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] Using CMake for general scripting tasks?

2017-11-13 Thread Alex Turbov
Hi Sebastian,

Particularly I've used CMake "scripts" in some "build configurations" at
our CI server as a truly cross-platform scripting language for generic
tasks like download archive, check sha/md5, unpack it, do some file
operations... it works perfectly for Linux and Windows (it is why I chose
CMake %).

BTW, also I use it to talk to some REST API a little, but found lack of
setting arbitrary HTTP method... :( for simple requests it is fine, but
really soon it is not enough existed methods of `file` command... it is why
I'm thinking about to extend it (curl library used by CMake can do all that
I need)... but need to discuss first, cus I think `file` command is not a
suitable candidate for such kind of extension... (casting Brad King into
the thread %)

On Tue, Nov 14, 2017 at 12:39 AM, Sebastian Gniazdowski  wrote:

> Hello
> CMake has so many powerful features that I always suspected, that it can
> be used for tasks normally handled by Bash or sh. I've found following
> package manager written in CMake:
>
> https://docs.hunter.sh/en/latest/overview/what-is-it.html
>
> So I think this project confirms CMake's potential for handling general
> scripting tasks. However, it's hard to get some inspiration from Hunter,
> it's just a large collection of CMake packages focused on one specialized
> goal.
>
> But maybe someone used CMake for less specialized scripting tasks and
> would share? I'm writing Zsh plugin manager, Zplugin, and I want to
> integrate with CMake somehow, to get some swiss army knife features.
>
> --
> Sebastian Gniazdowski
> psprint /at/ zdharma.org
>
> --
>
> 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
-- 

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] Configuration packages & versioning for parallel installations

2017-09-06 Thread Alex Turbov
Hi,



On Thu, Sep 7, 2017 at 12:26 AM, Robert Dailey 
wrote:

> First obvious question is: Should this even be a concern?


Yes, definitely!


> The
> cmake-packages documentation doesn't really touch on versioning, but
> there are a couple of concerns I see when you want users to be able to
> install (with CMake) multiple versions of the same library
> side-by-side:
>

that is quite usual practice (at least for me) to have multiple versions
installed and (try) link my package w/ 'em.


>
> 1. The library files have to use VERSION or SOVERSION properties to
> affect their name (this needs to be consistent on all platforms)
>

I use versioned static libraries on all platforms (*NIX/Linux and Windows)
and dynamic in Windows only.
For linux dynamic libraries use traditional format `libblah.so.X.Y.Z`. (yea
w/ VERSION and SOVERSION properties)


> 2. Debug configurations should alter the name of the library (to
> support multi-configuration generators like Visual Studio, for the
> most part, but also useful to single-configuration generators)
>

I do it for Windows only... (just don't need it for linux, where I prefer a
single ocnifuration to be installed, just like most pakcages do in my
Gentoo).


> 3. Header file installation: How do you do versioning? How do you have
> a foo.h that is version 1.0, and a foo.h that is version 2.0? Does
> this even make sense?
>

Header files installed into `/usr/include/package-X.Y.Z/`, and exported
targets always know this (and set the corresponding INTERFACE properties)


>
> One approach I've taken so far is:
>
> 1. CMake scripts like config scripts and exported target scripts go
> under "share/libraryname-1.0/cmake"
>

yep, it would work... for linux personally I prefer
`/usr/lib/cmake/package-X.Y.Z/`


> 2. Library names follow a format like "libfoo-1.0.0", or
> "libfoo-1.0.0-debug" for debug versions of that same library.
>
>
Personally I use semantic versioning (http://semver.org) and 'SameMajor'
compatibility option work pretty fine for me even w/ dozen of
dependencies...


> I have no answer for include files.
> --
>
> 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
>
-- 

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] [cmake-developers] How should config packages handle components?

2017-09-06 Thread Alex Turbov
In my projects I always, have external dependencies with finder module
providing exported (imported in my project) targets, so my targets (one per
file) always have a list of `Vendor::target`. Some of them are mine (i.e.
your type 2 -- built by the same project).

I wrote a helper module and a function to write an additional
`blah-blah-target-depedencies.cmake`. And this is a little bit subtle
thing...
Normally, generated `blah-blah-target.cmake` (where the `blah-blah-target`
is the export name used in call to `install(EXPORT)`) to load all installed
configurations do the following:

  file(GLOB CONFIG_FILES "${_DIR}/blah-blah-target-*.cmake")


so my additional file would be loaded "automatically" :)

My helper function accepts a target name as the only parameter. First of
all, it collects all dependencies of the given target and classifies them
as internal (same project) and external. It prepares some variables and
finally, render a `blah-blah-target-dependencies.cmake` which is a result
of the combination of 3 templates:
0) a base, header+footer and conditionally "include" the next two
1) import internal dependencies
2) import external dependencies

Note templates have random string in final names, so being running
(loading) by the same script (`blah-blah-config.cmake`) won't interfere...

As for "prepared variables" there are the following:
* "internal dependencies" is just a list of target names... having a name
is enough to form a `blah-blah-target.cmake` name to be `include()`d, cuz
we really know where this file is installed
* for external dependencies the most important a list of packages, assuming
that the initial external (imported) target had the form of
`Vendor::target`, and `Vendor` in fact is a package name suitable as the
first argument to `find_package()`.
* other variables related to external targets have a variadic part based on
upcased name of the vendor. Example:

set(_blah_blah_PACKAGES ACE;Boost)
set(_blah_blah_ACE_VENDOR ACE)
set(_blah_blah_ACE_COMPONENTS ace;ssl)
set(_blah_blah_ACE_VERSION 5.7.5)
set(_blah_blah_BOOST_VENDOR Boost)
set(_blah_blah_BOOST_COMPONENTS
chrono;filesystem;program_options;thread)
set(_blah_blah_BOOST_VERSION 1.65.0)

Now about generated `*-config.cmake`. As one may guess it handle targets to
import as `COMPONENTS` of `find_package()`, where every component is an
exported target name. So this module just `include()` it and check if
target appeared:

# Find components if requested
set(blah_FOUND_COMPONENTS)
foreach(_module ${blah_FIND_COMPONENTS})
# TODO Avoid more than once find? (But be aware that is not a
trivial `if` and skip %-)
# TODO Make sure component is supported (exists)
include(
"${CMAKE_CURRENT_LIST_DIR}/blah-${_module}-targets.cmake"
OPTIONAL
RESULT_VARIABLE blah_${_module}_FOUND
)

if(blah_${_module}_FOUND AND TARGET Blah::${_module})
list(APPEND blah_FOUND_COMPONENTS ${_module})

# Add some interface properties to all found components
string(TOUPPER "${_module}" _module_id)
string(MAKE_C_IDENTIFIER "${_module_id}" _module_id)
set_target_properties(
Blah::${_module}
PROPERTIES
# Set compatible version usage requirement
INTERFACE_BLAH_VERSION_MAJOR "${BLAH_VERSION_MAJOR}"
# What package to find
INTERFACE_BLAH_${_module_id}_PACKAGE_NAME "blah"
)
set_property(
TARGET Blah::${_module}
APPEND PROPERTY
COMPATIBLE_INTERFACE_STRING BLAH_VERSION_MAJOR
)
unset(_module_id)

else()
set(blah_${_module}_FOUND NOTFOUND)

if (blah_FIND_REQUIRED_${_module})
list(APPEND blah_NOT_FOUND_REQUIRED_COMPONENTS ${_module})
else()
list(APPEND blah_NOT_FOUND_COMPONENTS ${_module})
endif()

endif()
endforeach()
unset(_module)

When all components checked call the final package found/not-found checker:

check_required_components(blah)

Yes, this particular implementation have obvious limitations to be named
"universal and generic", but it works few years for me w/o problems...
(however, I do some improvements from time to time %) It do not handle
"plain old library names"... and as I said, all my external packages
provide imported targets, where the Vendor name is the package name in
fact... so I don't care (while having no reason to improve it for this
case... maybe later %).

I'll attach my module (stripping not related and vendor specific parts) for
further inspiration... Feel free to ask for details (or more code, if
attached doesn't work... probably I miss some functions (from other parts
of my framework)).

Have fun! :)


On Tue, Sep 5, 2017 at 10:33 PM, Robert Dailey 
wrot

Re: [CMake] [cmake-developers] How should config packages handle components?

2017-09-01 Thread Alex Turbov
I've started to use CMake a quite long time ago, and do not search for
"standards" or "guidelines" anymore %)
But I could mention some chapters in the official documentation (in the
"Reference Manuals" section) which are really full of "secret knowledge",
but the problem is that they are too complicated for newcomers %) but
personally I read them many many times before and each time found smth
"new" to me :)

I would say that after a couple of years I started to feel comfortable w/
CMake -- when I've used almost all offered features in a different set of
platform and generators.

On Fri, Sep 1, 2017 at 9:49 PM, Robert Dailey 
wrote:

> On Fri, Sep 1, 2017 at 1:40 PM, Alex Turbov  wrote:
> > Hi Robert,
> >
> >
> > On Fri, Sep 1, 2017 at 9:21 PM, Robert Dailey 
> > wrote:
> >>
> >>
> >> One problem I thought of with the former (one big target.cmake with
> >> all import targets in there) is that if you only ask for a subset of
> >> components in find_package(), you will still get all of them since all
> >> imports are defined in a single file.
> >
> >
> > In my project I have a bunch of components and do one exported target per
> > component
> > exactly by the mentioned reason -- user didn't ask for others...
> >
> >>
> >> Does this go against any design
> >> principles?
> >
> >
> > As far as I know, there are no clear design principles :) (yet, at least
> > nowadays) -- at least doing
> > a lot of CMake projects since 2009, I've never seen an explicit list of
> them
> > %)
> > IMHO, there is a lack of "official guildelines" (or it is really hard to
> > search for 'em)
> >
> >> Assuming this really happens, are there any negative side
> >> effects?
> >
> >
> > I could see the impact on build time only in this case... and for me the
> > most obvious is increasing
> > time to process the lists (which is for some reasons really slow on
> Windows,
> > at least in our
> > build farm which uses vargant and VirtualBox images)
> > (but I don't have any particular numbers, cuz never implemented the first
> > approach)
>
> Thanks for the quick response. The "official guidelines" or "package
> standard" is really exactly what we need I think. What worries me the
> most is that it seems like this is deep knowledge that is stuck in the
> brains of folks like Brad King and David Cole. I think somehow getting
> a knowledge dump from them into a documentation page would be a
> valuable task. I think for something as complex and variable as
> packages in CMake (install process in general) deserves some
> standardization, because we need the ability to distinguish between
> practices that we should follow for legacy (backward compatibility)
> reasons, non-cmake project reasons, and fully "modern" cmake packages.
>
-- 

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] [cmake-developers] How should config packages handle components?

2017-09-01 Thread Alex Turbov
Hi Robert,


On Fri, Sep 1, 2017 at 9:21 PM, Robert Dailey 
wrote:

>
> One problem I thought of with the former (one big target.cmake with
> all import targets in there) is that if you only ask for a subset of
> components in find_package(), you will still get all of them since all
> imports are defined in a single file.


In my project I have a bunch of components and do one exported target per
component
exactly by the mentioned reason -- user didn't ask for others...


> Does this go against any design
> principles?


As far as I know, there are no clear design principles :) (yet, at least
nowadays) -- at least doing
a lot of CMake projects since 2009, I've never seen an explicit list of
them %)
IMHO, there is a lack of "official guildelines" (or it is really hard to
search for 'em)

Assuming this really happens, are there any negative side
> effects?
>

I could see the impact on build time only in this case... and for me the
most obvious is increasing
time to process the lists (which is for some reasons really slow on
Windows, at least in our
build farm which uses vargant and VirtualBox images)
(but I don't have any particular numbers, cuz never implemented the first
approach)




--
>
> 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-developers
>
-- 

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] How to install custom target

2017-07-25 Thread Alex Turbov
Hi list,

What is the "right" way to install a custom target, when you don't know the
result file name?
E.g. I have a sample project:

cmake_minimum_required(VERSION 3.9)
project(custom_target)

add_custom_target(
log ALL
COMMAND ${CMAKE_COMMAND} -E environment > sample-$.log
  )
# install(... ??? ...)

In a multi-configuration build, how can I get the resulting filename to use
`install(FILES...)` (as it recommended by CMake wiki) ??

Or is there any other way to use `install()` (maybe `TARGETS`...) ?

Best,
-- 

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] hang in FindDoxygen.cmake on ppc64le

2017-06-29 Thread Alex Turbov
> Linux does not understand '(' in name of files and directories; e.g.

actually it does. (and Bash != Linux). Anyway, just like a space symbol,
you can quote argument w/ braces:

$ mkdir -p '/tmp/Just Test (it)'

and everything will be fine. As for the code mentioned, all paths are
quoted here, so CMake should see the correct paths here.
To get more details please try to run cmake w/ `--trace-expand` and maybe
w/ `--trace-source=FindDoxygen.cmake` options.

On Mon, Jun 26, 2017 at 7:05 PM, Serban Maerean  wrote:

> Hi,
>
> I get a hang in the "file" command in FindDoxygen.cmake, on ppc64le:
>
> 103 set(_x86 "(x86)")
> 104 file(GLOB _Doxygen_GRAPHVIZ_BIN_DIRS
> 105   "$ENV{ProgramFiles}/Graphviz*/bin"
> 106   "$ENV{ProgramFiles${_x86}}/Graphviz*/bin"
> 107   )
> 108 unset(_x86)
>
> Linux does not understand '(' in name of files and directories; e.g.
>
> --> find /ProgramFiles(x86)/Graphviz*/bin
> -bash: syntax error near unexpected token `('
>
> and it appears the "file" command goes into a wild spin (never returns.)
>
> Can this be done only for Windows?  I notice some paths are added
> regardless of platform, even if they are specific to a single platform,
> which seems to be unecessary.
>
> Thanks,
>
>
> Serban Maerean
> HPC Tools
> T/L: 293-9770, Tel.: 845-433-9770
> E-mail: ser...@us.ibm.com
>
> --
>
> 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
>
-- 

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] How to set libcurl library path and the library name?

2017-04-27 Thread Alex Chen
There is an error in the FindCURL document of Cmake 3.8 (or prior versions).

It says

 

CURL_INCLUDE_DIRS   - where to find curl/curl.h, etc.

CURL_LIBRARIES  - List of libraries when using curl.

CURL_FOUND  - True if curl found.

CURL_VERSION_STRING - the version of curl found (since CMake 2.8.8)

 

But in fact it is looking for CURL_INCLUDE_DIR, not CURL_INCLUDE_DIRS.  If I 
set –DCURL_INCLUDE_DIRS, cmake cannot find libcurl’s header files.

 

Alex Chen

 

From: CMake  on behalf of Alex Chen 

Date: Thursday, April 27, 2017 at 5:14 PM
To: CMake 
Subject: [CMake] How to set libcurl library path and the library name?

 

Hi,

I am trying to build AWS CPP SDK for the iOS from downloaded source. The 
compilation seems to go well but it fails at link time.  My CMake invocation is

 

/Applications/CMake.app/Contents/bin/cmake -Wno-dev 
-DBUILD_ONLY=s3;s3-encryption 
-DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk
 -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_SYSTEM_NAME=Darwin 
-DCMAKE_SHARED_LINKER_FLAGS=-framework Foundation -framework Security 
-DCMAKE_EXE_LINKER_FLAGS=-framework Foundation -framework Security 
-DCMAKE_PREFIX_PATH=/Volumes/Workspace/Prebuilt/Release-iphoneos/libcurl 
-DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=-O3 
-DCMAKE_INSTALL_PREFIX=/Volumes/Workspace/AWS/CppSDK/1.0.101/iPhoneOS/arm64/Release
 -DBUILD_SHARED_LIBS=off -DCPP_STANDARD=14 
-DCURL_INCLUDE_DIR=/Volumes/Workspace/Prebuilt/Release-iphoneos/libcurl/include64
 -DCURL_LIBRARIES=libcurl_7.51 -DSTATIC_LINKING=1 -DTARGET_ARCH=Apple 
/Volumes/Workspace/FMSOURCE/Shared/AWS/CppSDK/aws-sdk-cpp-1.0.101

 

The output from CMake looks like it finds the include path of libcurl but no 
the library.

 

-- Found Git: /usr/bin/git (found version "2.11.0 (Apple Git-81)")

-- Building AWS libraries as static objects

fatal: Not a git repository (or any parent up to mount point /Volumes/Workspace)

Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

-- Building project version: 1.0.101

-- The CXX compiler identification is AppleClang 8.1.0.8020042

-- Check for working CXX compiler: 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++

-- Check for working CXX compiler: 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
 -- works

-- Detecting CXX compiler ABI info

-- Detecting CXX compiler ABI info - done

-- Detecting CXX compile features

-- Detecting CXX compile features - done

-- Found ZLIB: /usr/lib/libz.dylib (found version "1.2.8")

--   Zlib include directory: 
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/usr/include

--   Zlib library: /usr/lib/libz.dylib

-- Encryption: CommonCrypto

-- Http client: Curl

-- Found CURL: /usr/lib/libcurl.dylib (found version "7.51.0")

--   Curl include directory: 
/Volumes/Workspace/FMSOURCE/Shared/Prebuilt/Release-iphoneos/libcurl/include64

--   Curl library: /usr/lib/libcurl.dylib

-- Considering s3

-- Considering s3-encryption

-- The C compiler identification is AppleClang 8.1.0.8020042

-- Check for working C compiler: 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang

-- Check for working C compiler: 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
 -- works

-- Detecting C compiler ABI info

-- Detecting C compiler ABI info - done

-- Detecting C compile features

-- Detecting C compile features - done

-- Updating version info to 1.0.101

-- Custom memory management disabled

-- Configuring done

-- Generating done

 

The linking errors look like this:

 

[ 92%] Linking CXX executable aws-cpp-sdk-s3-integration-tests

ld: warning: ignoring file /usr/lib/libcurl.dylib, missing required 
architecture arm64 in file /usr/lib/libcurl.dylib (2 slices)

Undefined symbols for architecture arm64:

  "_curl_easy_cleanup", referenced from:

  Aws::Http::CurlHandleContainer::~CurlHandleContainer() in 
libaws-cpp-sdk-core.a(CurlHandleContainer.cpp.o)

  "_curl_easy_getinfo", referenced from:

  Aws::Http::CurlHttpClient::MakeRequest(Aws::Http::HttpRequest&, 
Aws::Utils::RateLimits::RateLimiterInterface*, 
Aws::Utils::RateLimits::RateLimiterInterface*) const in 
libaws-cpp-sdk-core.a(CurlHttpClient.cpp.o)

  "_curl_easy_init", referenced from:

  Aws::Http::CurlHandleContainer::CheckAndGrowPool() in 
libaws-cpp-sdk-core.a(CurlHandleContainer.cpp.o)

  "_curl_easy_perform", referenced from:

  Aws::Http::CurlHttpClient::MakeRequest(Aws::Http::HttpRequest&, 
Aws::Utils::RateLimits::RateLimiterInterface*, 
Aws::Utils::RateLimits::RateLimiterInterface*) const in 
libaws-cpp-sdk-core.a(CurlHttpClient.cpp.o)

  "_curl_easy_reset", referenced from:


[CMake] How to set libcurl library path and the library name?

2017-04-27 Thread Alex Chen
eContainer::ReleaseCurlHandle(void*) in 
libaws-cpp-sdk-core.a(CurlHandleContainer.cpp.o)

  Aws::Http::CurlHandleContainer::SetDefaultOptionsOnHandle(void*) in 
libaws-cpp-sdk-core.a(CurlHandleContainer.cpp.o)

  "_curl_global_cleanup", referenced from:

  Aws::Http::CurlHttpClient::CleanupGlobalState() in 
libaws-cpp-sdk-core.a(CurlHttpClient.cpp.o)

  "_curl_global_init", referenced from:

  Aws::Http::CurlHttpClient::InitGlobalState() in 
libaws-cpp-sdk-core.a(CurlHttpClient.cpp.o)

  "_curl_slist_append", referenced from:

  Aws::Http::CurlHttpClient::MakeRequest(Aws::Http::HttpRequest&, 
Aws::Utils::RateLimits::RateLimiterInterface*, 
Aws::Utils::RateLimits::RateLimiterInterface*) const in 
libaws-cpp-sdk-core.a(CurlHttpClient.cpp.o)

  "_curl_slist_free_all", referenced from:

  Aws::Http::CurlHttpClient::MakeRequest(Aws::Http::HttpRequest&, 
Aws::Utils::RateLimits::RateLimiterInterface*, 
Aws::Utils::RateLimits::RateLimiterInterface*) const in 
libaws-cpp-sdk-core.a(CurlHttpClient.cpp.o)

ld: symbol(s) not found for architecture arm64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

make[2]: *** 
[aws-cpp-sdk-s3-integration-tests/aws-cpp-sdk-s3-integration-tests] Error 1

make[1]: *** 
[aws-cpp-sdk-s3-integration-tests/CMakeFiles/aws-cpp-sdk-s3-integration-tests.dir/all]
 Error 2

make: *** [all] Error 2

 

Thanks for any help you can provide

 

Alex Chen

 

-- 

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] Overriding the include path, library path of OpenSSL, Zlib and libcurl

2017-04-21 Thread Alex Chen
Although cmake uses the path I supplied for OpenSSL and Zlib, I do not see the 
–I flag being used in compiling the code. (I set VERBOSE=1 to make to see what 
it does.)

When I run ‘ldd’ against the resulting .so files, reference to libssl.so or 
libcrypto.so is empty, i.e ‘libssl.so => not found’, but libz.so still links to 
/lib64/libz.so. (It seems to ignore the fact it does find a new path of zlib.)

 

How to I set the linker flag, i.e. –L and –Wl,-rpath=$myLibPath ?

 

Alex Chen

 

From: CMake  on behalf of Alex Chen 

Date: Friday, April 21, 2017 at 10:28 AM
To: CMake 
Subject: Re: [CMake] Overriding the include path, library path of OpenSSL, Zlib 
and libcurl

 

Thanks for the help.  I will try that. 

 

Alex Chen

 

From: Michael Ellery 
Date: Thursday, April 20, 2017 at 8:13 PM
To: Alex Chen 
Cc: CMake 
Subject: Re: [CMake] Overriding the include path, library path of OpenSSL, Zlib 
and libcurl

 

It doesn’t look like that find module directly supports HINTS or PATHS, so you 
can try setting CMAKE_LIBRARY_PATH and CMAKE_INCLUDE_PATH  
(https://cmake.org/cmake/help/v3.7/variable/CMAKE_LIBRARY_PATH.html) before 
calling the curl finder. I think you can add to those variables whatever paths 
are appropriate to search for CURL on your systems.

 

-Mike

 

On Apr 20, 2017, at 6:06 PM, Alex Chen  wrote:

The source code I want to compile on Linux uses ‘FindOpenSSL’, ‘FindZLIB’, and 
‘FindCURL’ to resolve the paths of these libraries.

However, I have newer version of these libraries in different locations.  How 
to I override these to use my paths?

I am able to use OPENSSL_ROOT_DIR, from FindOpenSSL module, and ZLIB_ROOT, from 
FindZLIB module, to override the paths.  

But I cannot find anything in FindCURL module to override the path of libcurl.

  

  

Alex Chen

-- 

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

 

 

-- 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 

-- 

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] Overriding the include path, library path of OpenSSL, Zlib and libcurl

2017-04-21 Thread Alex Chen
Thanks for the help.  I will try that. 

 

Alex Chen

 

From: Michael Ellery 
Date: Thursday, April 20, 2017 at 8:13 PM
To: Alex Chen 
Cc: CMake 
Subject: Re: [CMake] Overriding the include path, library path of OpenSSL, Zlib 
and libcurl

 

It doesn’t look like that find module directly supports HINTS or PATHS, so you 
can try setting CMAKE_LIBRARY_PATH and CMAKE_INCLUDE_PATH  
(https://cmake.org/cmake/help/v3.7/variable/CMAKE_LIBRARY_PATH.html) before 
calling the curl finder. I think you can add to those variables whatever paths 
are appropriate to search for CURL on your systems.

 

-Mike

 

On Apr 20, 2017, at 6:06 PM, Alex Chen  wrote:

The source code I want to compile on Linux uses ‘FindOpenSSL’, ‘FindZLIB’, and 
‘FindCURL’ to resolve the paths of these libraries.

However, I have newer version of these libraries in different locations.  How 
to I override these to use my paths?

I am able to use OPENSSL_ROOT_DIR, from FindOpenSSL module, and ZLIB_ROOT, from 
FindZLIB module, to override the paths.  

But I cannot find anything in FindCURL module to override the path of libcurl.

  

  

Alex Chen

-- 

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

 

 

-- 

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] Overriding the include path, library path of OpenSSL, Zlib and libcurl

2017-04-20 Thread Alex Chen
The source code I want to compile on Linux uses ‘FindOpenSSL’, ‘FindZLIB’, and 
‘FindCURL’ to resolve the paths of these libraries.

However, I have newer version of these libraries in different locations.  How 
to I override these to use my paths?

I am able to use OPENSSL_ROOT_DIR, from FindOpenSSL module, and ZLIB_ROOT, from 
FindZLIB module, to override the paths.  

But I cannot find anything in FindCURL module to override the path of libcurl.

 

 

Alex Chen

-- 

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] How to set C++ standard?

2017-04-20 Thread Alex Chen
Thanks.  I find the problem in the source code where it uses CPP_STANDARD as 
suffix in –std=c++, therefore I should set CPP_STANDARD instead of the other 
one.

 

 

Alex Chen

 

From: Craig Scott 
Date: Thursday, April 20, 2017 at 4:41 PM
To: Alex Chen 
Cc: CMake 
Subject: Re: [CMake] How to set C++ standard?

 

You generally shouldn't set CMAKE_CXX_STANDARD on its own, you should also be 
explicitly setting CMAKE_CXX_STANDARD_REQUIRED and CMAKE_CXX_EXTENSIONS to 
ensure you are getting the behaviour you want. These would also typically be 
set by the project's own CMakeLists.txt file rather than being passed on the 
cmake command line as cache variables. You may find the following article 
helpful:

 

https://crascit.com/2015/03/28/enabling-cxx11-in-cmake/

 

 

 

On Fri, Apr 21, 2017 at 8:57 AM, Alex Chen  wrote:

I tried to set the compiler flag –std=c++14 via cmake command line on Linux 
with –DCMAKE_CXX_STANDARD=14.  The message from ‘make’ shows   -std=c++11 
–std=gnu++14

If I do not set that flag, I get -std=c++11.  This seem to imply the 
CMAKE_CXX_STANDARD flag sets gnu++ instead of c++.  How do I set the flag 
–std=c++14 then?

 

Alex Chen


--

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



 

-- 

Craig Scott

Melbourne, Australia

https://crascit.com

-- 

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] How to set C++ standard?

2017-04-20 Thread Alex Chen
I tried to set the compiler flag –std=c++14 via cmake command line on Linux 
with –DCMAKE_CXX_STANDARD=14.  The message from ‘make’ shows   -std=c++11 
–std=gnu++14

If I do not set that flag, I get -std=c++11.  This seem to imply the 
CMAKE_CXX_STANDARD flag sets gnu++ instead of c++.  How do I set the flag 
–std=c++14 then?

 

Alex Chen

-- 

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] CPack: avoid creating unnecessary man dirs

2016-10-29 Thread Alex Turbov
set `CPACK_INSTALL_PREFIX` to `/usr`... by default it set to
`CMAKE_INSTALL_PREFIX` which is `/usr/local` if you don't set it at `cmake`
run


On Sun, Oct 30, 2016 at 2:39 AM, Robert J. Hansen 
wrote:

> > Use `|CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION` to add a man's dir
> > to 'exclude' list, so RPM package wouldn't have a dir, but files from
> > it... so it wouldn't conflict w/ `filesystem` package.
>
> Thank you; that solved one problem and exposed another.
>
> In my old Autotools build, I used preprocessor defines to set at
> compile-time where the binary should look for its data files.  In my
> top-level CMakeLists.txt I set a CMake variable as:
>
> set(PKGDATADIR ${CMAKE_INSTALL_FULL_DATADIR}/nsrlsvr)
>
> And in src/CMakeLists.txt I set the preprocessor define:
>
> add_definitions(-DPKGDATADIR="${PKGDATADIR}")
>
> When I build the RPM and install it, though, something weird happens:
>
> [rjh@localhost nsrlsvr]$ /usr/bin/nsrlsvr --help
> nsrlsvr options:
>   ... (output omitted) ...
>   -f [ --file ] arg (=/usr/local/share/nsrlsvr/hashes.txt)
> hash file
>
> The default argument for -f is not /usr/share/nsrlsvr/hashes.txt, as it
> should be for an RPM, but /usr/local/share/nsrlsvr/hashes.txt, as if it
> were a locally-compiled package.
>
> My first thought was that I should replace CMAKE_INSTALL_FULL_DATADIR
> with CMAKE_INSTALL_DATADIR, but that was also less than useful:
>
> nsrlsvr options:
>   ... (output omitted) ...
>   -f [ --file ] arg (=share/nsrlsvr/hashes.txt)
> hash file
>
> How can I fix this?
>
> ("Have your code use a relative offset from where the binary is located"
> is an acceptable answer; I'm hoping there's a better one, though!)
> --
>
> 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
>
-- 

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] CPack: avoid creating unnecessary man dirs

2016-10-29 Thread Alex Turbov
Use `CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION` to add a man's dir to
'exclude' list, so RPM package wouldn't have a dir, but files from it... so
it wouldn't conflict w/ `filesystem` package.

On Sun, Oct 30, 2016 at 12:14 AM, Robert J. Hansen 
wrote:

> I'm migrating a project from Autotools to CMake.  So far it's been a
> good experience save for installing manpages.
>
> I'm using include(GNUInstallDirs) to help make the migration easier.  In
> my manpage subdir I have the following CMakeLists.txt:
>
> set(MAN_NAMES nsrlsvr.1 nsrlupdate.1)
> add_custom_target(man ALL DEPENDS ${MAN_NAMES})
> install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/nsrlsvr.1 DESTINATION
> ${CMAKE_INSTALL_MANDIR}/man1/)
> install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/nsrlupdate.1 DESTINATION
> ${CMAKE_INSTALL_MANDIR}/man1/)
>
> This seems to work just fine for a "make install", and it successfully
> generates RPMs with a "make package".  However, those RPMs are
> uninstallable on a Fedora system:
>
> Error: Transaction check error:
>   file /usr/share/man from install of nsrlsvr-1.6.1-1.x86_64 conflicts
> with file from package filesystem-3.2-37.fc24.x86_64
>   file /usr/share/man/man1 from install of nsrlsvr-1.6.1-1.x86_64
> conflicts with file from package filesystem-3.2-37.fc24.x86_64
>
> Apparently, CMake is trying to create dirs even if they already exist.
> Is there any way to suppress this?  What's the best way to address this?
>
> (The full source tree, along with all the CMakeLists.txt files, is
> available at https://github.com/rjhansen/nsrlsvr/ )
> --
>
> 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
>
-- 

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] Protobufs and nested file structure

2016-10-12 Thread Alex Shaver
(cmake 3.5, but tested from repo and had same issue, generating UNIX
Makefiles, protobuf 3)

When I have protobufs more than one folder deep (eg, folder with cmake has
folder with protobufs and another folder which also has more protobufs),
cmake has some trouble generating the correct make files.

Suppose in my folder 'protos' with the CMakeLists.txt that generates from
protobuf, I have folders Alpha and Beta. Beta contains Ball.proto; Alpha
contains Axle.proto and folder Aleph with Anchor.proto. When CMake
generates the build directory for protos, it puts Ball.pb.{h,cpp} and
Axle.pb.* in the top level of the protos build folder, a folder Aleph with
Anchor.pb.* . However, the make instructions look for Anchor.pb.* in the
top-level folder, and it fails to find Anchor.pb.cpp for Anchor.pb.o . If I
go in and manually edit the failing line of the make file, make is
successful.

Second, supposing within these directories there are two messages with the
same name, but belonging to separate protobuf 'packages.' CMake complains
that it has already generated a build rule for the given protobuf. I think
this shares the same root issue of cmake respecting nested folder
structures within.

I can think of various solutions to these problems on my end, but it would
be ideal not to have to rearrange the file structure, nor build many
subprojects linked together. Is there a way to get cmake to reproduce the
existing file structure and build as one project?

Alex
-- 

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] add_compile_options query

2016-08-12 Thread Alex Biddulph
Hi,

I am trying to add some GCC compiler optimisation flags using the 
add_compile_options directive but am running into some issues due to the nature 
of the flags.

There are 3 flags that I am trying to set:
--param l1-cache-size=24
--param l1-cache-line-size=64
--param l2-cache-size=512

If I try to add these as:
add_compile_options(--param l1-cache-size=24)
add_compile_options(--param l1-cache-line-size=64)
add_compile_options(--param l2-cache-size=512)

Then the resulting portion of the command line is: 
--param l1-cache-size=24 l1-cache-line-size=64 l2-cache-size=512

That is, only one of the '--param's is maintained, but all 3 need to be 
maintained in order for GCC to understand the flags.

Is it possible to use add_compile_options to set these flags? Or is there 
another more effective method? I would like to avoid adding them to CFLAGS and 
CXXFLAGS if at all possible.

Thanks in advance,
Alex
-- 

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] FindwxWidgets can't find wxWidgets installed by MSYS2

2015-10-16 Thread Alex Zelid
Hello,

I'm using mingw-w64 installed by MSYS2 (https://msys2.github.io/)

wxWidgets .dlls are installed in C:\msys64\mingw32\bin
libs in C:\msys64\mingw32\lib

My CMakeList.txt:
---
SET(myapp1_SRCS main.cpp)
add_executable(${PROJECT_NAME} ${myapp1_SRCS})

set(BUILD_SHARED_LIBS 0)

#Set Linker flags
set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++ -static")

find_package(PNG REQUIRED)
include_directories(${PNG_INCLUDE_DIR})
message(STATUS "LibPNG package was found with include dir:
'${PNG_INCLUDE_DIRS}'")
find_package(Threads REQUIRED)
SET(wxWidgets_USE_STATIC ON)
SET(wxWidgets_WXCONFIG_OPTS "--static=yes")
find_package( wxWidgets REQUIRED html adv core base net aui xrc qa richtext)
include(${wxWidgets_USE_FILE})

target_link_libraries(${PROJECT_NAME} ${PNG_LIBRARY}
${CMAKE_THREAD_LIBS_INIT} ${wxWidgets_LIBRARIES})
---

When I generate "MinGW Makefiles" from windows CMD (not from MSYS2
terminal) CMake finds PNG but doesn't fine wxWidgets:

C:\msys64\home\Alex\workspace\_cmake\wxdemo1\build-mingw32>cmake -G "MinGW
Makefiles" ..\master
-- The C compiler identification is GNU 5.2.0
-- The CXX compiler identification is GNU 5.2.0
-- Check for working C compiler: C:/msys64/mingw32/bin/gcc.exe
-- Check for working C compiler: C:/msys64/mingw32/bin/gcc.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:/msys64/mingw32/bin/g++.exe
-- Check for working CXX compiler: C:/msys64/mingw32/bin/g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found ZLIB: C:/msys64/mingw32/lib/libz.dll.a (found version "1.2.8")
-- Found PNG: C:/msys64/mingw32/lib/libpng.dll.a (found version "1.6.18")
-- LibPNG package was found with include dir:
'C:/msys64/mingw32/include;C:/msys64/mingw32/include'
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE
CMake Error at
C:/msys64/mingw32/share/cmake-3.3/Modules/FindPackageHandleStandardArgs.cmake:148
(message):
  Could NOT find wxWidgets (missing: wxWidgets_FOUND)
Call Stack (most recent call first):

C:/msys64/mingw32/share/cmake-3.3/Modules/FindPackageHandleStandardArgs.cmake:388
(_FPHSA_FAILURE_MESSAGE)
  C:/msys64/mingw32/share/cmake-3.3/Modules/FindwxWidgets.cmake:871
(FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  myapp1/CMakeLists.txt:26 (find_package)


-- Configuring incomplete, errors occurred!
See also
"C:/msys64/home/Alex/workspace/_cmake/wxdemo1/build-mingw32/CMakeFiles/CMakeOutput.log".


It happens because wxWidgets are placed in non-standard for mingw version
of wxWidgets path.

I've also tried cmake -DwxWidgets_ROOT_DIR=C:/msys64/mingw32
-DwxWidgets_LIB_DIR=C:/msys64/mingw32/lib -G "MinGW Makefiles" ..\master
it gave the same error

How to make FindwxWidgets work in that case?

Thanks,
Alex
-- 

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] How to do that w/o LOCATION property of a target...

2015-09-04 Thread Alex Turbov
Hi,

in my project I have `add_executable()`. after that, in a current binary
dir I need to render a `*.cmake` script (via `configure_file()`) to be
running from `add_test()` (as `cmake -P`) which should start just the
compiled executable via `execute_process()` and capture its output (to be
processed by followed commands)...

the problem is: how to render an absolute path to the compiled executable
inside the generated `*.cmake` script ??
0) access to LOCATION target property is prohibited from CMakeLists.txt, so
I can't set it into a generated script
1) generator expressions don't work w/ `configure_file()`

any other idea?
-- 

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] Unable to set configuration name with a hyphen char

2015-06-18 Thread Alex Iljin
Hi.

I try to set a custom configurations like "Debug-Demo" and "Release-Demo".

I had used a snippet from wiki:
http://www.cmake.org/Wiki/CMake_FAQ#How_can_I_specify_my_own_configurations_.28for_generators_that_allow_it.29_.3F
with additional modifying DEBUG_CONFIGURATIONS, because the "Debug-Demo"
configuration should be linked with debug version of libraries.

if(CMAKE_CONFIGURATION_TYPES)
set(CMAKE_CONFIGURATION_TYPES Debug Release Debug-Demo Release-Demo)
set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING
"Reset the configurations to what we need"
FORCE)
set_property(GLOBAL PROPERTY DEBUG_CONFIGURATIONS "Debug;Debug-Demo")
endif()

But what I got is bunch of errors at generation time.
CMake Error: Error evaluating generator expression: $

If I delete the "set_property" line, I get Debug-Demo configuration which
is kind of optimized configuration (as default).

So, does I have missed some notes about using a hyphen chars in
configuration names, or is it a bug in the cmake?

Alexander Iljin
-- 

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] Why change option in Cmake -GUI does not require re-configuration?

2013-11-20 Thread Alex Malyushytskyy
Is this expected behavior?
I remember using old version and update of the variable in the gui leaded
to disabling generate button

Alex


On Mon, Nov 18, 2013 at 4:31 PM, Alex Malyushytskyy wrote:

> I downloaded CMake 2.8.12 and faced the following behavior with Cmake
> -GUI  which can be reproduced  if:
>
> After initial configuration click configurations until all options are not
> marked as red.
> Then change one the options.
>
> Now you are able to click Generate and skip Configure.
>
> This leads to the wrong project file generated , if last changed option
> was incompatible with previously set options.
>
> This does not happen with ccmake., which enforces configuration after any
> change.
>
> It looks like as a bug to me.
>
> Regards,
>
> Alex
>
--

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

[CMake] Why change option in Cmake -GUI does not require re-configuration?

2013-11-18 Thread Alex Malyushytskyy
I downloaded CMake 2.8.12 and faced the following behavior with Cmake -GUI
which can be reproduced  if:

After initial configuration click configurations until all options are not
marked as red.
Then change one the options.

Now you are able to click Generate and skip Configure.

This leads to the wrong project file generated , if last changed option was
incompatible with previously set options.

This does not happen with ccmake., which enforces configuration after any
change.

It looks like as a bug to me.

Regards,

Alex
--

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

[CMake] Problem with CMAKE_C_LINK_EXECUTABLE and LINK_LIBRARIES

2012-10-10 Thread Alex Caudill
Hi,

I've set CMAKE_C_LINK EXECUTABLE like so:

set(CMAKE_C_LINK_EXECUTABLE "/usr/bin/ld -nostdlib -dynamic-linker
/lib/ld-musl-i386.so.1  
${CMAKE_BINARY_DIR}/lib/crt1.o 
${CMAKE_BINARY_DIR}/lib/crtn.o -o  ")

I did this because I'm building against a new C library. The problem
is that LINK_LIBRARIES is populated by a -Wl,-rpath stanza that breaks
things. How can I work around this?

Thanks!
--

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] build using separate compiler,assembler,linker

2012-02-07 Thread Alex
Hi all,
Since some days I’m trying to build a toolchain for crosscompiling but 
I stuck so far while trying to execute a buildprocess with two stages. 
According to a makefile I use as template, the processing looks as follows:

Given some .c sourcefiles the makefile executes:

Invoking: Compiler
CTC.EXE mcs0.c –I… --Flags… -o MCS0.src

Invoking: Assembler
ASTC.EXE MCS0.src –Flags… -o MCS0.o

Invoking: Linker
LTC.EXE MCS0.o … librt.a … -I –Flags… -L… 

I create a toolchain file and also some platform configuration for 
compiler and assembler. However I have in particular a problem to invoke the 
assembler. 
That is, when calling add_executable with the c-files as arguments the 
src-files 
are generated. But these files are fed to the linker without the intermediate 
step to build the object files. Of course the linker says ‘unknown file format’.
 
I have tried to provide an assembler configuration that is enabled 
with enable_language before, but this works only for src-files that are 
provided 
to the add_executable() instead of the c-files (c->src with a custom 
target before, calling the compiler). The assembler is not applied to the 
automatically generated .src files in the first step … that means if I 
provide (for testing) some c-files and some src-files, both are processed 
correctly, 
but not the src-files resulting from the compiler during the build of the 
target.

My third option was to implement both the compiler and assembler call 
by means of custom target … however .. don’t’ work until now 
and seems more or less the ugly solution.
 
Has anyone experience with this kind of building … without using custom 
targets? 
What is the general method to enable such two-step build process? 
My goal is to provide a toolchain-configuration with the specification 
of assembler, compiler, linker and archiver … for me is also not completely 
clear 
how to enable an assembler like the compiler with CMAKE_C_COMPILER. 
E.g. CMAKE_C_CREATE_ASSEMBLY_SOURCE has no effect on my configuration.

So far I did not found a comprehensive documentation of this feature(s), even 
in the cmake-book. Therefore I would be very thankfull for any kind of 
information ;-) 

Cu, Alex
--

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] link library paths

2012-02-03 Thread Alex Olivas

On 02/03/2012 12:43 AM, Andreas Pakulat wrote:

On 02.02.12 18:37:03, Alex Olivas wrote:

I don't know what the issue was, but it's fixed in a later version.
I upgraded from 2.8.2 to 2.8.7 and the problem went away.

So when you say my linker-line is wrong, you mean in the
verbose output there's no '-L/usr/lib' passed to ld, right?

No, the error is to use -llibfoo, the linker then searches for a file
called liblibfoo.so which does not not exist. But as I said, if you pass
absolute paths to CMake it usually uses them (I'm not sure right now
about that when the directory is a system-link-directory)

Ah right.  Missed that.

Or is there something wrong with my cmake file, other than
the use of link_directories?

My guess would've been for the setting of the shared-lib prefix, maybe
thats whats causing the older CMake version to generate a -llibfoo
argument for the linker.

So I switched back to 2.8.2 and commented out the line that sets
the shared-lib prefix and it works.  Then I added the following line
to get the name right :

set_target_properties(python_qt PROPERTIES PREFIX "")

...which I think is much better ( and likely preferred ) and works
with both versions.
Thanks for the help,
Alex.
--

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] link library paths

2012-02-02 Thread Alex Olivas

I don't know what the issue was, but it's fixed in a later version.
I upgraded from 2.8.2 to 2.8.7 and the problem went away.

So when you say my linker-line is wrong, you mean in the
verbose output there's no '-L/usr/lib' passed to ld, right?
Or is there something wrong with my cmake file, other than
the use of link_directories?
Thanks,
Alex.


On 2/2/12 4:35 PM, Andreas Pakulat wrote:

On 02.02.12 11:51:11, Alex Olivas wrote:

I'm trying to link to libraries located in /usr/lib.  This
is a very simple example using boost::python and Qt.

Here's my cmake file : http://codepad.org/tZxBzXVP

I added the link_directories command only after the initial
link failed.

Using link_directories is almost always wrong. Especially for a standard
directory like /usr/lib. Also Boost_INCLUDE_DIRS is most certainly not a
directory containing shared libs.

Can you post the linker line without link_directories? Maybe also try to
remove the unsetting of the shared-lib prefix. The linker-line you
posted is wrong, but normally CMake will use absolute paths in the
linker-line, so something causes it to not do this.

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


--

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] link library paths

2012-02-02 Thread Alex Olivas

I'm trying to link to libraries located in /usr/lib.  This
is a very simple example using boost::python and Qt.

Here's my cmake file : http://codepad.org/tZxBzXVP

I added the link_directories command only after the initial
link failed.

The docs say this is rarely needed since find_package returns
absolute paths and these should be passed to target_link_libraries.
As far as I can this is exactly what FindQt4 returns and is
what's passed to target_link_libraries.  Here's the output
of the link command : http://codepad.org/lZg8N3l0

Output of the message commands :

Running CMake to regenerate build system...
QT_LIBRARIES = /usr/lib/libQtGui.so;/usr/lib/libQtCore.so
QT_LIBRARY_DIR = /usr/lib

Any ideas?
Thanks,
Alex.
--

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] Complete rebuild after svn update

2010-10-18 Thread Alex Brooks
> Have you checked the Makefiles which CMake creates
> to see if there are any surprising dependencies
> which could be causing the large extent of the recompile.

Do you mean CMakeFiles/Xxx.dir/depend.cmake ?
Yes, I checked these -- nothing interesting here.

Actually I've just figured out the problem.  Someone had added some CMake code 
that adds a definition setting the svn version number (using add_definitions).  
This gets called from the top level.  So every svn update results in a new 
"-DXxxx", and therefore every source file is re-compiled.


Alex


> Alex Brooks wrote:
> > Thanks for the quick responses.
> > Comments inline:
> > 
> > Eric:
> >> May be svn is the culprit.
> >> 
> >> Did you have a look at the timestamp of the file/directory enclosing
> >> (and up) the
> >> changed CMakeLists.txt after the svn update?
> >> 
> >> May be a single change inside a directory change the timestamp
> >> of a set of file?
> > 
> > When an svn update pulls in a change to a CMakeLists.txt file, the
> > following
> > 
> > timestamps are updated:
> >  1. the timestamp of the CMakeLists.txt file itself, and
> >  2. the timestamp of the directory.
> > 
> > If I manually do a 'touch CMakeLists.txt', it changes the timestamp of
> > the file itself but not the directory.
> > 
> > I don't know why this might cause a complete rebuild.
> > If I manually do 'touch .; touch CMakeLists.txt; make' somewhere in the
> > source tree, it doesn't force a rebuild.
> > 
> >> Another option may be that this particular CMakeLists.txt is generating
> >> (using configure_file) some file that is [indirectly] included by many
> >> other?
> > 
> > I've looked for this kind of thing.  Files which do not depend on any
> > dynamically-generated files also get rebuilt.
> > 
> >> May be you can have look at the dependencies in
> >> CMakeFiles/Makefile.cmake
> > 
> > I don't have this file, but I have CMakeFiles/Xxx.dir/depend.cmake.
> > Here's a sample:
> > 
> > # CMAKE generated file: DO NOT EDIT!
> > # Generated by "Unix Makefiles" Generator, CMake Version 2.8
> > 
> > orca/src/hydrolibs/hydrodll/CMakeFiles/HydroDll.dir/dll.cpp.o:
> > orca/src/hydrolibs/hydrodll/dll.cpp
> > orca/src/hydrolibs/hydrodll/CMakeFiles/HydroDll.dir/dll.cpp.o:
> > orca/src/hydrolibs/hydrodll/dll.h
> > orca/src/hydrolibs/hydrodll/CMakeFiles/HydroDll.dir/dll.cpp.o:
> > orca/src/hydrolibs/hydrodll/exceptions.h
> > 
> > In this case, when a rebuild is forced I always see dll.cpp.o get rebuilt
> > (despite no changes to dll.h/dll.cpp/exceptions.h)
> > All of these files are written by hand, not are generated using
> > configure_file.
> > 
> > Marcel:
> >> Or do you use keyword expansion in your CMakeLists.txt file. Keywords,
> >> like $Id$, $Author$, etc. are a relict from CVS, but still supported by
> >> Subversion, though you have to explicitly activate it using properties.
> > 
> > No, I don't use anything like this.  If I diff the files mentioned in
> > e.g. the "hydrodll" directory above, there are no changes (and the
> > timestamps haven't moved).  But an svn update to an unrelated directory
> > causes a rebuild.
> > 
> > 
> > Any other ideas?
> > ___
> > 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
> 
> ___
> 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

-- 
--
Dr Alex Brooks

Marathon Targets Pty Ltd
National Innovation Centre
4 Cornwallis Street
Eveleigh, NSW 2015
Sydney, Australia
Ph: +61 2 9209 4021
Web: www.marathon-targets.com
--
___
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] Complete rebuild after svn update

2010-10-18 Thread Alex Brooks
Thanks for the quick responses.
Comments inline:

Eric:

> May be svn is the culprit.
> 
> Did you have a look at the timestamp of the file/directory enclosing
> (and up) the
> changed CMakeLists.txt after the svn update?
>
> May be a single change inside a directory change the timestamp
> of a set of file?

When an svn update pulls in a change to a CMakeLists.txt file, the following 
timestamps are updated:
 1. the timestamp of the CMakeLists.txt file itself, and
 2. the timestamp of the directory.

If I manually do a 'touch CMakeLists.txt', it changes the timestamp of the file 
itself but not the directory.

I don't know why this might cause a complete rebuild.
If I manually do 'touch .; touch CMakeLists.txt; make' somewhere in the source 
tree, it doesn't force a rebuild.
 
> Another option may be that this particular CMakeLists.txt is generating
> (using configure_file) some file that is [indirectly] included by many
> other?

I've looked for this kind of thing.  Files which do not depend on any 
dynamically-generated files also get rebuilt.
 
> May be you can have look at the dependencies in
> CMakeFiles/Makefile.cmake

I don't have this file, but I have CMakeFiles/Xxx.dir/depend.cmake.
Here's a sample:

# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 2.8

orca/src/hydrolibs/hydrodll/CMakeFiles/HydroDll.dir/dll.cpp.o: 
orca/src/hydrolibs/hydrodll/dll.cpp
orca/src/hydrolibs/hydrodll/CMakeFiles/HydroDll.dir/dll.cpp.o: 
orca/src/hydrolibs/hydrodll/dll.h
orca/src/hydrolibs/hydrodll/CMakeFiles/HydroDll.dir/dll.cpp.o: 
orca/src/hydrolibs/hydrodll/exceptions.h

In this case, when a rebuild is forced I always see dll.cpp.o get rebuilt 
(despite no changes to dll.h/dll.cpp/exceptions.h)
All of these files are written by hand, not are generated using configure_file.


Marcel:

> Or do you use keyword expansion in your CMakeLists.txt file. Keywords,
> like $Id$, $Author$, etc. are a relict from CVS, but still supported by
> Subversion, though you have to explicitly activate it using properties.

No, I don't use anything like this.  If I diff the files mentioned in e.g. the 
"hydrodll" directory above, there are no changes (and the timestamps haven't 
moved).  But an svn update to an unrelated directory causes a rebuild.


Any other ideas?
___
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] Complete rebuild after svn update

2010-10-18 Thread Alex Brooks
Hi,

I have a problem where cmake decides to rebuild my entire source tree when an 
svn update pulls in a change to a CMakeLists.txt file.

I have a fairly complicated build tree with a number of sub-libraries etc.  
The whole thing takes something like an hour to build, so it's a big chunk out 
of my day.

I tried a few things to characterise the problem:
  - If I locally touch CMakeLists.txt files, or even make non-trivial changes, 
cmake does the correct thing and just rebuilds what is necessary.
  - If an svn update pulls in a changes to .h or .cpp files, cmake again does 
the correct thing.
  - If an svn update pulls in even a trivial change (e.g. a change to a 
comment), cmake rebuilds every single source file.

I've run out of ideas about how to characterise the problem better, does 
anyone have any ideas what the problem might be, or what to do next to track 
it down further?

My CMake version is 2.8.2, and I'm using Makefiles on Linux.


Thanks in advance,

Alex
___
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] FindCUDA - creating .ptx and .cubin files as final build target

2010-09-11 Thread Alex G
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

> 
> Alex, thanks for your interest.  There is an option called
> CUDA_BUILD_CUBIN, which builds the cubin along with the OBJ file, but it
> appears to be disabled for PTX compilation.  I'm not exactly sure why,
> and I even wrote it! 
> 
> I'm in the process of adding a new target type to the CUDA_WRAP_SRCS
> macro which currently only supports OBJ and PTX to support CUBINs.  In
> the mean time, you have two options:
> 
> If you want to modify FindCUDA.cmake, you can edit the following lines
> (around line 1049 - depending on your version):
> 
>   set(build_cubin OFF)
>   if ( NOT CUDA_BUILD_EMULATION AND CUDA_BUILD_CUBIN )
>  # comment out this line
>  # if ( NOT compile_to_ptx )
>set ( build_cubin ON )
>  #  and this line
>  # endif( NOT compile_to_ptx )
>   endif( NOT CUDA_BUILD_EMULATION AND CUDA_BUILD_CUBIN )
> 
> If you can't edit your FindCUDA.cmake script, you can add a new compile
> step that generates the CUBIN from your PTX.
> 
> # Compile the CUDA code to PTX.  is just a string used to set
> either the shared library flag _EXPORTS and the generated
> file names' prefixes.
> CUDA_WRAP_SRCS(my_target PTX generated_ptx_files myfile.cu
> <http://myfile.cu> myfile2.cu <http://myfile2.cu> myfile3.cu
> <http://myfile3.cu>)
> 
> # FindCUDA doesn't look for ptxas, but you can do it yourself:
> find_program(CUDA_PTXAS_EXECUTABLE NAMES ptxas PATHS
> "${CUDA_TOOLKIT_ROOT_DIR}")
> 
> # Now set up the build rules to compile the PTX to CUBINs.
> set(generated_cubin_files)
> foreach(ptx_file ${generated_ptx_files})
>  # You can get creative and use things like get_filename_component() to
> strip off the ptx from the filename.
>  set(generated_file "${ptx_file}.cubin")
>  add_custom_command(
>OUTPUT ${generated_file}
># These output files depend on the source_file and the contents of
> cmake_dependency_file
>MAIN_DEPENDENCY "${ptx_file}"
># Here's the ptxas command
>COMMAND ${ptxas} "${ptx_file}" -o "${generated_file}"
>COMMENT "Generating ${generated_file}"
>)
>   list(APPEND generated_cubin_files "${generated_file}")
> endforeach()
> 
> Then make sure that you add your CUDA files, ptx files, and
> generated_cubin_files to your library or executable target.
> 
Thanks a lot for your suggestions. I really appreciate you taking your
time to answer my question so thoroughly. I took the path of editing my
CMakeLists.txt.

I'm still struggling a bit with some details, but I think I can handle
the rest with some thought on my part. :)
I will share with the list my CMakeLists.txt file once I get all things
nailed down.

> If you have the PTX, why do you need to generate CUBINs at all?  You
> should be able to let the driver compile the CUBIN and be ready to go no
> matter what device you have created.
> 
Compiling .ptx at runtime is an expensive operation, even for simple
code, and it needs to be done separately for every GPU (yes, multi-GPU
user). The compile-for-every-GPU is not a big problem, as for efficient
and readable CUDA device management, multithreading is a must, but 0.6
seconds to compile a .ptx is not exactly on my list of doing things as
fast as they can be done (like 0.5 TFLOP/s on dual 9800GT). The .cubin
files are the first I attempt to load. If they are by any miraculous
chance incompatible with the GPU architecture (say, cubins are made for
compute 1.1, but the GPU is compute 2.0), then the .ptx is the fallback
path. Ideally, the ptx should _never_ be touched.

This shouldn't be much of an issue, considering the source is GPLv3, but
most people just want double-click functionality, so I cannot possibly
predict all the GPU configurations that I may encounter. This is the
safest path, and a good exercise towards bullet-proof programming practice.

I might actually try to implement a persistent way to compile a .ptx the
first time the application is run, and just load the customized .cubin
afterward, but I've had my head wrapped around other issues that I
haven't written any new code in the last six months. My priority right
now is getting used to cmake. I was getting very tired of editing
makefiles and Visual Studio project files, and making sure one didn't
break the other.

While I'm at it, if you want to poke fun at me :p , my project is hosted
here:
http://code.google.com/p/electromag-with-cuda/

Alex

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJMjCRXAAoJEL0kPHNPXJJKIiwQAIzpzEYRoPga3AIRR/1Je5a1
xdSvd

[CMake] FindCUDA - creating .ptx and .cubin files as final build target

2010-09-10 Thread Alex G
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

I have a project that I'm converting from plain ole' makefile to cmake.
I need to have the build result be .ptx and .cubin (both, as the app
attempts to read the .cubin first, and if it's incompatible with the GPU
architecture, assemble the .ptx file).

The way I did it with the ole' makefile approach was to invoke nvcc
- --ptx on File1.cu and File2.cu, and then invoke nvcc --cubin on the
resulting File1.ptx, and File2.ptx. The latter step created File1.cubin,
and File2.cubin.

I've looked over the documentation of FindCUDA, and it seemed that
CUDA_COMPILE and CUDA_COMPILE_PTX might be my best bets; however, I
can't figure out how to set targets to be .ptx, or .cubin files.
CUDA_ADD_LIBRARY wants to generate an (empty) object library, which only
adds headaches, as the project compilation fails when gcc is invoked to
create these libs. This is both redundant and annoying.

I only need the .ptx and .cubin files. I would greatly appreciate a hint
or pointers.

Alex
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJMioHCAAoJEL0kPHNPXJJKlL0P/ihLAxpUZSKvDbGkCIesk84E
tzXBAuIu5nWpFY7jHaD3cI0lAb62RXql4kbJKdlJ8RuWMZy3ZclsTx0Ph3TYnaoX
dVOCOqxYGwbt3q74NtVDM8mvIfMxKSEyiQbn6V9KCU0sKqW4pvlxXl37Qbh75ILT
cWMOx4dm/XH1z/YE+EJfhWSZw9JonwghR1E5XHI7i4y9hr1MyQ/sOkytEUFQEYos
J7DTFHcdUPwDtOFYsG54BkuyvzacGl++h6X/sS/rB+UyCbJaFr6z68LmiS6mg25H
g5q5S8FGJyEz3cOkINo1viLMhFbM1eWVwHvQOkGHw3+aFL6FY/FPruMKaqEcklk5
EYA9qZlrU+gvVSNBptl8Y0d3Lajvk8rFMl0zwuENNIgh7vtc6QhHjtHTX57b36JM
d/8S7R+lsw9jsW/NODNBO2NeGjcCN380ntUG9R05O6sYUZlBAHkbcMBdiVg9YM0n
V2G4rkpFL9VtiZyArme+X7Sa/K6G6ODhM0ivmz6FOswi2pCi40ZBjBLM97hPOmHa
DAQkJxpjntMYMmKL6PZ9rkp4De6SdihCMYNakGPFTutmZO6KNqLDtPz+PBkY69Jk
JIhvROFN5c9ijN/6wwitc213BPGzLDvBZxbPkrLaC9ogYnVyBfedaLVkp3DsZqcc
ujxmOVL4+AZcRxlnSozs
=Tt5O
-END PGP SIGNATURE-
___
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] different compiler flags for each executable

2010-04-28 Thread Alex Flint
Hi there,

Is there a way to add compiler flags (a la CMAKE_CXX_FLAGS) for just one
particular executable?

Cheers,
Alex
___
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] Java Support

2010-02-02 Thread Alex Brandt
On Friday 22 January 2010 1:37:50 pm David Cole wrote:
> If you are a Java guru, I would appreciate your review and comments on this
> issue, which has been in our issue tracker for a while now. If you have a
> good suggestion for the best way to fix it, I would love to hear it.
> 
> http://public.kitware.com/Bug/view.php?id=7832
> 
> And here's a link to all of the "java related" issues in the tracker (even
> the closed ones, just a simple search on the word "java" in the CMake
> project portion of the issue tracker):
> 
http://public.kitware.com/Bug/search.php?project_id=2&search=java&sticky_is
> 
sues=off&sortby=severity%2Cpriority&dir=DESC%2CDESC&hide_status_id=-2
> 
> 
> Thanks,
> David Cole
> Kitware, Inc.
> 

I've been looking into Java (getting a feel for it's build process and I've 
determined that the CMAKE_Java_LINK_EXECUTABLE should possibly look 
something like this:

IF(NOT ${CMAKE_Java_LINK_EXECUTABLE})
  STRING(REGEX REPLACE "\/" 
CMAKE_Java_ENTRY_POINT "")
  SET(CMAKE_Java_LINK_EXECUTABLE 
" -cf  -e  -C 
")
ENDIF(NOT ${CMAKE_Java_LINK_EXECUTABLE})

I know I'm using the STRING() macro incorrectly and was wondering if there 
was a good example of its usage.  This should allow us to get the main 
method into the jar's manifest for a pseudo static linked executable.  I'm 
sure there are other problems with this idea but I'm open to suggestions at 
this point.

Regards,

Alex Brandt

-- 
B.S. Physics & Computer Science
Minnesota State University Moorhead
www.alunduil.com


signature.asc
Description: This is a digitally signed message part.
___
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] Java Support

2010-01-22 Thread Alex Brandt
On Friday 22 January 2010 9:03:23 pm Alain Leblanc wrote:

> The jar file containing LDAPReferralException (probably
> /usr/share/jldap/lib/ldap.jar) must be included in your CLASSPATH
> variable.  This is a basic java issue. Nothing to do with cmake.
> ___
> 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

Do you mean passing that in the -classpath parameter or do you mean making 
it a variable inside the source?

Regards,

Alex Brandt 

-- 
B.S. Physics & Computer Science
Minnesota State University Moorhead
www.alunduil.com


signature.asc
Description: This is a digitally signed message part.
___
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] Java Support

2010-01-22 Thread Alex Brandt
On Friday 22 January 2010 2:26:58 pm you wrote:
> What specific problems are you having with your Java code?
> ___
> Mike Jackson  www.bluequartz.net
> Principal Software Engineer   mike.jack...@bluequartz.net
> BlueQuartz Software   Dayton, Ohio

I'm getting the following error when trying to run the Java application I 
compile:

alund...@elijah ~/work/adsoap/build/test $ java LdapTest
Exception in thread "main" java.lang.NoClassDefFoundError: 
com/novell/ldap/LDAPReferralException
Caused by: java.lang.ClassNotFoundException: 
com.novell.ldap.LDAPReferralException
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:319)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:264)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:332)
Could not find the main class: LdapTest. Program will exit.

The CMake file I'm using is the following:

project(AdSoapService Java)
cmake_minimum_required(VERSION 2.6)

set(CMAKE_JAVA_COMPILE_FLAGS "${CMAKE_JAVA_COMPILE_FLAGS} -
Xlint:deprecation")

include_directories(/usr/share/soap/lib/soap.jar)
include_directories(/usr/share/jldap/lib/ldap.jar)

set(Zimbra_SRC
Zimbra/ZimbraAccount.java)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/Zimbra.dir/Zimbra/)
message(STATUS "${CMAKE_CURRENT_BINARY_DIR}")
add_library(Zimbra ${Zimbra_SRC})

set(AdSoapService_SRC
AdSoapService/AdSoapSession.java
AdSoapService/AdSoapService.java
AdSoapService/AdSoapServiceImpl.java)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/AdSoapService.dir/AdSoapService/)
add_library(AdSoapService ${AdSoapService_SRC})

add_dependencies(AdSoapService Zimbra)

add_subdirectory(test)

Regards,

Alex Brandt

-- 
B.S. Physics & Computer Science
Minnesota State University Moorhead
www.alunduil.com


signature.asc
Description: This is a digitally signed message part.
___
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] Java Support

2010-01-22 Thread Alex Brandt
I know that support exists in CMake 2.8, but I can't find any documentation 
for it or a statement about the status of it.  I've started looking into the 
following files:

/usr/share/cmake/Modules/FindJava.cmake
/usr/share/cmake/Modules/CMakeDetermineJavaCompiler.cmake
/usr/share/cmake/Modules/CMakeTestJavaCompiler.cmake
/usr/share/cmake/Modules/CMakeJavaInformation.cmake
/usr/share/cmake/Modules/CMakeJavaCompiler.cmake.in

Is there anything else I can look at for Java with CMake or even helping out 
to make Java for CMake work better?

It also seems that the following statements are missing from 
/usr/share/cmake/Modules/CMakeJavaInformation.cmake:

IF(NOT ${CMAKE_Java_LINK_EXECUTABLE})
  SET(CMAKE_Java_LINK_EXECUTABLE
"")
ENDIF(NOT ${CMAKE_Java_LINK_EXECUTABLE})

If this isn't the right way to handle this I'd like to know why, but otherwise 
when trying to make a Java executable (basically a class file that shouldn't 
be linked into a library) it complains about linking (which Java already 
does?).

Regards,

Alex Brandt
-- 
B.S. Physics & Computer Science
Minnesota State University Moorhead
www.alunduil.com


signature.asc
Description: This is a digitally signed message part.
___
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] running cmake with option

2009-11-28 Thread Alex H

if I have the following option:
OPTION( HW08_TESTS "Run Homework 8 tests? (can take a long time...)" OFF )
how can I run cmake with this option turned on?
I tried
cmake HW08_TESTS . and it doesn't work



  
_
NEW! Get Windows Live FREE.
http://www.get.live.com/wl/all___
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] comparing two files in cmake

2009-11-22 Thread Alex H

Hello,
I have the following command to compare two files:
ADD_TEST(mytest ${CMAKE_COMMAND} -E compare_files file1.c file2.c)

however when I run the test, then all it prints is :
UpdateCTestConfiguration  from 
:/home/herlamba/ece373/src/homeworks/hw07-herlambang/DartConfiguration.tclStart 
processing testsUpdateCTestConfiguration  from 
:/home/herlamba/ece373/src/homeworks/hw07-herlambang/DartConfiguration.tclTest 
project /home/herlamba/ece373/src/homeworks/hw07-herlambangConstructing a list 
of testsNo tests were found!!!

am I doing something wrong here?
I run the test by typing in:
 ctest -VV -R mytest

  
_
New Windows 7: Simplify what you do everyday. Find the right PC for you.
http://windows.microsoft.com/shop___
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] .h file preprocessor definition

2009-11-21 Thread Alex H

If I have a .h file and I want to create a library using that .h file and some 
other file, how can I set the preprocessor definition to some FLAG?
So far I think the way to go is the following:
set_source_files_properties(vehicle.h PROPERTIES COMPILE_FLAGS "-DPROJECT")
is this right? I tried it and it doesn't work   
  
_
New Windows 7: Find the right PC for you. Learn more.
http://windows.microsoft.com/shop___
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] help me to resolve this issue

2009-11-03 Thread Alex H

But I have only one cpp file and I want it do have different properties...
What does the SSE_COMPILE_FLAGS do?





> Date: Tue, 3 Nov 2009 22:59:11 -0500
> Subject: Re: [CMake] help me to resolve this issue
> From: mike.jack...@bluequartz.net
> To: aditya15...@hotmail.com
> 
> set_source_files_properties( has-main.cpp
> PROPERTIES  COMPILE_FLAGS ${SSE_COMPILE_FLAGS} )
> _
> Mike Jackson  mike.jack...@bluequartz.net
> BlueQuartz Softwarewww.bluequartz.net
> Principal Software Engineer  Dayton, Ohio
> 
> On Tue, Nov 3, 2009 at 10:40 PM, Alex H  wrote:
> > Okay here's what I've done so far:
> > add_definitions(-DV_FILM)
> > add_executable(hassel-film has-main.cpp)
> > remove_definitions(-DV_FILM)
> > add_definitions(-DV_DIGITAL)
> > add_executable(hassel-digital has-main.cpp)
> > What I want to do is after running cmake . and typing it make. I want to
> > generate two executable, one is hassel-film which is has-main.cpp compiled
> > with the flag -V_FILM
> > and the other one is hassel-digital which is compiled with the flag
> > -V_DIGITAL. How can I do this? The above code will compile with V_DIGITAL
> > flag, which is not what I want.
> >
> >
> >
> >
> >
> >
> >> Date: Mon, 2 Nov 2009 22:12:26 -0800
> >> From: ty...@cryptio.net
> >> To: aditya15...@hotmail.com
> >> CC: cmake@cmake.org
> >> Subject: Re: [CMake] help me to resolve this issue
> >>
> >> On Tue, Nov 03, 2009 at 05:54:16AM +, Alex H wrote:
> >> > if I have add_definition then the add_executable underneath it gets
> >> > compiled with the definition specified above it?
> >>
> >> Why don't you try it and see? If it doesn't work, post your CMakeLists
> >> and see if someone can help.
> >>
> >> tyler
> >
> > 
> > New Windows 7: Simplify what you do everyday. Find the right PC for you.
> > ___
> > 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
> >
  
_
New Windows 7: Find the right PC for you. Learn more.
http://windows.microsoft.com/shop___
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] help me to resolve this issue

2009-11-03 Thread Alex H

Okay here's what I've done so far:
add_definitions(-DV_FILM)add_executable(hassel-film has-main.cpp)
remove_definitions(-DV_FILM)add_definitions(-DV_DIGITAL)add_executable(hassel-digital
 has-main.cpp)
What I want to do is after running cmake . and typing it make. I want to 
generate two executable, one is hassel-film which is has-main.cpp compiled with 
the flag -V_FILM and the other one is hassel-digital which is compiled with the 
flag -V_DIGITAL. How can I do this? The above code will compile with V_DIGITAL 
flag, which is not what I want.






> Date: Mon, 2 Nov 2009 22:12:26 -0800
> From: ty...@cryptio.net
> To: aditya15...@hotmail.com
> CC: cmake@cmake.org
> Subject: Re: [CMake] help me to resolve this issue
> 
> On Tue, Nov 03, 2009 at 05:54:16AM +, Alex H wrote:
> > if I have add_definition then the add_executable underneath it gets 
> > compiled with the definition specified above it?
> 
> Why don't you try it and see? If it doesn't work, post your CMakeLists
> and see if someone can help.
> 
> tyler
  
_
New Windows 7: Simplify what you do everyday. Find the right PC for you.
http://windows.microsoft.com/shop___
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] several executables with cmake

2009-11-03 Thread Alex H

I have several executables that I want to be able to run using ctest, how can I 
do this? 
As far as I know I can only add one executable to one test, using the add_test.
Any ideas?



  
_
Windows Live: Friends get your Flickr, Yelp, and Digg updates when they e-mail 
you.
http://www.microsoft.com/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-id:SI_SB_3:092010___
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] help me to resolve this issue

2009-11-02 Thread Alex H

if I have add_definition then the add_executable underneath it gets compiled 
with the definition specified above it?






> Date: Mon, 2 Nov 2009 20:11:41 -0800
> From: ty...@cryptio.net
> To: aditya15...@hotmail.com
> CC: cmake@cmake.org
> Subject: Re: [CMake] help me to resolve this issue
> 
> On Tue, Nov 03, 2009 at 03:32:04AM +, Alex H wrote:
> > Well, what I want to do is that in my code, I have a #define 
> > NORMAL_COMPILE, and some other ones...
> > How can I let cmake define those macro so that when I type make, it will 
> > create an executable with the define included?
> 
> You use add_definions(), but what does this have to do with your other
> problem?
> 
> tyler
  
_
Windows Live: Friends get your Flickr, Yelp, and Digg updates when they e-mail 
you.
http://www.microsoft.com/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-id:SI_SB_3:092010___
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] help me to resolve this issue

2009-11-02 Thread Alex H

Well, what I want to do is that in my code, I have a #define NORMAL_COMPILE, 
and some other ones...
How can I let cmake define those macro so that when I type make, it will create 
an executable with the define included?




> Date: Mon, 2 Nov 2009 18:17:33 -0800
> From: ty...@cryptio.net
> To: aditya15...@hotmail.com
> CC: cmake@cmake.org
> Subject: Re: [CMake] help me to resolve this issue
> 
> On Tue, Nov 03, 2009 at 01:21:35AM +, Alex H wrote:
> > How can I get over this issue? 
> > add_executable cannot create target "hassel" because another target
> > with  the same name already exists.  The existing target is an
> > executable created  in source directory "..".  See
> > documentation for policy CMP0002 for more details.
> 
> Uh... don't add two targets with the same name?
> 
> If you want more help, we probably need to see some code or at least an
> explanation of what you're trying to do.
> 
> tyler
  
_
NEW! Get Windows Live FREE.
http://www.get.live.com/wl/all___
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] help me to resolve this issue

2009-11-02 Thread Alex H

How can I get over this issue? 
add_executable cannot create target "hassel" because another target with  the 
same name already exists.  The existing target is an executable created  in 
source directory "..".  See documentation for policy CMP0002 for 
more details.
  
_
New Windows 7: Find the right PC for you. Learn more.
http://windows.microsoft.com/shop___
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_executable with -D

2009-11-01 Thread Alex H


Sorry what I was trying to ask is, how do I run CMake with an option that I 
have defined in the option section ofCMakeLists.txt?




> Date: Sun, 1 Nov 2009 22:47:36 +0100
> Subject: Re: [CMake] add_executable with -D
> From: pgqui...@elpauer.org
> To: aditya15...@hotmail.com
> CC: cmake@cmake.org
> 
> Hello,
> 
> $ cmake --help-command IF
> 
>  if(expression)
># then section.
>COMMAND1(ARGS ...)
>COMMAND2(ARGS ...)
>...
>  elseif(expression2)
># elseif section.
>COMMAND1(ARGS ...)
>COMMAND2(ARGS ...)
>...
>  else(expression)
># else section.
>COMMAND1(ARGS ...)
>COMMAND2(ARGS ...)
>...
>  endif(expression)
> 
> [...]
> 
> It seems that you don't know CMake at all. You may want to take a look
> at my slides:
> 
> http://www.elpauer.org/stuff/learning_cmake.pdf
> 
> 
> On Sun, Nov 1, 2009 at 10:39 PM, Alex H  wrote:
> >
> > How can I do an if else statement in CMake?? Do I need to use options?
> >>
> >
> >
> > 
> > From: mike.jack...@bluequartz.net
> > To: aditya15...@hotmail.com
> > Subject: Re: [CMake] add_executable with -D
> > Date: Sun, 1 Nov 2009 13:59:15 -0500
> > CC: cmake@cmake.org
> >
> > You need to use the add_defintions() command
> >
> > Sent from my iPod
> > Mike Jackson
> > On Nov 1, 2009, at 13:12, Alex H  wrote:
> >
> > Usually using g++ I can do the following:
> > g++ -D DEBUG main.cpp
> > how can I add the similar function of -D DEBUG in CMake?
> > I tried to read the add_executable() command and it did not provide
> > something similar to this.. some guidelines are appreciated
> >
> >
> >
> > 
> > Chat online and in real-time with friends and family! Windows Live Messenger
> >
> > ___
> > 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
> >
> > 
> > Windows Live Hotmail: Your friends can get your Facebook updates, right from
> > Hotmail®.
> > ___
> > 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
> >
> 
> 
> 
> -- 
> Pau Garcia i Quiles
> http://www.elpauer.org
> (Due to my workload, I may need 10 days to answer)
  
_
Windows Live: Friends get your Flickr, Yelp, and Digg updates when they e-mail 
you.
http://www.microsoft.com/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-id:SI_SB_3:092010___
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_executable with -D

2009-11-01 Thread Alex H


How can I do an if else statement in CMake?? Do I need to use options?




From: mike.jack...@bluequartz.net
To: aditya15...@hotmail.com
Subject: Re: [CMake] add_executable with -D
Date: Sun, 1 Nov 2009 13:59:15 -0500
CC: cmake@cmake.org

You need to use the add_defintions() command

Sent from my iPodMike Jackson
On Nov 1, 2009, at 13:12, Alex H  wrote:


Usually using g++ I can do the following:
g++ -D DEBUG main.cpp
how can I add the similar function of -D DEBUG in CMake? 
I tried to read the add_executable() command and it did not provide something 
similar to this.. some guidelines are appreciated


  
Chat online and in real-time with friends and family! Windows Live Messenger
___
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 
  
_
NEW! Get Windows Live FREE.
http://www.get.live.com/wl/all___
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_executable with -D

2009-11-01 Thread Alex H

Usually using g++ I can do the following:
g++ -D DEBUG main.cpp
how can I add the similar function of -D DEBUG in CMake? 
I tried to read the add_executable() command and it did not provide something 
similar to this.. some guidelines are appreciated


  
_
Windows Live: Friends get your Flickr, Yelp, and Digg updates when they e-mail 
you.
http://www.microsoft.com/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-id:SI_SB_3:092010___
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] linking .h and .cpp

2009-10-17 Thread Alex H

Say I have an interface of test.h which is located on another folder and the 
implementation of it test.cpp on a different folder.
I have another .cpp which calls main and I've use include "test.h", however how 
does the test.h file know where the test.cpp is??
As when I type make it doesn't complain because of cannot finding the test.h, 
however it complains that it can't find the implementation...
How can I do this then?



  
_
Windows Live: Keep your friends up to date with what you do online.
http://www.microsoft.com/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-id:SI_SB_1:092010___
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] weird output with ctest

2009-08-30 Thread Alex H




Well problem is why doesn't it print the std::cout that I've put inside main? 
while it's running main


> Date: Sun, 30 Aug 2009 17:20:26 -0400
> Subject: Re: [CMake] weird output with ctest
> From: dresche...@gmail.com
> To: aditya15...@hotmail.com; cmake@cmake.org
> 
>> I have the following command in my CMakeLists.txt and I run the test using
>> the command ctest -VV -R test. However the test results doesn't print
>> anything that I defined on the test code, it just shows the test passed.
>> add_test(test ../build/gbc 0.1 0.3 0.5 0.7 0.9)
>>
> That is all it is supposed to do.
> 
> John

_
What can you do with the new Windows Live? Find out
http://www.microsoft.com/windows/windowslive/default.aspx___
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] weird output with ctest

2009-08-30 Thread Alex H

I have the following command in my CMakeLists.txt and I run the test using the 
command ctest -VV -R test. However the test results doesn't print anything that 
I defined on the test code, it just shows the test passed.
add_test(test ../build/gbc 0.1 0.3 0.5 0.7 0.9)

When I run ./gbc 0.1 0.3 0.5 0.7 0.9 it does print several stuffs in the code.. 
why is this?



_
With Windows Live, you can organize, edit, and share your photos.
http://www.microsoft.com/indonesia/windows/windowslive/products/photo-gallery-edit.aspx___
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] include file

2009-08-29 Thread Alex H

I have a test.cpp file and the test file needs to be linked with another .h 
file... they are all in the same directory, however when I run the Makefile 
that is generated by CMake, it shows this error:
CMakeFiles/bcoin.dir/test.cpp.o: In function `main':test.cpp:(.text+0xd7): 
undefined reference to `Exp::Exp(double)'test.cpp:(.text+0x114): undefined 
reference to `Exp::execute()'
I think I need to add some more command to my CMakeLists.txt, how can I do 
this??
_
What can you do with the new Windows Live? Find out
http://www.microsoft.com/windows/windowslive/default.aspx___
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] exit_failure

2009-08-28 Thread Alex H

My problem is that in my executable test cpp code, the code may return a cpp 
EXIT_FAILURE macro. Problem is how can I use the cpp macro inside the 
set_tests_properties regex arguments?
_
Share your memories online with anyone you want.
http://www.microsoft.com/indonesia/windows/windowslive/products/photos-share.aspx?tab=1___
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] set test properties

2009-08-28 Thread Alex H

I am quite confused on how to use this command, what is the regex for?
set_tests_properties(test  PROPERTIES PASS_REGULAR_EXPRESSION "EXIT_FAILURE")
below is from the documentation
set_tests_properties: Set a property of the tests.
  set_tests_properties(test1 [test2...] PROPERTIES prop1 value1 prop2 value2)
Set a property for the tests. If the property is not found, CMake will report 
an error.


what is prop1 value1 prop2 value2 ?


Can someone please give me an example?

_
See all the ways you can stay connected to friends and family
http://www.microsoft.com/windows/windowslive/default.aspx___
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] Fwd: generating CTest tests

2009-08-28 Thread Alex H

I am going to take an example from your a snippet test in your previous example:
ADD_TEST(XMLExport0  ${EXECUTABLE_OUTPUT_PATH}/BasicTest +XMLEXP 0)
ADD_TEST(XMLExport1  ${EXECUTABLE_OUTPUT_PATH}/BasicTest +XMLEXP 1)
ADD_TEST(XMLExport2  ${EXECUTABLE_OUTPUT_PATH}/BasicTest +XMLEXP 2)
ADD_TEST(XMLExport3  ${EXECUTABLE_OUTPUT_PATH}/BasicTest +XMLEXP 3)
ADD_TEST(XMLExport4  ${EXECUTABLE_OUTPUT_PATH}/BasicTest +XMLEXP 4)
ADD_TEST(XMLExport5  ${EXECUTABLE_OUTPUT_PATH}/BasicTest +XMLEXP 5)
ADD_TEST(XMLExport6  ${EXECUTABLE_OUTPUT_PATH}/BasicTest +XMLEXP 
6)if  this is put inside the CMakeLists.txt then if I want to run it as ctest 
-R testpagethen inside testing I should have an implementation of the test 
XMLExport0..up to XMLExport6??What language should testpage be written in? I 
guess that's the question.. I am confused what to put inside testpage, an 
example would help.


Date: Fri, 28 Aug 2009 15:27:43 -0400
Subject: Re: [CMake] Fwd: generating CTest tests
From: david.c...@kitware.com
To: aditya15...@hotmail.com
CC: cmake@cmake.org

On Fri, Aug 28, 2009 at 3:11 PM, Alex H  wrote:






Hello,
So where do we specify/put in the CMakeLists.txt where test1 is expected to 
fail or pass? 
How does CTest knows this...
If your program returns a 0, it passes. If it does not, it fails.

If you want to invert this logic, set the test property "WILL_FAIL".If you want 
to base the pass/fail value on test output, set the test property 
"PASS_REGULAR_EXPRESSION" or "FAIL_REGULAR_EXPRESSION" : if the output matches 
the regex, it passes or fails accordingly.

i.e.:set_property(TEST test1 PROPERTY WILL_FAIL TRUE)would invert the pass/fail 
logic
see also:$ cmake --help-property WILL_FAIL
$ cmake --help-property PASS_REGULAR_EXPRESSION
$ cmake --help-property FAIL_REGULAR_EXPRESSION
$ cmake --help-command set_property

 
Just to clarify the add_test command should be put inside a CMakeLists.txt?
Yes, that's correct.
 
What if I want to invokectest using the following  command:
ctest -R testpage
What should testpage have inside of it?

testpage should be the name of a test added using add_test. It can have 
*anything you want to test* inside of it
ctest -R testpage will execute the test as specified in the add_test command.


HTH,David

_
Share your memories online with anyone you want.
http://www.microsoft.com/indonesia/windows/windowslive/products/photos-share.aspx?tab=1___
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] Fwd: generating CTest tests

2009-08-28 Thread Alex H

Hello,
So where do we specify/put in the CMakeLists.txt where test1 is expected to 
fail or pass? 
How does CTest knows this...
Just to clarify the add_test command should be put inside a CMakeLists.txt? 
What if I want to invokectest using the following  command:
ctest -R testpage
What should testpage have inside of it?
Alex H.


> Date: Fri, 28 Aug 2009 14:14:21 -0400
> Subject: Re: [CMake] Fwd: generating CTest tests
> From: dresche...@gmail.com
> To: aditya15...@hotmail.com; cmake@cmake.org
> 
> On Fri, Aug 28, 2009 at 2:07 PM, Alex H wrote:
> > Hello,
> > My problem is actually really simple I have a .cpp file and the program just
> > basically take an int as an argument, if the argument is from certain
> > numbers it returns a 1 otherwise 0.
> > Now I need to create a unit test that would allow me to do this... how can I
> > check the return value of the program? The add_test command just adds the
> > test to be performed using a
> > specific argument but it never tests the output...
> 
> CMake automatically does this for you when you build the RUN_TESTS
> target on Visual Studio or do a make test on other systems
> 
> Here is an example of the output of RUN_TESTS under visual studio 2005
> for the project I posted the CMakeLists.txt
> 
> 
> 1>Performing Post-Build Event...
> 1>Start processing tests
> 1>Test project X:/32Bit/VC.80/Qt/QtBasicUtils
> 1>  1/ 48 Testing FileCMD0 .   Passed0.55 sec
> 1>  2/ 48 Testing FileCMD1 .   Passed1.58 sec
> 1>  3/ 48 Testing Test0    Passed0.17 sec
> 1>  4/ 48 Testing Test1    Passed0.16 sec
> 1>  5/ 48 Testing StringListArg0 ...   Passed0.06 sec
> 1>  6/ 48 Testing StringListArg1 ...   Passed0.06 sec
> 1>  7/ 48 Testing StringListOpt0 ...   Passed0.16 sec
> 1>  8/ 48 Testing StringListOpt1 ...   Passed0.06 sec
> 1>  9/ 48 Testing BoolOpt1 .   Passed0.16 sec
> 1> 10/ 48 Testing BoolOpt2 .   Passed0.14 sec
> 1> 11/ 48 Testing ExtBoolOpt1 ..   Passed0.25 sec
> 1> 12/ 48 Testing ExtBoolOpt2 ..   Passed0.16 sec
> 1> 13/ 48 Testing ExtBoolOpt3 ..   Passed0.06 sec
> 1> 14/ 48 Testing ExtBoolOpt4 ..   Passed0.16 sec
> 1> 15/ 48 Testing ExtBoolOpt5 ..   Passed0.17 sec
> 1> 16/ 48 Testing FloatArgs0 ...   Passed0.19 sec
> 1> 17/ 48 Testing FloatArgs1 ...   Passed0.06 sec
> 1> 18/ 48 Testing FloatArgs2 ...   Passed0.16 sec
> 1> 19/ 48 Testing FloatArgs3 ...   Passed0.16 sec
> 1> 20/ 48 Testing FloatArgs4 ...   Passed0.16 sec
> 1> 21/ 48 Testing FloatArgs5 ...   Passed0.16 sec
> 1> 22/ 48 Testing FloatArgs6 ...   Passed0.14 sec
> 1> 23/ 48 Testing FloatArgs7 ...   Passed0.16 sec
> 1> 24/ 48 Testing FloatArgs8 ...   Passed1.30 sec
> 1> 25/ 48 Testing DoubleArgs0 ..   Passed0.16 sec
> 1> 26/ 48 Testing DoubleArgs1 ..   Passed0.16 sec
> 1> 27/ 48 Testing DoubleArgs2 ..   Passed0.14 sec
> 1> 28/ 48 Testing DoubleArgs3 ..   Passed0.19 sec
> 1> 29/ 48 Testing DoubleArgs4 ..   Passed0.16 sec
> 1> 30/ 48 Testing DoubleArgs5 ..   Passed0.06 sec
> 1> 31/ 48 Testing DoubleArgs6 ..   Passed0.14 sec
> 1> 32/ 48 Testing DoubleArgs7 ..   Passed0.16 sec
> 1> 33/ 48 Testing DoubleArgs8 ..   Passed2.03 sec
> 1> 34/ 48 Testing XMLExport0 ...   Passed0.17 sec
> 1> 35/ 48 Testing XMLExport1 ...   Passed0.17 sec
> 1> 36/ 48 Testing XMLExport2 ...   Passed0.14 sec
> 1> 37/ 48 Testing XMLExport3 ...   Passed0.14 sec
> 1> 38/ 48 Testing XMLExport4 ...   Passed0.14 sec
> 1> 39/ 48 Testing XMLExport5 ...   Passed0.17 sec
> 1> 40/ 48 Testing XMLExport6 ...   Passed0.14 sec
> 1> 41/ 48 Testing UserProp0    Passed0.14 sec
> 1> 42/ 48 Testing UserProp1    Passed0.16 sec
> 1> 43/ 48 Testing UserProp2    Passed0.06 sec
> 1> 44/ 48 Testing UserProp3    Passed0.14 sec
> 1> 45/ 48 Testing UserProp4    Passed0.16 sec

Re: [CMake] Fwd: generating CTest tests

2009-08-28 Thread Alex H

Hello,
My problem is actually really simple I have a .cpp file and the program just 
basically take an int as an argument, if the argument is from certain numbers 
it returns a 1 otherwise 0.Now I need to create a unit test that would allow me 
to do this... how can I check the return value of the program? The add_test 
command just adds the test to be performed using aspecific argument but it 
never tests the output...
Alex




> Date: Fri, 28 Aug 2009 13:53:33 -0400
> From: dresche...@gmail.com
> To: cmake@cmake.org
> Subject: [CMake] Fwd:  generating CTest tests
> 
> -- Forwarded message --
> From: John Drescher 
> Date: Fri, Aug 28, 2009 at 1:53 PM
> Subject: Re: [CMake] generating CTest tests
> To: Alex H 
> 
> 
> On Fri, Aug 28, 2009 at 1:38 PM, Alex H wrote:
>> Hello,
>> In the ADD_TEST command in the example below I mentioned the test name is
>> test1, is this only a naming thing or does it mean
>> that I have to have an actual file called test1 in the system to be run by
>> the executable? Sorry, I read the documentation several times and
>> still don't understand as somewhere on the documentation it also mentions
>> test files, I am not sure what to put inside this test file though.
>> Should I put this ADD_TEST inside the test file or the CMakeLists.txt?
>> Thanks
>> Alex
>>
> 
> You make a separate target for this. Here is an example.
> 
> I have a main project Called QtBasicUtils in that main project I have
> in the main application CMakeLists.txt
> 
> option (BUILD_TESTING "Build Tests" ON)
> 
> IF(BUILD_TESTING)
> ENABLE_TESTING()
> add_subdirectory(Testing)
> ENDIF(BUILD_TESTING)
> 
> 
> And then in the CMakeLists.txt file in QtBasicUtils/Testing
> 
> #This file contains the automated unit testing for QtBasicUtils
> 
> LINK_LIBRARIES(BasicTest QtBasicUtils ${QT_LIBRARIES})
> include_directories( ${PROJECT_BINARY_DIR} ${PROJECT_BINARY_DIR}/..
> ${PROJECT_SOURCE_DIR}/include ./include)
> 
> set(TEST_SRCS
>./src/basic.cxx
>./src/testxml.cxx
>./src/testUserProps.cxx
> )
> 
> set(TEST_HDRS
>./include/testxml.h
>./include/testUserProps.h
> )
> 
> 
> add_executable(BasicTest ${TEST_SRCS} ${TEST_HDRS})
> 
> add_dependencies(BasicTest QtBasicUtils)
> 
> file(WRITE ${EXECUTABLE_OUTPUT_PATH}/test0.txt "+FLOATARGS 1.0 2.0 2.0
> 2.0 2.0 -S9.0")
> 
> add_test(FileCMD0   ${EXECUTABLE_OUTPUT_PATH}/BasicTest
> @${EXECUTABLE_OUTPUT_PATH}/test0.txt)
> 
> #This will fail because the file should not exist.
> add_test(FileCMD1   ${EXECUTABLE_OUTPUT_PATH}/BasicTest
> @${EXECUTABLE_OUTPUT_PATH}/../test11.txt)
> SET_TESTS_PROPERTIES(FileCMD1 PROPERTIES WILL_FAIL TRUE)
> 
> ADD_TEST(Test0  ${EXECUTABLE_OUTPUT_PATH}/BasicTest +?)
> ADD_TEST(Test1  ${EXECUTABLE_OUTPUT_PATH}/BasicTest +Test 1.0)
> ADD_TEST(StringListArg0  ${EXECUTABLE_OUTPUT_PATH}/BasicTest
> +STRLSTARG 1 2 3 4 . -S10)
> ADD_TEST(StringListArg1  ${EXECUTABLE_OUTPUT_PATH}/BasicTest
> +STRLSTARG 1 2 3 . -S6)
> ADD_TEST(StringListOpt0  ${EXECUTABLE_OUTPUT_PATH}/BasicTest
> +STRLSTOPT -I1 2 3 . -S6)
> ADD_TEST(StringListOpt1  ${EXECUTABLE_OUTPUT_PATH}/BasicTest
> +STRLSTOPT -I1 2 3 4 . -S10)
> 
> ADD_TEST(BoolOpt1${EXECUTABLE_OUTPUT_PATH}/BasicTest
> +BOOLOPT -B)
> ADD_TEST(BoolOpt2${EXECUTABLE_OUTPUT_PATH}/BasicTest
> +BOOLOPT -B-)
> SET_TESTS_PROPERTIES(BoolOpt2 PROPERTIES WILL_FAIL TRUE)
> 
> ADD_TEST(ExtBoolOpt1 ${EXECUTABLE_OUTPUT_PATH}/BasicTest
> +EXTBOOLOPT --use_extended=+)
> ADD_TEST(ExtBoolOpt2 ${EXECUTABLE_OUTPUT_PATH}/BasicTest
> +EXTBOOLOPT --use_extended=-)
> ADD_TEST(ExtBoolOpt3 ${EXECUTABLE_OUTPUT_PATH}/BasicTest
> +EXTBOOLOPT --use_extended+)
> ADD_TEST(ExtBoolOpt4 ${EXECUTABLE_OUTPUT_PATH}/BasicTest
> +EXTBOOLOPT --use_extended-)
> ADD_TEST(ExtBoolOpt5 ${EXECUTABLE_OUTPUT_PATH}/BasicTest
> +EXTBOOLOPT --use_extended)
> SET_TESTS_PROPERTIES(ExtBoolOpt2 PROPERTIES WILL_FAIL TRUE)
> SET_TESTS_PROPERTIES(ExtBoolOpt4 PROPERTIES WILL_FAIL TRUE)
> 
> ADD_TEST(FloatArgs0  ${EXECUTABLE_OUTPUT_PATH}/BasicTest
> +FLOATARGS 1.0 -S5.0)
> ADD_TEST(FloatArgs1  ${EXECUTABLE_OUTPUT_PATH}/BasicTest
> +FLOATARGS 2.0 -S6.0)
> ADD_TEST(FloatArgs2  ${EXECUTABLE_OUTPUT_PATH}/BasicTest
> +FLOATARGS 1.0 1.0 -S5.0)
> ADD_TEST(FloatArgs3  ${EXECUTABLE_OUTPUT_PATH}/BasicTest
> +FLOATARGS 1.0 2.0 -S6.0)
> ADD_TEST(FloatArgs4  ${EXECUTABLE_OUTPUT_PATH}/BasicTest
> +FLOATARGS 1.0 1.0 1.0 1.0 1.0 -S5.0)
> ADD_TEST(F

Re: [CMake] generating CTest tests

2009-08-28 Thread Alex H

Hello,
In the ADD_TEST command in the example below I mentioned the test name is 
test1, is this only a naming thing or does it meanthat I have to have an actual 
file called test1 in the system to be run by the executable? Sorry, I read the 
documentation several times and still don't understand as somewhere on the 
documentation it also mentions test files, I am not sure what to put inside 
this test file though.
Should I put this ADD_TEST inside the test file or the CMakeLists.txt?
Thanks
Alex


> Date: Fri, 28 Aug 2009 13:11:01 -0400
> Subject: Re: [CMake] generating CTest tests
> From: dresche...@gmail.com
> To: aditya15...@hotmail.com; cmake@cmake.org
> 
> On Fri, Aug 28, 2009 at 12:57 PM, Aditya
> Herlambang wrote:
>> Hello,
>> I am really a total noob in this CTest stuffs, I read the documentation and
>> it says that I need to use the ADD_TEST method to test an executable right?
>> the format is the following:
>> ADD_TEST(test1 "../build/executable" "1")
>>
>> where test1 is the name of the test and 1 is the argument passed to the
>> executable. Question is how do I specify if the test pass then print
>> something, otherwise
>> print the other thing?
>>
> 
> You should not be printing anything. I mean from your main return 0
> for success any thing non zero for failure.
> 
> John

_
With Windows Live, you can organize, edit, and share your photos.
http://www.microsoft.com/indonesia/windows/windowslive/products/photo-gallery-edit.aspx___
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] building without using MSVC GUI

2009-06-16 Thread alex gouaillard

hi,

I would like to be able to directly build after the cmake  
configuration stage without needing to open the sln file in MSVC.

How could I do that?

alex.

___
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] CTest w/ Coverage

2009-04-12 Thread alex gouaillard
if you using gcc, compile you code with the right options, and you re  
good.

http://www.cmake.org/Wiki/CTest:Coverage
Coverage With C++

Currently coverage is only supported on gcc compiler. To perform  
coverage test, make sure that your code is built with debug symbols,  
without optimization, and with special flags. These flags are:

-fprofile-arcs -ftest-coverage
Also make sure to pass these flags to C compiler, CXX compiler, and  
the linker. For example:

CXXFLAGS="-g -O0 -Wall -W -Wshadow -Wunused-variable \
 -Wunused-parameter -Wunused-function -Wunused -Wno-system-headers \
 -Wno-deprecated -Woverloaded-virtual -Wwrite-strings -fprofile-arcs - 
ftest-coverage"

CFLAGS="-g -O0 -Wall -W -fprofile-arcs -ftest-coverage"
LDFLAGS="-fprofile-arcs -ftest-coverage"
"
"

then just run ctest.

no need for special ctest script.

alex.

On Apr 12, 2009, at 10:36 PM, Ian Monroe wrote:

On Sun, Apr 12, 2009 at 8:51 PM, Daniel Stonier  
 wrote:

I'm having a few troubles understanding how to get CTest setup. The
wiki is a bit piecemeal and just need a pointer in the right
direction.

Currently, the ctest results are passing for a simple hello world
project, but I can't get coverage working.


I'm in pretty much the exact same position. I'm pretty sure I need to
write a CTest script to do coverage testing, but the docs mostly seem
to be innuendo on this subject, so I don't know where to start.

Ian
___
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


___
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] using two different compilers together

2009-02-26 Thread Alex Flint
Bill: Thanks for the pointer, it's working brilliantly

Alex: Thanks for the suggestions even though I ended up going with findcuda

On Wed, Feb 25, 2009 at 8:45 PM, Bill Hoffman  wrote:
> There is a FindCuda.cmake here, that I have looked at:
>
> http://www.sci.utah.edu/~abe/FindCuda.html
>
> I am thinking of adding it to CMake, he uses custom_commands for Cuda.
>
>
> -Bill
> ___
> 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
>
___
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] automatically re-generating makefiles

2009-02-26 Thread Alex Flint
Hi there,

I've noticed that when I run "make blah" then the makefile is
automatically re-generated if I've changed anything in CMakeLists.txt
since the last time I built "blah". However, if I add a new target to
CMakeLists.txt then I have to run cmake manually or else I just get
"to rule to make foo". This makes perfect sense but I was wondering if
there is there any way to get cmake to put a catch-all rule in the
Makefile that will cause CMakeLists.txt to be re-read even if a
nonexistent target is specified on the commandline. Hence I would like
to be able to add a target "foo" to CMakeLists.txt then just run "make
foo" and cmake should be invoked to regenerate the makefile and the
makefile should be invoked. This might sound pointless but I actually
have a good motivation that I'd be happy to discuss if anyone is
interested...

Cheers,
Alex
___
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] using two different compilers together

2009-02-25 Thread Alex Flint
Hi there,

I'm trying to compile different parts of my application with different
compilers and I'm wondering how to do this within cmake. (The reason I
need this is that I'm using nvidia's cuda but the specifics of cuda
don't matter.) If I was to compile manually then my basic workflow
looks like this:

# compile the regular parts
g++ -o foo.cpp.o -c foo.cpp
...
# compile the cuda parts
nvcc -o bar.cu.o -c bar.cu.o
...
# link them together like normal (nvcc produces gcc-compatible object files)
g++ -o myprog foo.cpp.o bar.cu.o ...

I've tried a few ways of using add_custom_command and/or
add_custom_target but I haven't gotten anywhere. Can anyone tell me
how to do this?

Cheers,
Alex
___
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


[jira] Issue Comment Edited: (HADOOP-3788) Add serialization for Protocol Buffers

2008-09-11 Thread Alex Loddengaard (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-3788?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12630139#action_12630139
 ] 

alexlod edited comment on HADOOP-3788 at 9/11/08 2:30 AM:
---

Attaching a new patch.  Changes:

 * Removed _*Tracker_ and _TestPBHadoopStreams_ because they aren't very useful 
now that we've established streams have trailing data
 * Did not keep a single Builder instance in _PBDeserializer_, because Builders 
cannot be reused once _build()_ has been called.  From the PB API: "[build()] 
Construct the final message. Once [build()] is called, the Builder is no longer 
valid, and calling any other method may throw a NullPointerException. If you 
need to continue working with the builder after calling build(), clone() it 
first."  I made the decision to just re-instantiate instead of clone, because I 
ing here is that such a behavior is quite uncommon in
other program languages and not having the strict form is cumbersome
in many cases.

Thanks for your reply,

Nico

>
> HTH,
> David
>
> On Fri, Sep 12, 2008 at 5:56 AM, Nicolas Desprès <[EMAIL PROTECTED]>
> wrote:
>>
>> Hi,
>>
>> I'm using cmake 2.6.0.
>>
>> I'm trying the foreach(loop_var RANGE total) syntax and I find its
>> behavior quiet surprising since it is something equivalent to:
>>
>> for (int loop_var = 0; loop_var <= total; ++loop_var)
>>  ;
>>
>> Most of the time (specially when you iterate over a list) you want to
>> test for 'loop_var < total'.
>>
>> For instance you can't write code like that:
>>
>> list(LENGTH list list_count)
>>
>> foreach(i RANGE ${list_count})
>>
>>list(GET list ${i} x)
>>
>> endforeach(i)
>>
>> list(GET always fail on the last iteration.
>>
>> Cheers,
>>
>> --
>> Nicolas Desprès
>> ___
>> CMake mailing list
>> CMake@cmake.org
>> http://www.cmake.org/mailman/listinfo/cmake
>
>



-- 
Nicolas Desprès
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] How compile to object file?

2008-05-04 Thread Alex J. Ivasyuv

Hi all!

how to compile file to object?
For example in Makefile was:

someObj.o: someFile.cpp someFile.hpp
   $(CXX) -fPIC -c someFile.cpp -o someObj.o $(FLAGS) $(IDIR)

I found add_library(someObj SHARED someFile.cpp)
but it compile to ".so" file not to object.
Setting variable SET (CMAKE_CXX_COMPILE_OBJECT true)
also have no effect.

Any ideas?

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Visual Studio Linker

2008-01-13 Thread Alex Demidenko
> Hello, everyone! I have occur need to change Visual Studio linker (
link.exe)
> to some other external linker while build project by nmake. How i can do
it by CMake?
I have same question.
Somebody know, how I can easy change linker?


-- 
-
With best regards, Alex.
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

[CMake] help installing cmake

2007-08-08 Thread Alex Dantart
I follow the instructions of Install page 
(http://cmake.org/HTML/Install.html) and with cmake 2.4.7 downloaded and 
untar I run "cmake ."

but it shows this:

# cmake .
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- broken
The C compiler "/usr/bin/gcc" is not able to compile a simple test program.
It fails with the following output:
/usr/bin/cmake -H/usr/src/cmake-2.4.7/CMakeTmp 
-B/usr/src/cmake-2.4.7/CMakeTmp --check-build-system 
CMakeFiles/Makefile.cmake 0

/usr/bin/make -f CMakeFiles/Makefile2 cmTryCompileExec
make[1]: Entering directory `/usr/src/cmake-2.4.7/CMakeTmp'
/usr/bin/cmake -H/usr/src/cmake-2.4.7/CMakeTmp 
-B/usr/src/cmake-2.4.7/CMakeTmp --check-build-system 
CMakeFiles/Makefile.cmake 0

/usr/bin/make -f CMakeFiles/Makefile2 CMakeFiles/cmTryCompileExec.dir/all
make[2]: Entering directory `/usr/src/cmake-2.4.7/CMakeTmp'
/usr/bin/make -f CMakeFiles/cmTryCompileExec.dir/build.make 
CMakeFiles/cmTryCompileExec.dir/depend

make[3]: Entering directory `/usr/src/cmake-2.4.7/CMakeTmp'
Scanning dependencies of target cmTryCompileExec
/usr/bin/cmake -E cmake_depends  "Unix Makefiles" 
/usr/src/cmake-2.4.7/CMakeTmp /usr/src/cmake-2.4.7/CMakeTmp 
/usr/src/cmake-2.4.7/CMakeTmp/CMakeFiles/cmTryCompileExec.dir/DependInfo.cmake

make[3]: Leaving directory `/usr/src/cmake-2.4.7/CMakeTmp'
/usr/bin/make -f CMakeFiles/cmTryCompileExec.dir/build.make 
CMakeFiles/cmTryCompileExec.dir/build

make[3]: Entering directory `/usr/src/cmake-2.4.7/CMakeTmp'
Building C object CMakeFiles/cmTryCompileExec.dir/testCCompiler.o
/usr/bin/gcc  -o CMakeFiles/cmTryCompileExec.dir/testCCompiler.o   -c 
/usr/src/cmake-2.4.7/CMakeTmp/testCCompiler.c

Linking C executable cmTryCompileExec
/usr/bin/cmake -E remove -f cmTryCompileExec
/usr/bin/gcc-fPIC 
"CMakeFiles/cmTryCompileExec.dir/testCCompiler.o"   -o cmTryCompileExec 
-rdynamic

/usr/bin/ld: crt1.o No hay tal fichero: No existe el fichero ó directorio
collect2: ld devolvió el estado de salida 1
make[3]: *** [cmTryCompileExec] Error 1
make[3]: Leaving directory `/usr/src/cmake-2.4.7/CMakeTmp'
make[2]: *** [CMakeFiles/cmTryCompileExec.dir/all] Error 2
make[2]: Leaving directory `/usr/src/cmake-2.4.7/CMakeTmp'
make[1]: *** [CMakeFiles/cmTryCompileExec.dir/rule] Error 2
make[1]: Leaving directory `/usr/src/cmake-2.4.7/CMakeTmp'
make: *** [cmTryCompileExec] Error 2


CMake will not be able to correctly generate this project.
CMake Error: your CXX compiler: CMAKE_CXX_COMPILER_FULLPATH-NOTFOUND was 
not found in your path.   For CMake to correctly use try compile 
commands, the compiler must be in your path.   Please add the compiler 
to your PATH environment, and re-run CMake.

-- Configuring done



I have gcc and I have used it many times:

# gcc -v
Usando especificaciones internas.
Objetivo: i486-linux-gnu
Configurado con: ../src/configure -v 
--enable-languages=c,c++,java,f95,objc,ada,treelang --prefix=/usr 
--enable-shared --with-system-zlib --libexecdir=/usr/lib 
--without-included-gettext --enable-threads=posix --enable-nls 
--program-suffix=-4.0 --enable-__cxa_atexit --enable-clocale=gnu 
--enable-libstdcxx-debug --enable-java-awt=gtk-default 
--enable-gtk-cairo 
--with-java-home=/usr/lib/jvm/java-1.4.2-gcj-4.0-1.4.2.0/jre 
--enable-mpfr --disable-werror --with-tune=pentium4 
--enable-checking=release i486-linux-gnu

Modelo de hilos: posix
gcc versión 4.0.3 (Ubuntu 4.0.3-1ubuntu5)



The environments variables seems well:

# env | grep cc
CC=/usr/bin/gcc
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Re: problems compilating 2.4.7 under 2.2

2007-08-07 Thread Alex Dantart

doing exacly that was exactly the reason I wrote here...
in my first email of this trhread you will see the problems doing that


Philip Lowman wrote:

Alex Dantart wrote:
  

Matthew Woehlke wrote:


Alex Dantart wrote:
  

Matthew Woehlke wrote:


Any reason you aren't using a pre-compiled binary?
  

where can i find a pre-compiled binary >2.4.2 for ubuntu ? I can't !


http://www.cmake.org/HTML/Download.html ??
  

WHERE ?!?!?!
no binnaries for ubuntu there !!
the .sh just decompress the same that tarball :P



The CMake team does not attempt to package Linux binaries for every
Linux distribution, they leave this to the distributions themselves.

The precompiled binaries they distribute will most likely work on your
distribution just fine.

Just run the "cmake" binary in the tarball that was uncompressed:

$ cd /path/to/build/dir
$ /path/to/cmake-2.4.7-Linux-i386/bin/cmake /path/to/source/dir

Any builds you configure will use the CMake that you downloaded (so
don't move it after you untar it otherwise your builds will break) :)

  
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Re: problems compilating 2.4.7 under 2.2

2007-08-07 Thread Alex Dantart



Matthew Woehlke wrote:

Alex Dantart wrote:

Matthew Woehlke wrote:

Any reason you aren't using a pre-compiled binary?


where can i find a pre-compiled binary >2.4.2 for ubuntu ? I can't !


http://www.cmake.org/HTML/Download.html ??


WHERE ?!?!?!
no binnaries for ubuntu there !!
the .sh just decompress the same that tarball :P
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Re: problems compilating 2.4.7 under 2.2

2007-08-07 Thread Alex Dantart

Matthew Woehlke wrote:

Alex Dantart wrote:

Hi:

I need cmake > 2.4.2 for a project.
I'm on ubuntu. First I installed the cmake I have in the dapper 
repository: apt-get install cmake

That installs 2.2 successfully:
[snip bits about cmake 2.2 not building newer cmake]


Any reason you aren't using a pre-compiled binary? Alternatively, 
maybe you should try bootstrappping cmake (you can build cmake on a 
system that doesn't already have cmake...) without using the older 
cmake version?



where can i find a pre-compiled binary >2.4.2 for ubuntu ? I can't !
If I try to do it without cmake this happens:

/usr/src/cmake-2.4.7# ./bootstrap
-
CMake 2.4-7, Copyright (c) 2006 Kitware, Inc., Insight Consortium
C compiler on this system is: /usr/bin/gcc
C++ compiler on this system is: /usr/bin/gcc
-
Error when bootstrapping CMake:
Cannot find appropriate Makefile processor on this system.
Please specify one using environment variable MAKE.
-



___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] problems compilating 2.4.7 under 2.2

2007-08-07 Thread Alex Dantart

Hi:

I need cmake > 2.4.2 for a project.
I'm on ubuntu. First I installed the cmake I have in the dapper 
repository: apt-get install cmake

That installs 2.2 successfully:

# cmake
cmake version 2.2-patch 3
...


Now, I follow the instructions of Install page 
(http://cmake.org/HTML/Install.html) and with cmake 2.4.7 downloaded and 
untar I run "cmake ."

but it shows this:

7# cmake .
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- broken
The C compiler "/usr/bin/gcc" is not able to compile a simple test program.
It fails with the following output:
/usr/bin/cmake -H/usr/src/cmake-2.4.7/CMakeTmp 
-B/usr/src/cmake-2.4.7/CMakeTmp --check-build-system 
CMakeFiles/Makefile.cmake 0

/usr/bin/make -f CMakeFiles/Makefile2 cmTryCompileExec
make[1]: Entering directory `/usr/src/cmake-2.4.7/CMakeTmp'
/usr/bin/cmake -H/usr/src/cmake-2.4.7/CMakeTmp 
-B/usr/src/cmake-2.4.7/CMakeTmp --check-build-system 
CMakeFiles/Makefile.cmake 0

/usr/bin/make -f CMakeFiles/Makefile2 CMakeFiles/cmTryCompileExec.dir/all
make[2]: Entering directory `/usr/src/cmake-2.4.7/CMakeTmp'
/usr/bin/make -f CMakeFiles/cmTryCompileExec.dir/build.make 
CMakeFiles/cmTryCompileExec.dir/depend

make[3]: Entering directory `/usr/src/cmake-2.4.7/CMakeTmp'
Scanning dependencies of target cmTryCompileExec
/usr/bin/cmake -E cmake_depends  "Unix Makefiles" 
/usr/src/cmake-2.4.7/CMakeTmp /usr/src/cmake-2.4.7/CMakeTmp 
/usr/src/cmake-2.4.7/CMakeTmp/CMakeFiles/cmTryCompileExec.dir/DependInfo.cmake

make[3]: Leaving directory `/usr/src/cmake-2.4.7/CMakeTmp'
/usr/bin/make -f CMakeFiles/cmTryCompileExec.dir/build.make 
CMakeFiles/cmTryCompileExec.dir/build

make[3]: Entering directory `/usr/src/cmake-2.4.7/CMakeTmp'
Building C object CMakeFiles/cmTryCompileExec.dir/testCCompiler.o
/usr/bin/gcc  -o CMakeFiles/cmTryCompileExec.dir/testCCompiler.o   -c 
/usr/src/cmake-2.4.7/CMakeTmp/testCCompiler.c

Linking C executable cmTryCompileExec
/usr/bin/cmake -E remove -f cmTryCompileExec
/usr/bin/gcc-fPIC 
"CMakeFiles/cmTryCompileExec.dir/testCCompiler.o"   -o cmTryCompileExec 
-rdynamic

/usr/bin/ld: crt1.o No hay tal fichero: No existe el fichero ó directorio
collect2: ld devolvió el estado de salida 1
make[3]: *** [cmTryCompileExec] Error 1
make[3]: Leaving directory `/usr/src/cmake-2.4.7/CMakeTmp'
make[2]: *** [CMakeFiles/cmTryCompileExec.dir/all] Error 2
make[2]: Leaving directory `/usr/src/cmake-2.4.7/CMakeTmp'
make[1]: *** [CMakeFiles/cmTryCompileExec.dir/rule] Error 2
make[1]: Leaving directory `/usr/src/cmake-2.4.7/CMakeTmp'
make: *** [cmTryCompileExec] Error 2


CMake will not be able to correctly generate this project.
CMake Error: your CXX compiler: CMAKE_CXX_COMPILER_FULLPATH-NOTFOUND was 
not found in your path.   For CMake to correctly use try compile 
commands, the compiler must be in your path.   Please add the compiler 
to your PATH environment, and re-run CMake.

-- Configuring done



I have gcc and I have used it many times:

# gcc -v
Usando especificaciones internas.
Objetivo: i486-linux-gnu
Configurado con: ../src/configure -v 
--enable-languages=c,c++,java,f95,objc,ada,treelang --prefix=/usr 
--enable-shared --with-system-zlib --libexecdir=/usr/lib 
--without-included-gettext --enable-threads=posix --enable-nls 
--program-suffix=-4.0 --enable-__cxa_atexit --enable-clocale=gnu 
--enable-libstdcxx-debug --enable-java-awt=gtk-default 
--enable-gtk-cairo 
--with-java-home=/usr/lib/jvm/java-1.4.2-gcj-4.0-1.4.2.0/jre 
--enable-mpfr --disable-werror --with-tune=pentium4 
--enable-checking=release i486-linux-gnu

Modelo de hilos: posix
gcc versión 4.0.3 (Ubuntu 4.0.3-1ubuntu5)



The environments variables seems well:

# env | grep cc
CC=/usr/bin/gcc



any ideas ?

THANK YOU !


___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] CMake and VC-80 configurations

2006-07-11 Thread Alex Makarenko
> There is some documentation in the CMake book.  There is also a
> user-maintained list here:
>
> http://www.cmake.org/Wiki/CMake_Useful_Variables
>
> We would like to auto-generate documentation for variables as is done
> for commands but it is not yet implemented.

Thanks Brad, an exhaustive list with even minimum explanations would be very 
useful.

alex
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] mixing Java and C++ in one project

2006-07-10 Thread Alex Makarenko
I'm new to Java and simply wanted to compile a hello world executable within 
an existing C++ project. I took the example from 
cmake-2.4.2/Tests/Java/ and stuck it inside my project. It didn't quite work 
as I expected so i've been playing with Tests/Java/ and Tests/Simple/ trying 
to combine them into a project and see what works and what doesn't.

1. Placed unmodified examples inside dir 'mixed' and combined like so:
PROJECT( mixed )
SUBDIRS( Simple Java )

Note that both subdir's define their own PROJECT's.

Result: the in-source build works but the out-of-source does NOT. Out of 
source build fails like this:

--
/opt/jdk1.5.0_07/bin/javac-classpath 
/home/makara/cvs/test/mixed-out/Java:/home/makara/cvs/test/mixed-out/build/Java 
  /home/makara/cvs/test/mixed-out/Java/HelloWorld.java -d 
CMakeFiles/hello.dir
/home/makara/cvs/test/mixed-out/Java/HelloWorld.java:1: error while writing 
HelloWorld: CMakeFiles/hello.dir/HelloWorld.class (No such file or directory)
class HelloWorld
^
1 error
--
The problem seems to be with the relative path following '-d' flag. That line 
fails when executed manually as is, but works if I put the absolute path in. 
Is there a fix?

2. is it possible to do this without creating sub-projects for Simple and 
Java? The documentation for PROJECT says that "By default all languages are 
supported." Does it mean that all of them are supported at once or only one 
at a time?

If Java is build without a PROJECT command, I get this:
/bin/sh: -classpath: command not found

If I say PROJECT( mixed CXX Java ), then C++ doesn't get setup properly:
Linking CXX static library libsimpleLib.a
/bin/sh: cr: command not found

Thanks a lot, Alex
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] CMake and VC-80 configurations

2006-07-09 Thread Alex Makarenko
Thanks a lot Brad,

Using \${CTEST_CONFIGURATION_TYPE} works. Is there some official document 
where I could look up these variables in the future?

Regarding "-C Debug" option, I've seconded Miguel's feature request on the web 
site.

alex


On Thursday 06 July 2006 00:53, you wrote:
> Alex Makarenko wrote:
> > High all,
> >
> > I'm struggling with build configurations in VC-80. I have two specific
> > questions:
> >
> > 1) Does ${OutDir} get resolved for arbitrary paths (other than to
> > targets)? E.g. I want to specify the path to a text config file generated
> > during the build. The cmake command and the result of running the test
> > are shown below. Notice that the path to the test executable is properly
> > resolved but the path to the config file is not.
> >
> > # cmake:
> > ADD_TEST( T1010 appproptest
> > --Config=${CMAKE_CFG_INTDIR}/apppropteston.cfg )
>
> The tests are run by ctest which does not expand VS vars like OutDir.
> Try this:
>
> ADD_TEST( T1010 appproptest
> --Config=\${CTEST_CONFIGURATION_TYPE}/apppropteston.cfg )
>
> Note the backslash.  This should put "${CTEST_CONFIGURATION_TYPE}"
> literally into the test file.  CTest will expand this with the current
> configuration (-C option) when running tests

>
> > 2) Is it possible to force VC-80 to switch configurations from
> > cmake/ctest? My understanding that CMAKE_BUILD_TYPE is irrelevant in this
> > case, right? So I try to use -C option with ctest, with no apparent
> > result (notice "/build Release" in both cases). Is there something else
> > that needs to be done?
>
> CMAKE_BUILD_TYPE is for the Makefile generators, so it is irrelevant
> here.  The -C option was originally meant for running tests but not
> building.  I see no reason that it should not work for driving build
> too.  Please submit a feature request:
>
> http://www.cmake.org/Bug
>
> -Brad

-- 
---
Dr. Alex Makarenko
Australian Research Fellow
Centre for Autonomous Systems
(Australian Centre for Field Robotics)
Dept. of Mechanical & Mechatronic Engineering
J04 The University of Sydney 2006 NSW, AUSTRALIA 
alexei[at]cas.edu.au 
www.cas.edu.au
+61 (0)2 9036 7057 (tel)
+61 (0)2 9351 7474 (fax)
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] CMake and VC-80 configurations

2006-07-04 Thread Alex Makarenko
High all,

I'm struggling with build configurations in VC-80. I have two specific
questions:

1) Does ${OutDir} get resolved for arbitrary paths (other than to targets)?
E.g. I want to specify the path to a text config file generated during the
build. The cmake command and the result of running the test are shown below.
Notice that the path to the test executable is properly resolved but the
path to the config file is not.

# cmake:
ADD_TEST( T1010 appproptest --Config=${CMAKE_CFG_INTDIR}/apppropteston.cfg )

>C:\proj\build>ctest -V -D ExperimentalTest -C Release -I 12,12
...
Test command: C:\proj\build\src\utils\orcaice\test\release\appproptest.exe
--Config=$(Ou
tDir)/appproptestoff.cfg
...

2) Is it possible to force VC-80 to switch configurations from cmake/ctest?
My understanding that CMAKE_BUILD_TYPE is irrelevant in this case, right? So
I try to use -C option with ctest, with no apparent result (notice "/build
Release" in both cases). Is there something else that needs to be done?

C:\proj\build>ctest -V -D ExperimentalBuild -C Release
   Site: AGAVE
   Build name: Win32-vs8
Start processing tests
Build project
Run command: "C:\PROGRA~1\MICROS~4\Common7\IDE\devenv.com" "proj.sln"
"/build" "
Release" "/project" "ALL_BUILD"
   Each symbol represents 1024 bytes of output.
   '!' represents an error and '*' a warning.


C:\proj\build>ctest -V -D ExperimentalBuild -C Debug
   Site: AGAVE
   Build name: Win32-vs8
Start processing tests
Build project
Run command: "C:\PROGRA~1\MICROS~4\Common7\IDE\devenv.com" "proj.sln"
"/build" "
Release" "/project" "ALL_BUILD"
   Each symbol represents 1024 bytes of output.
   '!' represents an error and '*' a warning.

Thanks for any pointers, alex


___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] dependencies on auto-generated files and VC-8.0

2006-07-02 Thread Alex Makarenko
Hi Bill,

everything works now. In the process of collecting details to show to you I 
realized that problems were in a different dependent library and that one did 
not have the TARGET_LINK_LIBRARIES or ADD_DEPENDENDCY set.

thanks a lot for your time,
alex


On Sunday 02 July 2006 12:32, you wrote:
> At 09:12 PM 7/1/2006, Alex Makarenko wrote:
> >> Try this:
> >> ADD_DEPENDENCIES(Lib1 Lib0)
> >
> >Tried it, does not change anything, unfortunately.
> >
> >My understanding is that with non-custom targets (like libraries)
> >TARGET_LINK_LIBRARIES implies the dependency which ADD_DEPENDENCIES
> >specifies explicitly for custom targets.
>
> It should work, and does for other projects, so something odd is happening
> here. Can you provide a small example, and add a bug to the bug tracker?
>
> -Bill
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


RE: [CMake] dependencies on auto-generated files and VC-8.0

2006-07-01 Thread Alex Makarenko
> 
> Try this:
> ADD_DEPENDENCIES(Lib1 Lib0)
> 

Tried it, does not change anything, unfortunately. 

My understanding is that with non-custom targets (like libraries)
TARGET_LINK_LIBRARIES implies the dependency which ADD_DEPENDENCIES
specifies explicitly for custom targets.



___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] dependencies on auto-generated files and VC-8.0

2006-06-30 Thread Alex Makarenko
Hello,

We are porting a fairly large C++ project from linux/gcc to win32/vc-80. We
are using cmake 2.4.2. Everything is ok except for dependencies between
targets and auto-generated files. 

Before going into details I want to ask a general question about a paragraph
on p.16 of Mastering CMake book which says "CMake has built-in dependency
analysis capabilities for C and C++ source code files. Since IDE's support
and maintain dependency information, CMake skips this step for those build
systems." 

Does it mean that CMake does not communicate any dependency information to
Visual Studio? If so, then there is no point in trying to relate the
dependency structure to CMake.

Thanks a lot,
Alex Makarenko


___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake