I want to add stuff to a custom command based on some definition:
cmake_minimum_required(VERSION 2.6)
set(DO_RELAX 1)
if(DO_RELAX)
set(OR_RELAX || echo \no big deal\)
else()
set(OR_RELAX )
endif()
add_custom_command(OUTPUT foo COMMAND generate-foo ${OR_RELAX})
add_custom_target(do-foo
characters.
http://www.cmake.org/cmake/help/v3.0/command/add_custom_command.html
On Fri, Jul 25, 2014 at 11:20 AM, Bill Newcomb bnewc...@nvidia.com wrote:
I want to add stuff to a custom command based on some definition:
cmake_minimum_required(VERSION 2.6)
set(DO_RELAX 1)
if(DO_RELAX)
set
and subst space for semicolon?
On Tue, Jul 29, 2014 at 11:13 AM, Bill Newcomb bnewc...@nvidia.com
mailto:bnewc...@nvidia.com wrote:
That doesn't work either:
foo:
$(CMAKE_COMMAND) -E cmake_progress_report
/home/bnewcomb/tmp/cmake-tests/custom
Oops, so I guess it's not that it doesn't work at all, but that the
add_custom_command gets run every time I 'make all', and that gnu make
emits some warnings about circular dependencies. The first is more of a
problem, but both are kind of annoying.
Thanks,
B.
On 02/04/2015 01:36 PM, Bill
When I specify add_executable(foo foo.c), I get both a top-level target
(which defaults to ALL but can be set not to be) and an actual file that
gets built that are named the same (Unix Makefiles).
add_custom_target can get me the first of those for non-executable
things, and
, Alan W. Irwin wrote:
On 2015-02-05 10:14-0800 Bill Newcomb wrote:
A contrived example:
$ ls ..
b CMakeLists.txt foo
$ cat ../CMakeLists.txt
cmake_minimum_required(VERSION 3.1)
add_custom_target(foo.sha1 ALL DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/foo.sha1)
add_custom_command
paths
with add_custom_command, but I don't know if that's still necessary.
Using relative paths doesn't seem to change the outcome.
Thanks,
B.
On 02/04/2015 06:59 PM, Alan W. Irwin wrote:
On 2015-02-04 13:45-0800 Bill Newcomb wrote:
Oops, so I guess it's not that it doesn't work at all
suite maintained and supported by Kitware (kitware.com/cmake).
On Fri, Mar 13, 2015 at 7:50 PM, Bill Newcomb bnewc...@nvidia.com wrote:
Any idea what I'm doing wrong here?
$ cat foo.cmake
foreach(n RANGE ${ARGC})
message(STATUS ${n} ${CMAKE_ARGV${n}})
endforeach()
message(STATUS
Any idea what I'm doing wrong here?
$ cat foo.cmake
foreach(n RANGE ${ARGC})
message(STATUS ${n} ${CMAKE_ARGV${n}})
endforeach()
message(STATUS ${CMAKE_ARGV0})
message(STATUS ${CMAKE_ARGV1})
message(STATUS ${CMAKE_ARGV2})
$ cmake -P foo.cmake a b c
-- 0
--
--
--
$ cmake a b c -P foo.cmake
--
Is there a straightforward way to build statically linked cmake and
ctest binaries on Linux?
Thanks,
B.
---
This email message is for the sole use of the intended recipient(s) and may
contain
confidential
In cmake 2.6, I could do something kind of bogus like this:
get_filename_component(MY_COMPILER_PREFIX ${CMAKE_C_COMPILER} PATH)
set(MY_RPATH ${MY_COMPILER_PREFIX}/../CentOS-5.7/x86_64/lib)
link_directories(${MY_RPATH})
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
The following is all on Linux (with gcc, gnu binutils, etc).
I'm trying to build libfred.so that uses code from libjoe.a, but I want
libfred.so to be complete, i.e. I don't want any program that I build
that links to libfred.so also need libjoe.a.
Then I want to build executable mike that is
in fred
target_link_libraries(mike fred)
I hope this helps.
Petr
On Thu, Apr 16, 2015 at 12:07 AM, Bill Newcomb bnewc...@nvidia.com
mailto:bnewc...@nvidia.com wrote:
The following is all on Linux (with gcc, gnu binutils, etc).
I'm trying to build libfred.so that uses code from libjoe.a
Suppose I add a library in my project:
add_library(foo STATIC foo.c bar.c)
Is there a way I can get the name of the generated library file at
configure time? LIBRARY_OUTPUT_NAME and OUTPUT_NAME for the target do
not seem to be set:
get_target_property(libname foo LIBRARY_OUTPUT_NAME)
Anyone?
Thanks,
B.
On 09/18/2015 11:42 AM, Bill Newcomb wrote:
Suppose I add a library in my project:
add_library(foo STATIC foo.c bar.c)
Is there a way I can get the name of the generated library file at
configure time? LIBRARY_OUTPUT_NAME and OUTPUT_NAME for the target do
not seem
further description--I
know it's a mess :-)
Thanks,
B.
On 09/22/2015 11:50 AM, Nils Gladitz wrote:
On 09/18/2015 11:42 AM, Bill Newcomb wrote:
Suppose I add a library in my project:
add_library(foo STATIC foo.c bar.c)
Is there a way I can get the name of the generated library file at
configure
My top-level CMakeLists.txt files always end up with a lot of
if(NOT_DEFINED foo)
set(foo bar)
endif()
things to allow people to pass interesting things on the command line or
to write their own "set this and that" CMakeLists.txt and include the
top-level one.
It would improve
17 matches
Mail list logo