Re: [CMake] String error Cmake

2012-04-03 Thread Aaron_Wright
Did you define Executor::runCommand(...)?

---
Aaron Wright




From:   Mauricio Klein 
To: cmake@cmake.org
Date:   04/03/2012 11:49 AM
Subject:Re: [CMake] String error Cmake
Sent by:cmake-boun...@cmake.org



One more information:

Andreas, i'm compiling at least 10 .cpp codes, many of them using string 
without problems.

The error is occurring just in this function, but i've assured that string 
libraries are included.

On Tue, Apr 3, 2012 at 3:46 PM, Mauricio Klein <
mauricio.klein@gmail.com> wrote:
The complete error is the following:


CMakeFiles/MonitoraITSchedulerAgent.dir/SourceCode/src/Executor.cpp.o: In 
function `Executor::execute(Service*, unsigned int)':
Executor.cpp:(.text+0x8c): undefined reference to 
`Executor::runCommand(char const*, unsigned int, std::basic_string, std::allocator >&)'
CMakeFiles/MonitoraITSchedulerAgent.dir/SourceCode/src/ServiceProvider.cpp.o: 
In function `ServiceProvider::sendDiscovery()':
ServiceProvider.cpp:(.text+0x9b6): undefined reference to 
`Executor::runCommand(char const*, unsigned int, std::basic_string, std::allocator >&)'
collect2: ld returned 1 exit status
make[2]: *** [MonitoraITSchedulerAgent] Error 1
make[1]: *** [CMakeFiles/MonitoraITSchedulerAgent.dir/all] Error 2
make: *** [all] Error 2


The function header that is generating the error is:


int runCommand(const char* command, unsigned int timeout, string& output);


I've already included "" and declared "using namespace std".

Thanks for any reply!


On Tue, Apr 3, 2012 at 3:37 PM, Andreas Pakulat  wrote:
On 03.04.12 14:26:01, Mauricio Klein wrote:
> Hello fellows!
>
> I'm compiling my code using CMake and i'm receiving a linker error like
> this:
> std::basic_string, std::allocator >

When you get errors, post the complete error message and not just a
part. The above is completely useless.

> After few researches on the internet, i realized that this kind of error
> occurs when compiling a C++ code with GCC, instead G++.
>
> My question is: how can i force CMake to use G++ as default compiler?

CMake already does this when you feed it c++ sources. So check you
project wether you maybe disabled C++ support, or wether you maybe have
C++ code in .c files.

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



-- 
Best regards,

Maurício Souza Klein.



-- 
Best regards,

Maurício Souza Klein.--

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] Cannot find source file: *.rc

2011-05-26 Thread Aaron_Wright
> From: Michael Wild 
> To: cmake@cmake.org
> Date: 05/25/2011 10:08 PM
> Subject: Re: [CMake] Cannot find source file: *.rc
> Sent by: cmake-boun...@cmake.org
> 
> On 05/25/2011 11:40 PM, aaron_wri...@selinc.com wrote:
> > I use mc.exe to generate an *.rc file and some headers for my program.
> > The *.rc file is listed as an output of a custom command and as a 
source
> > to an executable. During configuration CMake tells me it can't find a
> > source file and lists the *.rc file. I've check the generated property
> > of the *.rc file and it is true, so why does CMake expect it to be
> > present during configuration?
> > 
> > I've tried to make a small example, but when I try to do that 
everything
> > works. What I'm looking for is a reason why it would only effect large
> > build systems on not small build system, or why does this only effect
> > this *.rc and none of the other twenty or thirty files I generate? Is
> > there something special about *.rc files?
> > 
> > I'm really just grabbing at straws here because I've been trying to 
fix
> > this for months, with no luck. So any ideas are welcome.
> > 
> > ---
> > Aaron Wright
> 
> Is the add_custom_command call generating the *.rc file in the same
> directory as your add_executable call?
> 
> Michael

It is neither in the same CMakeLists.txt nor is the *.rc file generated 
anywhere close to the executable.

I did work around this by writing a dummy file at configure time with 
FILE(WRITE. Thought that seems a little hacky.___
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] Cannot find source file: *.rc

2011-05-25 Thread Aaron_Wright
I use mc.exe to generate an *.rc file and some headers for my program. The 
*.rc file is listed as an output of a custom command and as a source to an 
executable. During configuration CMake tells me it can't find a source 
file and lists the *.rc file. I've check the generated property of the 
*.rc file and it is true, so why does CMake expect it to be present during 
configuration?

I've tried to make a small example, but when I try to do that everything 
works. What I'm looking for is a reason why it would only effect large 
build systems on not small build system, or why does this only effect this 
*.rc and none of the other twenty or thirty files I generate? Is there 
something special about *.rc files?

I'm really just grabbing at straws here because I've been trying to fix 
this for months, with no luck. So any ideas are welcome.

---
Aaron Wright
Software Engineer - Synchrophasors
Schweitzer Engineering Laboratories, Inc.
Pullman, WA 99163
509-334-8087
___
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] Dependencies scanning for non-c/c++ files

2011-04-06 Thread Aaron_Wright
Ah, I see this is an issue already discussed in length. Well hopefully 
something comes of these discussions.

Thanks for the links.

---
Aaron Wright




From:   Michael Hertling 
To: cmake@cmake.org
Date:   04/06/2011 05:03 AM
Subject:Re: [CMake] Dependencies scanning for non-c/c++ files
Sent by:cmake-boun...@cmake.org



On 04/05/2011 06:26 PM, aaron_wri...@selinc.com wrote:

> There's a base class for the dependency scanners and several derived 
> classes for C, java, fortan, etc. Would it not be easy to just derive 
> another class for each file type I need? These dependency scanner 
classes 
> seemed to just regex each line in the file looking for "include" or 
> "import", or some other language specific keyword. That would work for 
me, 
> I could just scan for "m4_include". 

Probably, this is well feasible, but IMO, it would be really worthwhile
to - optionally - enable the usage of an external tool to do dependency
scanning, for new languages as well as for the premier ones like C/C++
in case one wants to overcome the built-in scanner's shortcomings while
accepting certain performance penalties. There has already been some
considerations and requests in this regard, e.g.:

http://www.mail-archive.com/cmake@cmake.org/msg30396.html (!)
http://public.kitware.com/Bug/view.php?id=11985
http://public.kitware.com/Bug/view.php?id=11770
http://public.kitware.com/Bug/view.php?id=2172

Regards,

Michael
___
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] Dependencies scanning for non-c/c++ files

2011-04-05 Thread Aaron_Wright
Wow. Thanks Michael. That's a very thorough answer. I like your idea, but 
it just doesn't feel right. It seems to me that the right way to do it 
would be to patch CMake. 

There's a base class for the dependency scanners and several derived 
classes for C, java, fortan, etc. Would it not be easy to just derive 
another class for each file type I need? These dependency scanner classes 
seemed to just regex each line in the file looking for "include" or 
"import", or some other language specific keyword. That would work for me, 
I could just scan for "m4_include". 

In the mean time however, I think I could slip in one of your solutions. 
Thanks again.

---
Aaron Wright




From:   Michael Hertling 
To: cmake@cmake.org
Date:   04/05/2011 08:36 AM
Subject:Re: [CMake] Dependencies scanning for non-c/c++ files
Sent by:cmake-boun...@cmake.org



On 04/03/2011 02:25 AM, aaron_wri...@selinc.com wrote:
> I have some m4 files in my build that include other m4 files, so there's 
a 
> dependency between m4 files that can change at any time. I can calculate 

> the dependency at configure time, but what can I do when the files 
change 
> and I need to recalculate the dependencies? This is obviously handled 
for 
> c/c++ files by CMake. Any ideas?
> 
> ---
> Aaron Wright

Build-time dependency scanning without resorting to CMake's built-in
dependency scanner is possible but ugly, in a sort. First of all, you
need a custom target which suitably sets up the dependencies, and you
need to make the CMakeLists.txt file depend on them so that a change
of the dependencies will trigger a reconfiguration-before-rebuild in
order to recognize these new dependencies. In the following examples,
this gets done by a CMake script that gathers all files in a denoted
directory and writes their names to a file containing a CMake SET()
command, and this file gets included in the CMakeLists.txt. In that
way, changing dependencies invalidate the CMakeLists.txt file, and
the filenames - assigned to a variable by the SET() command - are
used to populate the OBJECT_DEPENDS property of a target, so the
latter gets also rebuilt when those files are touched.

Now, the key consideration is that you need two independent Make runs
for the home-brewed build-time dependency scanning to work: The first
run triggers the above-mentioned custom target to update dependencies,
and the second run builds your project with up-to-date dependencies -
maybe after a reconfiguration. AFAICS, this cannot be done in one go
because of the possibly needed intermediate CMake run to reconfigure.

In order to perform these two independent Make runs, you might:

1) Do it manually, e.g. "make dependencies; make". The downside is
   that you'll miss changed dependencies if you forget to perform
   the "dependencies" run.

2) For each affected target, introduce a helper target which triggers
   the dependencies target and subsequently builds the actual target
   via "cmake --build". Look at the following:

# CMakeLists.txt:
CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR)
PROJECT(DEPENDENCIES C)
ADD_CUSTOM_TARGET(dependencies
${CMAKE_COMMAND}
-DTEMPLATE=${CMAKE_SOURCE_DIR}/filelist.cmake.in
-DVARIABLE=DEPENDENCIES
-DDIRECTORY=${CMAKE_SOURCE_DIR}/dependencies
-DOUTPUT=${CMAKE_BINARY_DIR}/dependencies.txt
-P ${CMAKE_SOURCE_DIR}/dependencies.cmake)
IF(NOT EXISTS ${CMAKE_BINARY_DIR}/dependencies.txt)
EXECUTE_PROCESS(
COMMAND ${CMAKE_COMMAND}
-DTEMPLATE=${CMAKE_SOURCE_DIR}/filelist.cmake.in
-DVARIABLE=DEPENDENCIES
-DDIRECTORY=${CMAKE_SOURCE_DIR}/dependencies
-DOUTPUT=${CMAKE_BINARY_DIR}/dependencies.txt
-P ${CMAKE_SOURCE_DIR}/dependencies.cmake)
ENDIF()
FILE(WRITE ${CMAKE_BINARY_DIR}/main.c "int main(void){return 0;}\n")
INCLUDE(${CMAKE_BINARY_DIR}/dependencies.txt)
SET_SOURCE_FILES_PROPERTIES(${CMAKE_BINARY_DIR}/main.c
PROPERTIES OBJECT_DEPENDS "${DEPENDENCIES}")
ADD_EXECUTABLE(main0 EXCLUDE_FROM_ALL main.c)
ADD_CUSTOM_TARGET(main ALL
COMMAND ${CMAKE_COMMAND}
--build ${CMAKE_BINARY_DIR}
--target dependencies
COMMAND ${CMAKE_COMMAND}
--build ${CMAKE_BINARY_DIR}
--target main0)

# dependencies.cmake:
FILE(GLOB FILES ${DIRECTORY}/*)
CONFIGURE_FILE(${TEMPLATE} ${OUTPUT} @ONLY)

# filelist.cmake.in:
SET(@VARIABLE@ @FILES@)

The dependencies target runs the dependencies.cmake script which
generates the dependencies.txt file with the filenames from the
dependencies directory; the dependencies.txt file must be created
once initially and it contains the above-mentioned SET() command,
i.e. SET(DEPENDENCIES ). The actual
target is main0, but the target which is triggered when building
the project is main, and it's this main target that performs the
two independent Make runs using the CMake "--build" option. Note
that due to the use of CONFIGULE_FILE(), the dependencies target
can run each time without causing the project's reconfiguration,
provided the dependencies have

[CMake] Dependencies scanning for non-c/c++ files

2011-04-03 Thread Aaron_Wright
I have some m4 files in my build that include other m4 files, so there's a 
dependency between m4 files that can change at any time. I can calculate 
the dependency at configure time, but what can I do when the files change 
and I need to recalculate the dependencies? This is obviously handled for 
c/c++ files by CMake. Any ideas?

---
Aaron Wright

___
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] Bug fix requests for the *next* release of CMake...

2011-03-30 Thread Aaron_Wright
http://public.kitware.com/Bug/view.php?id=11171

I'm hoping this one isn't too hard to fix.

---
Aaron Wright




From:   David Cole 
To: cmake , CMake Developers 

Date:   03/29/2011 10:57 AM
Subject:[CMake] Bug fix requests for the *next* release of 
CMake...
Sent by:cmake-boun...@cmake.org



Hi all,

Now that we have released CMake 2.8.4, *now* would be a great time to 
prioritize bug fixes for the next release of CMake.

Replies requested. Read on. Just a short reply with bug numbers or links 
to the bugs is all we need here. Please move specific discussions into 
the bugs themselves or start a new thread to talk about it... Replies on 
this thread should just be a collector for bug numbers.

We are aiming for quarterly releases from now on, scheduling them every 3 
or 4 months. That would make the next release of CMake version 2.8.5,
 scheduled to have an "rc1" release candidate on Wed. April 27, 2011.

If you have a particular issue that you think should be fixed for 
inclusion in 2.8.5, please bring it up by the end of this week. Ideally, 
each issue will be discussed as needed on the mailing list to come to any 
consensus about what should be done to fix it, and then an entry in the 
bug tracker may be used to keep it on the radar screen, and to track 
activity related to it.

Patches are always welcome. Patches that include testing of any new 
features, or tests that prove a bug is really fixed on the dashboards, 
basically any patch with testing is preferred over a patch with no 
testing. Also, if you are *adding* code, then you also probably need to 
add *tests* of that code, so that the coverage percentage stays as is or 
rises.

Please discuss issues here as needed, and add notes to existing issues in 
the bug tracker that you are interested in seeing fixed for 2.8.5 -- we 
will be looking at the mailing list and activity in the bug tracker to 
help prioritize the bug fixes that will occur over the next 4 weeks.


Thanks,
David Cole
Kitware, Inc.


P.S. - as a nice summary of what we accomplished in the CMake 2.8.4 
release, see here: http://public.kitware.com/Bug/changelog_page.php
-- it currently lists 127 issues that we resolved: nice job, everybody!

(Many of those were specifically addressed because somebody brought it up 
in response to my similar email from just after 2.8.3... Don't be shy!)
___
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] vs2010 MANIFESTUAC not handled correctly

2011-03-17 Thread Aaron_Wright
Well I tried looking at the code and found cmVS10LinkFlagTable.h was the 
only file to mention MANIFESTUAC. But I can't figure out a simple fix. It 
pretty obvious this entry in the table is way to simple:

{"UACUIAccess", "MANIFESTUAC:", "Enable User Account Control (UAC)", "", 
cmVS7FlagTable::UserValueRequired}

It seems to just take whatever is after the colon and stuff it in the 
UACUIAccess element in the project. But it needs to be smarter than that. 
The MSDN page (http://msdn.microsoft.com/en-us/library/bb384691.aspx) says 
it could have the form of:

"level=[ asInvoker | highestAvailable | requireAdministrator ] uiAccess=[ 
true | false ]"

Which isn't a simple "//Bool Properties With Argument". Thoughts?
---
Aaron Wright

cmake-boun...@cmake.org wrote on 03/15/2011 08:23:55 AM:

> From: aaron_wri...@selinc.com
> To: cmake@cmake.org
> Date: 03/15/2011 08:24 AM
> Subject: [CMake] vs2010 MANIFESTUAC not handled correctly
> Sent by: cmake-boun...@cmake.org
> 
> I'm trying to use this in my CMake file for a simple executable:
> 
> SET_TARGET_PROPERTIES(
> your_executable 
> PROPERTIES LINK_FLAGS 
"/MANIFESTUAC:\"level='requireAdministrator' 
> uiAccess='false'\"")
> 
> This worked in vs2008, but not in vs2010. The project contains:
> 
> level='requireAdministrator' uiAccess='false'
> 
> But needs:
> 
> requireAdministrator
> false
> 
> Am I using this the correct way, or is there a way to do it to get the 
> desired results?
> ---
> Aaron Wright
> ___
> 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] vs2010 MANIFESTUAC not handled correctly

2011-03-15 Thread Aaron_Wright
I'm trying to use this in my CMake file for a simple executable:

SET_TARGET_PROPERTIES(
your_executable 
PROPERTIES LINK_FLAGS "/MANIFESTUAC:\"level='requireAdministrator' 
uiAccess='false'\"")

This worked in vs2008, but not in vs2010. The project contains:

level='requireAdministrator' uiAccess='false'

But needs:

requireAdministrator
false

Am I using this the correct way, or is there a way to do it to get the 
desired results?
---
Aaron Wright
___
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] Default visual studio filters

2011-02-25 Thread Aaron_Wright
Yeah, actually. I didn't think it would be that easy. Thanks.

---
Aaron Wright




From:   Michael Jackson 
To: aaron_wri...@selinc.com
Cc: cmake@cmake.org
Date:   02/25/2011 09:58 AM
Subject:Re: [CMake] Default visual studio filters



I have the following macro that I use:


MACRO (cmp_IDE_SOURCE_PROPERTIES SOURCE_PATH HEADERS SOURCES)
STRING(REPLACE "/" "" source_group_path ${SOURCE_PATH}  )
source_group(${source_group_path} FILES ${HEADERS} ${SOURCES})
ENDMACRO (cmp_IDE_SOURCE_PROPERTIES NAME HEADERS SOURCES INSTALL_FILES)

#Example Usage
set(SRCS Foo.cpp bar.cpp)
set(HDRS Foo.h   bar.h)
cmp_IDE_SOURCE_PROPERTIES( "Source/Lib" "${HDRS}" "${SRCS}")
add_library( foolib  ${SRCS} ${HDRS})

and in Visual Studio I get Foo.cpp bar.cpp foo.h bar.h all in the same 
"filter"/Folder thingie. Is that what you are looking for? 

___
Mike Jackson  www.bluequartz.net
Principal Software Engineer   mike.jack...@bluequartz.net 
BlueQuartz Software   Dayton, Ohio

On Feb 25, 2011, at 12:42 PM, aaron_wri...@selinc.com wrote:

> I was curious about an answer to this question. I don't think source and 

> header files should be separated either. It's just a nag, but if there 
was 
> an easy fix, I'd jump on it.
> 
> ---
> Aaron Wright
> 
> 
> 
> 
> From:   Orcun Gokbulut 
> To: cmake@cmake.org
> Date:   02/23/2011 07:48 AM
> Subject:[CMake] Default visual studio filters
> Sent by:cmake-boun...@cmake.org
> 
> 
> 
> Hello cmake users,
> 
> We are porting our visual studio based build system to cmake and its 
> allmost done with some minor problems.
> 
> One of the minor problem is default visual c++ filters (source groups)
> I don't like (actually hate) visual c++'s default *.cpp *.h filters. 
(Not 
> the filter feature but the default filters) They make navigation hard at 

> solution explorer and I want source and header file to be listed next to 

> each other. 
> Therefore I want all of my source files to be not included in a filter 
and 
> remove "Source Files" and "Header Files" filters.  I have read the 
> documentation and exprimented with SOURCE_GROUP command but I can not 
> figure out how to remove default *.cpp and *.h source groups. 
> 
> Also I'm going to add a special regex filter that combines auto 
generated 
> source codes in to a filter. Something like
> source_group (ZPP REGULAR_EXPRESSION ".*\\.zpp")
> 
> 
> How can I do that ?
> 
> Thanks every one,
> Orçun___
> 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



___
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] Default visual studio filters

2011-02-25 Thread Aaron_Wright
I was curious about an answer to this question. I don't think source and 
header files should be separated either. It's just a nag, but if there was 
an easy fix, I'd jump on it.

---
Aaron Wright




From:   Orcun Gokbulut 
To: cmake@cmake.org
Date:   02/23/2011 07:48 AM
Subject:[CMake] Default visual studio filters
Sent by:cmake-boun...@cmake.org



Hello cmake users,
 
We are porting our visual studio based build system to cmake and its 
allmost done with some minor problems.
 
One of the minor problem is default visual c++ filters (source groups)
I don't like (actually hate) visual c++'s default *.cpp *.h filters. (Not 
the filter feature but the default filters) They make navigation hard at 
solution explorer and I want source and header file to be listed next to 
each other. 
Therefore I want all of my source files to be not included in a filter and 
remove "Source Files" and "Header Files" filters.  I have read the 
documentation and exprimented with SOURCE_GROUP command but I can not 
figure out how to remove default *.cpp and *.h source groups. 
 
Also I'm going to add a special regex filter that combines auto generated 
source codes in to a filter. Something like
source_group (ZPP REGULAR_EXPRESSION ".*\\.zpp")
 
 
How can I do that ?
 
Thanks every one,
Orçun___
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] Gyp VS CMake

2011-02-17 Thread Aaron_Wright
Why did we skip point number 4. This was the biggest part of the CMake 
build system I made for my team. And I believe I borrowed a bit from the 
boost CMake adaption, so perhaps they have the same problem.

Instead of using a built in feature to accomplish this I have numerous 
macros and functions which define and accumulate the actual dependencies 
between libraries and executables. When I say a library depends on another 
library I need more than a build order and a link option added. I need the 
include directories too. Ever sense I started working with CMake I've been 
fighting with its "single top level view of the project." I finally got it 
so that I each library and executable knew about what it depended on and 
each could be built stand-alone. I just don't think a large project lends 
itself to the monolithic CMake approach.

Don't get me wrong, I was able to use CMake to solve its own short coming, 
so I like it, but it's almost like I needed a CMake generator. I almost 
wrote a python or perl script that would generate the CMake files, because 
of all the scripting I was doing in CMake. I don't need another scripting 
language.

---
Aaron Wright

___
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] VS2010 tries to compile a file with *.res extension when its copied

2011-01-21 Thread Aaron_Wright
Ah, I new that would come up. Yeah, they could be renamed. There are only 
a dozen or so of them.

I was just trying to migrate the build system to VS2010 in between 
projects here at work, and this is the only thing holding me back from a 
smooth transition. Changing the extension is certainly an option, but it 
wasn't my first. Sense this is working good in VS2008, I was hoping it was 
just a simple bug, or maybe something I was doing wrong with the 
ADD_CUSTOM_COMMAND.

Do you think this is the way its supposed to work with VS2010? Should I 
make the extension change or work with CMake more?

---
Aaron Wright




From:
David Cole 
To:
aaron_wri...@selinc.com
Cc:
"cmake@cmake.org" 
Date:
01/21/2011 08:36 AM
Subject:
Re: [CMake] VS2010 tries to compile a file with *.res extension when its 
copied
Sent by:
cmake-boun...@cmake.org



I don't think it's stupid. No judgment here. :-)

But can it be renamed, or does this logging library require ".res" as the 
file extension?


On Fri, Jan 21, 2011 at 11:22 AM,  wrote:
Well, you're probably going to think this is stupid, but the *.res file is
not actually a resource file in the Microsoft sense of it. It's just a
text file that happens to have the *.res extension. It's a string
localization text file that our logging library knows how to read. It
think it is just happen stance that the logging library expects the files
to end in *.res.

---
Aaron Wright




From:
David Cole 
To:
aaron_wri...@selinc.com
Cc:
"cmake@cmake.org" 
Date:
01/21/2011 08:10 AM
Subject:
Re: [CMake] VS2010 tries to compile a file with *.res extension when its
copied



This is similar in nature to
http://public.kitware.com/Bug/view.php?id=11147 and friends...

The fix for that issue is ending up being "obj" file specific, though,
because we have a special handler in place for files with "obj"
extensions. Perhaps we need similar handling for "res" files. (They are
really just obj files from the rc compiler...)

Do you not have the rc file? Or are you compiling it as a custom command
to avoid some other issue with rc files?

This sounds like we need to add a test similar to our existing ExternalOBJ
test, but with a pre-built res file.


Thanks for the discussion -- seems like something needs to be fixed here.
Let's track it down.

David


On Fri, Jan 21, 2011 at 10:57 AM,  wrote:
This is with both 2.8.3 and 2.8.4-rc1.

On a side note, VS2010 is not trying to compile the *.res file as part of
the executable, because it is marked HEADER_FILE_ONLY, and in addition I
can remove it entirely from the project. Instead, even when the *.res file
appears no where in the solution explorer in VS2010 (except as a
*.res.rule file), VS2010 is still trying to compile it. If I remove the
*.res.rule file it stops trying to compile it. So basically its just
something to do with the ADD_CUSTOM_COMMAND that copies the file.

---
Aaron Wright




From:
David Cole 
To:
"aaron_wri...@selinc.com" 
Cc:
"cmake@cmake.org" 
Date:
01/20/2011 07:57 PM
Subject:
Re: [CMake] VS2010 tries to compile a file with *.res extension when its
copied
Sent by:
cmake-boun...@cmake.org



Is tha with 2.8.3 or 2.8.4-rc1?

On Thursday, January 20, 2011,   wrote:
> I know I've asked this before, but now I've narrowed it down a bit and I
> have an example. This copies a *.res file to the binary directory where
> presumably the executable can find it. The executable has that file as a
> source file to hook up the dependency, and the copied file has the
> HEADER_FILE_ONLY property set. Yet, somehow VS2010 is still trying to
> compile en.res. I even tried setting the source and destination en.res
> files to HEADER_FILE_ONLY, but that didn't fix it. Removing the
> ADD_CUSTOM_COMMAND that does the copy fixes the problem. Why is this
> broken? FYI, it worked fine in VS2008.
>
> CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
>
> PROJECT(cmake_res_bug)
>
> SET(RESOURCE_FILE "${PROJECT_SOURCE_DIR}/resources/en.res")
>
> GET_FILENAME_COMPONENT(RESOURCE_FILE_BASENAME "${RESOURCE_FILE}" NAME)
> SET(LOCAL_RESOURCE_FILE
> "${PROJECT_BINARY_DIR}/resources/${RESOURCE_FILE_BASENAME}")
>
> ADD_CUSTOM_COMMAND(
>OUTPUT "${PROJECT_BINARY_DIR}/resources/${RESOURCE_FILE_BASENAME}"
>COMMAND ${CMAKE_COMMAND} -E make_directory
> "${PROJECT_BINARY_DIR}/resources"
>COMMAND ${CMAKE_COMMAND} -E copy "${RESOURCE_FILE}"
> "${PROJECT_BINARY_DIR}/resources"
>DEPENDS "${RESOURCE_FILE}"
>COMMENT "Localizing ${RESOURCE_FILE_BASENAME}")
>
> SET_SOURCE_FILES_PROPERTIES(
>"${LOCAL_RESOURCE_FILE}"
>PROPERTIES HEADER_FILE_ONLY TRUE)
>
> INCLUDE_DIRECTORIES("${PROJECT_BINARY_DIR}")
>
> ADD_EXECUTABLE(
>${PROJECT_NAME}
>"${PROJECT_SOURCE_DIR}/src/main.cpp"
>"${LOCAL_RESOURCE_FILE}")
>
> ---
> Aaron Wright
>
> ___
> 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.cma

Re: [CMake] VS2010 tries to compile a file with *.res extension when its copied

2011-01-21 Thread Aaron_Wright
Well, you're probably going to think this is stupid, but the *.res file is 
not actually a resource file in the Microsoft sense of it. It's just a 
text file that happens to have the *.res extension. It's a string 
localization text file that our logging library knows how to read. It 
think it is just happen stance that the logging library expects the files 
to end in *.res.

---
Aaron Wright




From:
David Cole 
To:
aaron_wri...@selinc.com
Cc:
"cmake@cmake.org" 
Date:
01/21/2011 08:10 AM
Subject:
Re: [CMake] VS2010 tries to compile a file with *.res extension when its 
copied



This is similar in nature to 
http://public.kitware.com/Bug/view.php?id=11147 and friends...

The fix for that issue is ending up being "obj" file specific, though, 
because we have a special handler in place for files with "obj" 
extensions. Perhaps we need similar handling for "res" files. (They are 
really just obj files from the rc compiler...)

Do you not have the rc file? Or are you compiling it as a custom command 
to avoid some other issue with rc files?

This sounds like we need to add a test similar to our existing ExternalOBJ 
test, but with a pre-built res file.


Thanks for the discussion -- seems like something needs to be fixed here. 
Let's track it down.

David


On Fri, Jan 21, 2011 at 10:57 AM,  wrote:
This is with both 2.8.3 and 2.8.4-rc1.

On a side note, VS2010 is not trying to compile the *.res file as part of
the executable, because it is marked HEADER_FILE_ONLY, and in addition I
can remove it entirely from the project. Instead, even when the *.res file
appears no where in the solution explorer in VS2010 (except as a
*.res.rule file), VS2010 is still trying to compile it. If I remove the
*.res.rule file it stops trying to compile it. So basically its just
something to do with the ADD_CUSTOM_COMMAND that copies the file.

---
Aaron Wright




From:
David Cole 
To:
"aaron_wri...@selinc.com" 
Cc:
"cmake@cmake.org" 
Date:
01/20/2011 07:57 PM
Subject:
Re: [CMake] VS2010 tries to compile a file with *.res extension when its
copied
Sent by:
cmake-boun...@cmake.org



Is tha with 2.8.3 or 2.8.4-rc1?

On Thursday, January 20, 2011,   wrote:
> I know I've asked this before, but now I've narrowed it down a bit and I
> have an example. This copies a *.res file to the binary directory where
> presumably the executable can find it. The executable has that file as a
> source file to hook up the dependency, and the copied file has the
> HEADER_FILE_ONLY property set. Yet, somehow VS2010 is still trying to
> compile en.res. I even tried setting the source and destination en.res
> files to HEADER_FILE_ONLY, but that didn't fix it. Removing the
> ADD_CUSTOM_COMMAND that does the copy fixes the problem. Why is this
> broken? FYI, it worked fine in VS2008.
>
> CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
>
> PROJECT(cmake_res_bug)
>
> SET(RESOURCE_FILE "${PROJECT_SOURCE_DIR}/resources/en.res")
>
> GET_FILENAME_COMPONENT(RESOURCE_FILE_BASENAME "${RESOURCE_FILE}" NAME)
> SET(LOCAL_RESOURCE_FILE
> "${PROJECT_BINARY_DIR}/resources/${RESOURCE_FILE_BASENAME}")
>
> ADD_CUSTOM_COMMAND(
>OUTPUT "${PROJECT_BINARY_DIR}/resources/${RESOURCE_FILE_BASENAME}"
>COMMAND ${CMAKE_COMMAND} -E make_directory
> "${PROJECT_BINARY_DIR}/resources"
>COMMAND ${CMAKE_COMMAND} -E copy "${RESOURCE_FILE}"
> "${PROJECT_BINARY_DIR}/resources"
>DEPENDS "${RESOURCE_FILE}"
>COMMENT "Localizing ${RESOURCE_FILE_BASENAME}")
>
> SET_SOURCE_FILES_PROPERTIES(
>"${LOCAL_RESOURCE_FILE}"
>PROPERTIES HEADER_FILE_ONLY TRUE)
>
> INCLUDE_DIRECTORIES("${PROJECT_BINARY_DIR}")
>
> ADD_EXECUTABLE(
>${PROJECT_NAME}
>"${PROJECT_SOURCE_DIR}/src/main.cpp"
>"${LOCAL_RESOURCE_FILE}")
>
> ---
> Aaron Wright
>
> ___
> 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


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

Re: [CMake] VS2010 tries to compile a file with *.res extension when its copied

2011-01-21 Thread Aaron_Wright
This is with both 2.8.3 and 2.8.4-rc1.

On a side note, VS2010 is not trying to compile the *.res file as part of 
the executable, because it is marked HEADER_FILE_ONLY, and in addition I 
can remove it entirely from the project. Instead, even when the *.res file 
appears no where in the solution explorer in VS2010 (except as a 
*.res.rule file), VS2010 is still trying to compile it. If I remove the 
*.res.rule file it stops trying to compile it. So basically its just 
something to do with the ADD_CUSTOM_COMMAND that copies the file.

---
Aaron Wright




From:
David Cole 
To:
"aaron_wri...@selinc.com" 
Cc:
"cmake@cmake.org" 
Date:
01/20/2011 07:57 PM
Subject:
Re: [CMake] VS2010 tries to compile a file with *.res extension when its 
copied
Sent by:
cmake-boun...@cmake.org



Is tha with 2.8.3 or 2.8.4-rc1?

On Thursday, January 20, 2011,   wrote:
> I know I've asked this before, but now I've narrowed it down a bit and I
> have an example. This copies a *.res file to the binary directory where
> presumably the executable can find it. The executable has that file as a
> source file to hook up the dependency, and the copied file has the
> HEADER_FILE_ONLY property set. Yet, somehow VS2010 is still trying to
> compile en.res. I even tried setting the source and destination en.res
> files to HEADER_FILE_ONLY, but that didn't fix it. Removing the
> ADD_CUSTOM_COMMAND that does the copy fixes the problem. Why is this
> broken? FYI, it worked fine in VS2008.
>
> CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
>
> PROJECT(cmake_res_bug)
>
> SET(RESOURCE_FILE "${PROJECT_SOURCE_DIR}/resources/en.res")
>
> GET_FILENAME_COMPONENT(RESOURCE_FILE_BASENAME "${RESOURCE_FILE}" NAME)
> SET(LOCAL_RESOURCE_FILE
> "${PROJECT_BINARY_DIR}/resources/${RESOURCE_FILE_BASENAME}")
>
> ADD_CUSTOM_COMMAND(
>OUTPUT "${PROJECT_BINARY_DIR}/resources/${RESOURCE_FILE_BASENAME}"
>COMMAND ${CMAKE_COMMAND} -E make_directory
> "${PROJECT_BINARY_DIR}/resources"
>COMMAND ${CMAKE_COMMAND} -E copy "${RESOURCE_FILE}"
> "${PROJECT_BINARY_DIR}/resources"
>DEPENDS "${RESOURCE_FILE}"
>COMMENT "Localizing ${RESOURCE_FILE_BASENAME}")
>
> SET_SOURCE_FILES_PROPERTIES(
>"${LOCAL_RESOURCE_FILE}"
>PROPERTIES HEADER_FILE_ONLY TRUE)
>
> INCLUDE_DIRECTORIES("${PROJECT_BINARY_DIR}")
>
> ADD_EXECUTABLE(
>${PROJECT_NAME}
>"${PROJECT_SOURCE_DIR}/src/main.cpp"
>"${LOCAL_RESOURCE_FILE}")
>
> ---
> Aaron Wright
>
> ___
> 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


___
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] VS2010 tries to compile a file with *.res extension when its copied

2011-01-20 Thread Aaron_Wright
I know I've asked this before, but now I've narrowed it down a bit and I 
have an example. This copies a *.res file to the binary directory where 
presumably the executable can find it. The executable has that file as a 
source file to hook up the dependency, and the copied file has the 
HEADER_FILE_ONLY property set. Yet, somehow VS2010 is still trying to 
compile en.res. I even tried setting the source and destination en.res 
files to HEADER_FILE_ONLY, but that didn't fix it. Removing the 
ADD_CUSTOM_COMMAND that does the copy fixes the problem. Why is this 
broken? FYI, it worked fine in VS2008.

CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

PROJECT(cmake_res_bug)

SET(RESOURCE_FILE "${PROJECT_SOURCE_DIR}/resources/en.res")

GET_FILENAME_COMPONENT(RESOURCE_FILE_BASENAME "${RESOURCE_FILE}" NAME)
SET(LOCAL_RESOURCE_FILE 
"${PROJECT_BINARY_DIR}/resources/${RESOURCE_FILE_BASENAME}")

ADD_CUSTOM_COMMAND(
   OUTPUT "${PROJECT_BINARY_DIR}/resources/${RESOURCE_FILE_BASENAME}"
   COMMAND ${CMAKE_COMMAND} -E make_directory 
"${PROJECT_BINARY_DIR}/resources"
   COMMAND ${CMAKE_COMMAND} -E copy "${RESOURCE_FILE}" 
"${PROJECT_BINARY_DIR}/resources"
   DEPENDS "${RESOURCE_FILE}"
   COMMENT "Localizing ${RESOURCE_FILE_BASENAME}")

SET_SOURCE_FILES_PROPERTIES(
   "${LOCAL_RESOURCE_FILE}"
   PROPERTIES HEADER_FILE_ONLY TRUE)

INCLUDE_DIRECTORIES("${PROJECT_BINARY_DIR}")

ADD_EXECUTABLE(
   ${PROJECT_NAME}
   "${PROJECT_SOURCE_DIR}/src/main.cpp"
   "${LOCAL_RESOURCE_FILE}")

---
Aaron Wright

___
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] Is HEADER_FILE_ONLY not working in Visual Studio 2010?

2011-01-14 Thread Aaron_Wright
I have a project with custom resource files in it, and unfortunately they 
have the same extension as real resource files, so Visual Studio tries to 
compile them. This obviously doesn't work.

So I set the HEADER_FILE_ONLY property on these files and that fixed it.

Now we're moving to Visual Studio 2010 on Windows 7 32-bit and the problem 
is back. The files are still marked HEADER_FILE_ONLY, but that doesn't 
exclude them from the build anymore. Is there something I can do to get 
the same behavior back I was seeing in Visual Studio 2008? Is there an 
EXCLUDE_FROM_BUILD property? I noticed a bug report on excluding files 
from the build, http://www.itk.org/Bug/view.php?id=6314, but that is 
pretty old.

I'm using CMake 2.8.3

Line from the project:



How can I get it to:


   true


Or something similar with the excluded from build set to true.
---
Aaron Wright
___
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] Are header-only targets supported?

2010-11-01 Thread Aaron_Wright
I have a couple projects like that in my build. I just make a "dumby.cpp" 
file that is completely empty and give that to add_library() with the 
other headers. It seems to make everyone happy.

---
Aaron Wright




From:
"Pedro d'Aquino" 
To:
cmake@cmake.org
Date:
11/01/2010 06:02 AM
Subject:
[CMake] Are header-only targets supported?
Sent by:
cmake-boun...@cmake.org



Hi,

I'd like to add some header-only targets to my build in order to aid
in project-browsing in IDEs such as Xcode.

If I do "add_library( Common ${header_list} )" the new target shows up
and compiles fine in Xcode, but when I try to compile it using make, I
get the following errors:

-

MacBook-Pro:build_mac pfranco$ cmake ../../myproject
...
-- Configuring done
CMake Error: Cannot determine link language for target "Common".
CMake Error: CMake can not determine linker language for target:Common
...
MacBook-Pro:build_mac pfranco$ make Common
Scanning dependencies of target Common
make[3]: *** No rule to make target `common/CMakeFiles/Common.dir/build'. 
Stop.
make[2]: *** [common/CMakeFiles/Common.dir/all] Error 2
make[1]: *** [common/CMakeFiles/Common.dir/rule] Error 2
make: *** [Common] Error 2

-

I tried to work around this by adding "set_target_properties( Common
PROPERTIES LINKER_LANGUAGE CXX)", in which case CMake runs without
hiccups but make fails (still no problems in Xcode though):

-

MacBook-Pro:build_mac pfranco$ make Common
Linking CXX static library libCommon.a
ar: no archive members specified
usage:  ar -d [-TLsv] archive file ...
 ar -m [-TLsv] archive file ...
 ar -m [-abiTLsv] position archive file ...
 ar -p [-TLsv] archive [file ...]
 ar -q [-cTLsv] archive file ...
 ar -r [-cuTLsv] archive file ...
 ar -r [-abciuTLsv] position archive file ...
 ar -t [-TLsv] archive [file ...]
 ar -x [-ouTLsv] archive [file ...]
make[3]: *** [common/libCommon.a] Error 1
make[2]: *** [common/CMakeFiles/Common.dir/all] Error 2
make[1]: *** [common/CMakeFiles/Common.dir/rule] Error 2
make: *** [Common] Error 2

-

Adding a dummy source file works, but causes some ugly warnings I'd
really like to avoid (besides being a bit hackish):

-

MacBook-Pro:build_mac pfranco$ make Common
[100%] Building CXX object common/CMakeFiles/Common.dir/dummy.cpp.o
Linking CXX static library libCommon.a
/usr/bin/ranlib: for architecture: i386 file: libCommon.a(dummy.cpp.o)
has no symbols
/usr/bin/ranlib: for architecture: x86_64 file:
libCommon.a(dummy.cpp.o) has no symbols
/usr/bin/ranlib: warning for library: libCommon.a for architecture:
i386 the table of contents is empty (no object file members in the
library define global symbols)
/usr/bin/ranlib: warning for library: libCommon.a for architecture:
x86_64 the table of contents is empty (no object file members in the
library define global symbols)
[100%] Built target Common

-

I've looked up a 3 year old e-mail thread
(http://www.cmake.org/pipermail/cmake/2007-May/014238.html) from which
I gather this isn't really a supported scenario.

Has anything changed since then? What is the best way of doing this?

Thanks,

Pedro d'Aquino
___
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] Beginner's Question: Organizing Projects

2010-10-28 Thread Aaron_Wright
I've seen this a few times in the past, and I've seen a few people try to 
get it to work. My advise is to not try. The problem comes from thinking 
that a template class is a class, but that is not true. Your template 
class is just a recipe for the compiler to use when it wants to make a 
class for you on the fly at compile time. The compiler needs the entire 
recipe to do this. Thus, splitting up the recipe (template) between a 
header and a cpp file confuses the compiler.

Do yourself a favor and just put template classes in headers.

---
Aaron Wright




From:
John Drescher 
To:
Dominik Gabi 
Cc:
cmake@cmake.org
Date:
10/28/2010 05:31 AM
Subject:
Re: [CMake] Beginner's Question: Organizing Projects
Sent by:
cmake-boun...@cmake.org



On Thu, Oct 28, 2010 at 8:29 AM, John Drescher  
wrote:
> On Thu, Oct 28, 2010 at 8:23 AM, Dominik Gabi  
wrote:
>> On Wed, 2010-10-27 at 10:54 -0500, Ryan Pavlik wrote:
>>> On Wed, Oct 27, 2010 at 9:04 AM, Rolf Eike Beer  
wrote:
>>> >> Thanks. The way I understand this is that now instead of
>>> >>
>>> >> include_directories(${GTKMM_INCLUDE_DIRS})
>>> >>
>>> >> i would write something like
>>> >>
>>> >> include_directories(${GTKMM_INCLUDE_DIRS})
>>> >> # and at the end of the file
>>> >> set(INCLUDE_DIRECTORIES ${INCLUDE_DIRECTORIES} PARENT_SCOPE)
>>> >>
>>> >> ? I'd do the same with the LINK_DIRECTORIES, LINK_LIBRARIES 
property and
>>> >> for all other libraries?
>>> >
>>> > Don't set LINK_DIRECTORIES and LINK_LIBRARIES. When you are a 
beginner
>>> > probably every usage of them is wrong.
>>> >
>>> > You simply do
>>> >
>>> > TARGET_LINK_LIBRARIES(mytarget ${GTK_LIBRARIES}) (or however that is 
called)
>>> >
>>> > The only thing you need to "export upwards" in this case would be 
the
>>> > GTK_LIBRARIES variable.
>>> >
>>> > Eike
>>>
>>> This is good advice, however, in most cases, since you're using
>>> pkgconfig directly (which is not the recommended way), that will cause
>>> more failure.  Best thing to do is to create/find a cmake module for
>>> each of those packages, that might use pkgconfig for help finding the
>>> library, but that doesn't just use what it returns verbatim.
>>>
>>> Ryan
>>>
>>
>> As it turns out, my problems are probably not cmake related. Thanks for
>> the help anyway.
>>
>> Maybe it's my limited understanding of C++. So here's the problem. The
>> project structure is as before. I've got a ui directory that uses
>> classes from the geometry directory. I've set up a simple test class in
>> the geometry directory that I use in some file in ui.
>>
>> // Test.h
>> class Test
>> {
>>public:
>>static void test();
>> };
>>
>> // Test.cpp
>> #include "Test.h"
>> #include 
>> void Test::test()
>> {
>>std::cout << "Hello World!" << std::endl;
>> }
>>
>> With these two files it works perfectly fine. Everything compiles, 
links
>> and runs without problems. Unfortunately, as soon as I add templates 
the
>> situation is different:
>>
>> // Test.h
>> template
>> class Test
>> {
>> public:
>> static void test();
>> };
>>
>> // Test.cpp
>> #include "Test.h"
>> #include 
>> template
>> void Test::test()
>> {
>> std::cout << "Hello World!" << std::endl;
>> }
>>
>> results in the following error (I've left out the name spaces above for
>> clarity):
>>
>> domi...@dmac:Pixels$ make
>> Scanning dependencies of target Ui
>> [ 33%] Building CXX object ui/CMakeFiles/Ui.dir/MainWindow.cpp.o
>> Linking CXX static library libUi.a
>> [ 33%] Built target Ui
>> [ 66%] Built target Geometry
>> Linking CXX executable Pixels
>> ui/libUi.a(MainWindow.cpp.o): In function
>> `UI::MainWindow::start_application(int, char**)':
>> MainWindow.cpp:(.text+0x9e1): undefined reference to
>> `GE::Test::test()'
>> collect2: ld returned 1 exit status
>> make[2]: *** [Pixels] Error 1
>> make[1]: *** [CMakeFiles/Pixels.dir/all] Error 2
>> make: *** [all] Error 2
>>
>> I don't get it, can anyone explain this to me?
>>
>
> Start reading here:
>
> 
http://stackoverflow.com/questions/115703/storing-c-template-function-definitions-in-a-cpp-file

>
> John
>

Here is a second link:
http://www.parashift.com/c++-faq-lite/templates.html#faq-35.12


-- 
John M. Drescher
___
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] Creating Debian source packages with CMake

2010-10-20 Thread Aaron_Wright
> The standard debian way is to have an executable file named 
`debian/rules` which creates packages when invoked.

Interesting. Now that I think about it, I guess that's correct. I was 
confused by my mostly empty 'debian/rules' file into thinking that it was 
an additional layer above that did the packaging. But, instead I have a 
lot of help from cdbs in the 'debian/rules' file. So it must be creating 
the debian packages with help from debhelpers. Something that CPack could 
also do.

What would a 'debian/rules' file that used CPack look like?

---
Aaron Wright




From:
Daniel Pfeifer 
To:
cmake@cmake.org
Date:
10/20/2010 09:31 AM
Subject:
Re: [CMake] Creating Debian source packages with CMake
Sent by:
cmake-boun...@cmake.org



Hi,

> Does it make sense to use CPack for debian packaging?

If you just want to build debian packages, then it probably does not
make sense to use CPack. If however you want to build packages for a
range of platforms and you want to keep them consistent, then CPack
would be an excellent choice.

> Anyone getting the source for a debian package knows that running 
> "dpkg-buildpackage" will create packages. They may not have a clue what 
> CPack is. This goes for utilities such as "apt-get" which can build 
> packages from source if they follow the standard debian way of doing it.

This is not the full truth. The standard debian way is to have an
executable file named `debian/rules` which creates packages when
invoked. What tools are used to create these packages is always
different. Mostly it is combination of some of the following: debhelper,
dpkg, autotools, CMake, handwritten files... and maybe CPack in the
future.

I agree that users should not need to have a clue what CPack is. All
they should care about is `aptitude install your-program`.
However, Programmers should not need to have a clue about packaging
either! All the should care about is `make package`.

cheers, Daniel


___
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] Creating Debian source packages with CMake

2010-10-20 Thread Aaron_Wright
Does it make sense to use CPack for debian packaging? When I first started 
my current project I explored creating debian packages with CPack. I 
decided not to because it is counter to what any typical debian user will 
expect. Anyone getting the source for a debian package knows that running 
"dpkg-buildpackage" will create packages. They may not have a clue what 
CPack is. This goes for utilities such as "apt-get" which can build 
packages from source if they follow the standard debian way of doing it.

---
Aaron Wright




From:
Daniel Pfeifer 
To:
cmake@cmake.org
Date:
10/20/2010 04:08 AM
Subject:
[CMake] Creating Debian source packages with CMake
Sent by:
cmake-boun...@cmake.org



Hi,

CPack, the packaging system that ships with CMake, builds
component-based installers for Mac OS X and Windows only. On Linux, the
packages generated by CPack are single, monolithic units.
I hacked a CMake script that creates a single deb-src package, uploads
it to the Launchpad build service where it generates one deb package for
each component. 

Read more at: http://purplekarrot.net/blog/dputCMake.html
Use the script at your own risk, and please provide feedback.

cheers, Daniel

___
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] Generated file not found during generation

2010-07-23 Thread Aaron_Wright
(This is a repeat email, but my last one may have been in reply to another 
message, which it should not have been. So I'm trying again, sorry.)

I have a program that uses the Window's Event Log. Using the event log is 
a little goofy; it requires a message resource file. So I set up a custom 
command to call mc.exe can create a header and resource file from a 
message script (*.mc file). This configures ok, but fails during 
generation. It says it can't find the *.rc file. I checked via 
GET_SOURCE_FILE_PROPERTY that the *.rc file is marked as generated. 

Is this familiar to anyone? I was wondering if Windows was playing a trick 
on me or something, and is there a way to work around it? I currently have 
to go and create the *.rc file by hand, and re-run CMake. This man-made 
*.rc file is then overwritten during building like normal.

ADD_CUSTOM_COMMAND( 
   OUTPUT 
  "${PROJECT_BINARY_DIR}/event_log_messages.h" 
  "${PROJECT_BINARY_DIR}/event_log_messages.rc" 
   COMMAND mc -c 
  -U "${PROJECT_SOURCE_DIR}/event_log_messages.mc" 
  -r "${PROJECT_BINARY_DIR}" 
  -h "${PROJECT_BINARY_DIR}" 
   DEPENDS "${PROJECT_SOURCE_DIR}/event_log_messages.mc" 
   COMMENT "Generating \"event_log_messages.h\" & 
\"event_log_messages.rc\"") 
 
SET( 
   SOURCES 
   "${PROJECT_SOURCE_DIR}/main.cpp" 
   "${PROJECT_SOURCE_DIR}/event_log_messages.mc" 
   "${PROJECT_BINARY_DIR}/event_log_messages.rc") 
 
SET( 
   HEADERS 
   "${PROJECT_BINARY_DIR}/event_log_messages.h") 

ADD_EXECUTABLE( 
   event_log_test 
   SOURCES ${SOURCES} 
   HEADERS ${HEADERS}) 

---
Aaron Wright
___
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] INSTALL(TARGET ...) Target not in this folder

2010-07-16 Thread Aaron_Wright
My bad. I forget the address for the mailing list all the time, and didn't 
know that would happen.

That solution would certainly work, and might be what I have to use in the 
future. I was wondering why the INSTALL(TARGET command cares what 
directory the target was in? Can't it just do what is right?

-
Aaron Wright




From:
Rolf Eike Beer 
To:
cmake@cmake.org
Date:
07/16/2010 10:10 AM
Subject:
Re: [CMake] INSTALL(TARGET ...) Target not in this folder
Sent by:
cmake-boun...@cmake.org



Am Friday 16 July 2010 schrieb aaron_wri...@selinc.com:

Please do not reply to a random message to start a new discussion. This 
makes 
thread sorting appear completely random.

> I have sort of an interesting directory structure for my projects. I 
have
> a folder for libraries, a folder for executables, and a folder for
> packages. The packages folder contains debian packages that combine
> libraries and executables from the other two folders. So they look sort 
of
> like:
> 
> IF(NOT TARGET executable_a)
> ADD_SUBDIRECTORY(
> "${PROJECT_SOURCE_DIR}/../../executables/executable_a"
> "${CMAKE_BINARY_DIR}/executable_a")
> ENDIF()
> 
> INSTALL(
> TARGET executable_a
> DESTINATION bin)

[...]

> On a side note, I don't put the INSTALL(TARGET command in executable_a's
> folder because not everyone that ADD_SUBDIRECTORY on that folder wants
> executable_a to be installed. In fact this is the problem I was trying 
to
> solve by moving the INSTALL command up a level.

Why not making that install decision depend on a variable then?

IF (DO_INSTALL_EXE_A)
   INSTALL(TARGETS ...)
ENDIF ()

Putting this in the executables directory and setting all the DO_INSTALL_* 

things right in the deb directory should do the trick.

Eike
[attachment "signature.asc" deleted by Aaron Wright/SEL] 
___
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] INSTALL(TARGET ...) Target not in this folder

2010-07-16 Thread Aaron_Wright
I have sort of an interesting directory structure for my projects. I have 
a folder for libraries, a folder for executables, and a folder for 
packages. The packages folder contains debian packages that combine 
libraries and executables from the other two folders. So they look sort of 
like:

IF(NOT TARGET executable_a)
ADD_SUBDIRECTORY(
"${PROJECT_SOURCE_DIR}/../../executables/executable_a"
"${CMAKE_BINARY_DIR}/executable_a")
ENDIF()

INSTALL(
TARGET executable_a
DESTINATION bin)

This then gets packaged up into a *.deb with the executable in it. Well, 
that's what I would like it to do. Unfortunately, INSTALL(TARGET is giving 
me an error about "executable_a" not being the current directory or 
something close to that. I can get around this by using:

INSTALL(
PROGRAM "${CMAKE_BINARY_DIR}/executable_a/executable_a"
DESTINATION bin)

But this seems more brittle than the INSTALL(TARGET usage. What is the 
reasoning behind this error message? I don't understand why it shouldn't 
just work.

On a side note, I don't put the INSTALL(TARGET command in executable_a's 
folder because not everyone that ADD_SUBDIRECTORY on that folder wants 
executable_a to be installed. In fact this is the problem I was trying to 
solve by moving the INSTALL command up a level.

-
Aaron Wright
___
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] Generated file not found during cmake generation

2010-05-06 Thread Aaron_Wright
I have a program that uses the Window's Event Log. Using the event log is 
a little goofy; it requires a message resource file. So I set up a custom 
command to call mc.exe can create a header and resource file from a 
message script (*.mc file). This generally works fine, but sometimes it 
says it can't find the *.rc file. This happens sporadically. I checked via 
GET_SOURCE_FILE_PROPERTY that the *.rc file is marked as generated. Is 
this familiar to anyone? I was wondering if Windows was playing a trick on 
me or something.

ADD_CUSTOM_COMMAND(
   OUTPUT 
  "${PROJECT_BINARY_DIR}/event_log_messages.h"
  "${PROJECT_BINARY_DIR}/event_log_messages.rc"
   COMMAND mc -c
  -U "${PROJECT_SOURCE_DIR}/event_log_messages.mc" 
  -r "${PROJECT_BINARY_DIR}"
  -h "${PROJECT_BINARY_DIR}"
   DEPENDS "${PROJECT_SOURCE_DIR}/event_log_messages.mc"
   COMMENT "Generating \"event_log_messages.h\" & 
\"event_log_messages.rc\"")
 
SET(
   SOURCES 
   "${PROJECT_SOURCE_DIR}/main.cpp"
   "${PROJECT_SOURCE_DIR}/event_log_messages.mc"
   "${PROJECT_BINARY_DIR}/event_log_messages.rc")
 
SET(
   HEADERS 
   "${PROJECT_BINARY_DIR}/event_log_messages.h")

ADD_EXECUTABLE(
   event_log_test
   SOURCES ${SOURCES}
   HEADERS ${HEADERS})

-
Aaron Wright___
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] Why is this custom command run twice?

2010-04-26 Thread Aaron_Wright
Thanks for checking on this Brad.

-
Aaron Wright




From:
Brad King 
To:
aaron_wri...@selinc.com
Cc:
cmake@cmake.org, Michael Wild 
Date:
04/23/2010 11:59 AM
Subject:
Re: [CMake] Why is this custom command run twice?
Sent by:
cmake-boun...@cmake.org



aaron_wri...@selinc.com wrote:
> This builds ok the first time, but then change the "generated.txt.in"
> and run the build twice and the second time you'll see "Using
> generated.txt" again, which I don't want to see. I've tried VS 2008 and
> NMake, using CMake 2.8 and 2.8.1.

I was able to reproduce this.  There is nothing wrong with the project
that CMake generates in VS.  The problem seems to be with the windows
filesystem timestamp granularity.  The code below changes the touch
into a copy, and the problem goes away.

The code can actually be simpler, too.  CMake 2.8 (and 2.6 I think)
automatically handles relative output files with respect to the
build tree.

-Brad


CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(quick_test)

ADD_CUSTOM_COMMAND(
  OUTPUT generated.txt
  COMMAND ${CMAKE_COMMAND} -E copy
   ${PROJECT_SOURCE_DIR}/generated.txt.in
   ${PROJECT_BINARY_DIR}/generated.txt
  DEPENDS generated.txt.in
  )

ADD_CUSTOM_COMMAND(
  OUTPUT generated_used.stamp
  COMMAND ${CMAKE_COMMAND} -E copy
   ${PROJECT_BINARY_DIR}/generated.txt
   ${PROJECT_BINARY_DIR}/generated_used.stamp
  DEPENDS generated.txt
  COMMENT "Using generated.txt"
  )

ADD_CUSTOM_TARGET(${PROJECT_NAME} DEPENDS generated_used.stamp)
___
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] Why is this custom command run twice?

2010-04-23 Thread Aaron_Wright
Is there no interest in this differing behavior between Linux and Windows? 
I'm a little worried that CMake doesn't produce the same results in both 
situations. Aren't those kind of things bugs?

If no one knows the answer off the top of their head, are there some 
debugging tips or avenues of investigation anyone could share?

-
Aaron Wright




From:
aaron_wri...@selinc.com
To:
Michael Wild 
Cc:
CMake List 
Date:
04/22/2010 01:38 PM
Subject:
Re: [CMake] Why is this custom command run twice?
Sent by:
cmake-boun...@cmake.org



Well, Michael is right, it does work right in Linux. I guess the nature of 
the question changes slightly then to become, what I'm I not doing right 
for Visual Studio 9 2008, but that works in Linux? 

-
Aaron Wright 



From: 
Michael Wild  
To: 
aaron_wri...@selinc.com 
Cc: 
CMake List  
Date: 
04/22/2010 01:29 PM 
Subject: 
Re: [CMake] Why is this custom command run twice?




Works fine for me, sorry to say ;-)

Michael

On 22. Apr, 2010, at 17:49 , aaron_wri...@selinc.com wrote:

> Interesting. I had a little typo in the first example, here's another 
one. 
> You only need a file called "generated.txt.in" next to the 
CMakeLists.txt 
> file.
> 
> 
> CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
> 
> PROJECT(quick_test)
> 
> ADD_CUSTOM_COMMAND(
>  OUTPUT "${PROJECT_BINARY_DIR}/generated.txt"
>  COMMAND ${CMAKE_COMMAND} -E copy 
> "${PROJECT_SOURCE_DIR}/generated.txt.in" 
> "${PROJECT_BINARY_DIR}/generated.txt"
>  DEPENDS "${PROJECT_SOURCE_DIR}/generated.txt.in")
> 
> ADD_CUSTOM_COMMAND(
>  OUTPUT "${PROJECT_BINARY_DIR}/generated_used.stamp"
>  COMMAND ${CMAKE_COMMAND} -E touch 
> "${PROJECT_BINARY_DIR}/generated_used.stamp"
>  DEPENDS "${PROJECT_BINARY_DIR}/generated.txt"
>  COMMENT "Using generated.txt")
> 
> ADD_CUSTOM_TARGET(
>  ${PROJECT_NAME}
>  DEPENDS "${PROJECT_BINARY_DIR}/generated_used.stamp")
> 
> 
> This builds ok the first time, but then change the "generated.txt.in" 
and 
> run the build twice and the second time you'll see "Using generated.txt" 

> again, which I don't want to see. I've tried VS 2008 and NMake, using 
> CMake 2.8 and 2.8.1.
> -
> Aaron Wright
> 
> 
> 
> 
> From:
> Michael Wild 
> To:
> aaron_wri...@selinc.com
> Cc:
> cmake@cmake.org
> Date:
> 04/21/2010 11:41 PM
> Subject:
> Re: [CMake] Why is this custom command run twice?
> Sent by:
> cmake-boun...@cmake.org
> 
> 
> 
> 
> On 22. Apr, 2010, at 5:12 , aaron_wri...@selinc.com wrote:
> 
>> I'm trying to do something a little weird, and I'm almost there but not 

>> quite. I'm trying to generate a file and then run a command based on 
> that 
>> file. I only want the command to run when the file changes and thus the 

>> generated file changes. Instead the first build I get both custom 
> commands 
>> run, and then on a second build, the second custom command runs again, 
>> which is not what I want. 
>> 
>> This is what I got (just an example):
>> 
>> 
>> ADD_CUSTOM_COMMAND(
>> OUTPUT "${PROJECT_BINARY_DIR}/generated.txt"
>> COMMAND ${CMAKE_COMMAND} -E touch 
> "${PROJECT_BINARY_DIR}/generated.txt"
>> DEPENDS "${PROJECT_SOURCE_DIR}/generated.txt")
>> 
>> ADD_CUSTOM_COMMAND(
>> OUTPUT "${PROJECT_BINARY_DIR}/generated_used.stamp"
>> COMMAND ${CMAKE_COMMAND} -E touch 
>> "${PROJECT_BINARY_DIR}/generated_used.stamp"
>> DEPENDS "${PROJECT_BINARY_DIR}/generated.txt"
>> COMMENT "Using generated.txt")
>> 
>> ADD_CUSTOM_TARGET(
>> ${PROJECT_NAME}
>> DEPENDS "${PROJECT_BINARY_DIR}/generated_used.stamp")
>> 
>> 
>> What I'm I missing? Thanks
> 
> Your example works fine for me (using CMake 2.8.1 and Unix Makefiles 
> generator on Mac OS X 10.6.2).
> 
> Michael
> 
> ___
> 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
___
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] Why is this custom command run twice?

2010-04-22 Thread Aaron_Wright
Well, Michael is right, it does work right in Linux. I guess the nature of 
the question changes slightly then to become, what I'm I not doing right 
for Visual Studio 9 2008, but that works in Linux?

-
Aaron Wright




From:
Michael Wild 
To:
aaron_wri...@selinc.com
Cc:
CMake List 
Date:
04/22/2010 01:29 PM
Subject:
Re: [CMake] Why is this custom command run twice?



Works fine for me, sorry to say ;-)

Michael

On 22. Apr, 2010, at 17:49 , aaron_wri...@selinc.com wrote:

> Interesting. I had a little typo in the first example, here's another 
one. 
> You only need a file called "generated.txt.in" next to the 
CMakeLists.txt 
> file.
> 
> 
> CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
> 
> PROJECT(quick_test)
> 
> ADD_CUSTOM_COMMAND(
>  OUTPUT "${PROJECT_BINARY_DIR}/generated.txt"
>  COMMAND ${CMAKE_COMMAND} -E copy 
> "${PROJECT_SOURCE_DIR}/generated.txt.in" 
> "${PROJECT_BINARY_DIR}/generated.txt"
>  DEPENDS "${PROJECT_SOURCE_DIR}/generated.txt.in")
> 
> ADD_CUSTOM_COMMAND(
>  OUTPUT "${PROJECT_BINARY_DIR}/generated_used.stamp"
>  COMMAND ${CMAKE_COMMAND} -E touch 
> "${PROJECT_BINARY_DIR}/generated_used.stamp"
>  DEPENDS "${PROJECT_BINARY_DIR}/generated.txt"
>  COMMENT "Using generated.txt")
> 
> ADD_CUSTOM_TARGET(
>  ${PROJECT_NAME}
>  DEPENDS "${PROJECT_BINARY_DIR}/generated_used.stamp")
> 
> 
> This builds ok the first time, but then change the "generated.txt.in" 
and 
> run the build twice and the second time you'll see "Using generated.txt" 

> again, which I don't want to see. I've tried VS 2008 and NMake, using 
> CMake 2.8 and 2.8.1.
> -
> Aaron Wright
> 
> 
> 
> 
> From:
> Michael Wild 
> To:
> aaron_wri...@selinc.com
> Cc:
> cmake@cmake.org
> Date:
> 04/21/2010 11:41 PM
> Subject:
> Re: [CMake] Why is this custom command run twice?
> Sent by:
> cmake-boun...@cmake.org
> 
> 
> 
> 
> On 22. Apr, 2010, at 5:12 , aaron_wri...@selinc.com wrote:
> 
>> I'm trying to do something a little weird, and I'm almost there but not 

>> quite. I'm trying to generate a file and then run a command based on 
> that 
>> file. I only want the command to run when the file changes and thus the 

>> generated file changes. Instead the first build I get both custom 
> commands 
>> run, and then on a second build, the second custom command runs again, 
>> which is not what I want. 
>> 
>> This is what I got (just an example):
>> 
>> 
>> ADD_CUSTOM_COMMAND(
>> OUTPUT "${PROJECT_BINARY_DIR}/generated.txt"
>> COMMAND ${CMAKE_COMMAND} -E touch 
> "${PROJECT_BINARY_DIR}/generated.txt"
>> DEPENDS "${PROJECT_SOURCE_DIR}/generated.txt")
>> 
>> ADD_CUSTOM_COMMAND(
>> OUTPUT "${PROJECT_BINARY_DIR}/generated_used.stamp"
>> COMMAND ${CMAKE_COMMAND} -E touch 
>> "${PROJECT_BINARY_DIR}/generated_used.stamp"
>> DEPENDS "${PROJECT_BINARY_DIR}/generated.txt"
>> COMMENT "Using generated.txt")
>> 
>> ADD_CUSTOM_TARGET(
>> ${PROJECT_NAME}
>> DEPENDS "${PROJECT_BINARY_DIR}/generated_used.stamp")
>> 
>> 
>> What I'm I missing? Thanks
> 
> Your example works fine for me (using CMake 2.8.1 and Unix Makefiles 
> generator on Mac OS X 10.6.2).
> 
> Michael
> 
> ___
> 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] Why is this custom command run twice?

2010-04-22 Thread Aaron_Wright
Interesting. I had a little typo in the first example, here's another one. 
You only need a file called "generated.txt.in" next to the CMakeLists.txt 
file.


CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

PROJECT(quick_test)

ADD_CUSTOM_COMMAND(
   OUTPUT "${PROJECT_BINARY_DIR}/generated.txt"
   COMMAND ${CMAKE_COMMAND} -E copy 
  "${PROJECT_SOURCE_DIR}/generated.txt.in" 
  "${PROJECT_BINARY_DIR}/generated.txt"
   DEPENDS "${PROJECT_SOURCE_DIR}/generated.txt.in")
 
 ADD_CUSTOM_COMMAND(
   OUTPUT "${PROJECT_BINARY_DIR}/generated_used.stamp"
   COMMAND ${CMAKE_COMMAND} -E touch 
"${PROJECT_BINARY_DIR}/generated_used.stamp"
   DEPENDS "${PROJECT_BINARY_DIR}/generated.txt"
   COMMENT "Using generated.txt")
 
 ADD_CUSTOM_TARGET(
   ${PROJECT_NAME}
   DEPENDS "${PROJECT_BINARY_DIR}/generated_used.stamp")


This builds ok the first time, but then change the "generated.txt.in" and 
run the build twice and the second time you'll see "Using generated.txt" 
again, which I don't want to see. I've tried VS 2008 and NMake, using 
CMake 2.8 and 2.8.1.
-
Aaron Wright




From:
Michael Wild 
To:
aaron_wri...@selinc.com
Cc:
cmake@cmake.org
Date:
04/21/2010 11:41 PM
Subject:
Re: [CMake] Why is this custom command run twice?
Sent by:
cmake-boun...@cmake.org




On 22. Apr, 2010, at 5:12 , aaron_wri...@selinc.com wrote:

> I'm trying to do something a little weird, and I'm almost there but not 
> quite. I'm trying to generate a file and then run a command based on 
that 
> file. I only want the command to run when the file changes and thus the 
> generated file changes. Instead the first build I get both custom 
commands 
> run, and then on a second build, the second custom command runs again, 
> which is not what I want. 
> 
> This is what I got (just an example):
> 
> 
> ADD_CUSTOM_COMMAND(
>   OUTPUT "${PROJECT_BINARY_DIR}/generated.txt"
>   COMMAND ${CMAKE_COMMAND} -E touch 
"${PROJECT_BINARY_DIR}/generated.txt"
>   DEPENDS "${PROJECT_SOURCE_DIR}/generated.txt")
> 
> ADD_CUSTOM_COMMAND(
>   OUTPUT "${PROJECT_BINARY_DIR}/generated_used.stamp"
>   COMMAND ${CMAKE_COMMAND} -E touch 
> "${PROJECT_BINARY_DIR}/generated_used.stamp"
>   DEPENDS "${PROJECT_BINARY_DIR}/generated.txt"
>   COMMENT "Using generated.txt")
> 
> ADD_CUSTOM_TARGET(
>   ${PROJECT_NAME}
>   DEPENDS "${PROJECT_BINARY_DIR}/generated_used.stamp")
> 
> 
> What I'm I missing? Thanks

Your example works fine for me (using CMake 2.8.1 and Unix Makefiles 
generator on Mac OS X 10.6.2).

Michael

___
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] Why is this custom command run twice?

2010-04-21 Thread Aaron_Wright
I'm trying to do something a little weird, and I'm almost there but not 
quite. I'm trying to generate a file and then run a command based on that 
file. I only want the command to run when the file changes and thus the 
generated file changes. Instead the first build I get both custom commands 
run, and then on a second build, the second custom command runs again, 
which is not what I want. 

This is what I got (just an example):


ADD_CUSTOM_COMMAND(
   OUTPUT "${PROJECT_BINARY_DIR}/generated.txt"
   COMMAND ${CMAKE_COMMAND} -E touch "${PROJECT_BINARY_DIR}/generated.txt"
   DEPENDS "${PROJECT_SOURCE_DIR}/generated.txt")
 
ADD_CUSTOM_COMMAND(
   OUTPUT "${PROJECT_BINARY_DIR}/generated_used.stamp"
   COMMAND ${CMAKE_COMMAND} -E touch 
"${PROJECT_BINARY_DIR}/generated_used.stamp"
   DEPENDS "${PROJECT_BINARY_DIR}/generated.txt"
   COMMENT "Using generated.txt")

ADD_CUSTOM_TARGET(
   ${PROJECT_NAME}
   DEPENDS "${PROJECT_BINARY_DIR}/generated_used.stamp")


What I'm I missing? Thanks
-
Aaron Wright
___
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] CMake and CPack question.

2010-04-12 Thread Aaron_Wright
Are you missing some INSTALL commands?

-
Aaron Wright
Software Engineer - DCS Group
Schweitzer Engineering Laboratories, Inc.
Pullman, WA 99163
509-334-8087




From:
Roger 
To:
cmake@cmake.org
Date:
04/12/2010 08:50 AM
Subject:
[CMake] CMake and CPack question.
Sent by:
cmake-boun...@cmake.org



Hello,

I have been using CMake (2.6) for a couple weeks now (I really like
it) and so far I have been able to do all I needed by just following
the documentation.
After getting my software built and confirmed that it works in my
development machine I would like to pack it so I can install it in my
production machine
using RPM.  I have gotten as far as generating RPM, SH, TGZ etc
packages to build but they seem to be useless (to say the least). I'm
pretty sure that I'm missing something so
I was wondering if someone with experience generating installation
packages could point me in the right direction. This is a very simple
project and there is only one file
to install, a binary file. I know that using CMake for this may be
overkill but I figured that I do this one then it would be easier to
tackle bigger ones.
Here is my current CMake files.

 CMakeLists.cmake 
# Minumum CMake version.
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)

# Set CMake modules path.
SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules/")

# Project name.
PROJECT(sqlconnmonit)

# Find MYSQL.
FIND_PACKAGE(SQL REQUIRED MYSQL_INCLUDE_DIR)

# Add MYSQL headers.
INCLUDE_DIRECTORIES(${MYSQL_INCLUDE_DIR})

# Add MYSQL lib to the list of libraries to use.
SET(LIBS ${LIBS} ${MYSQL_LIB_DIR})

# Compiler flags.
# SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g")

# The source code file(s) that form the executable.
ADD_EXECUTABLE(sqlconnmonit src/sqlconnmonit.c src/options.c
src/utils.c src/mysql.c)

# Link against external libraries.
TARGET_LINK_LIBRARIES(sqlconnmonit ${LIBS})

# CPACK.
INCLUDE(InstallRequiredSystemLibraries)
SET(CPACK_INSTALL_CMAKE_PROJECTS
"${CMAKE_SOURCE_DIR}/build;${CMAKE_PROJECT_NAME};ALL;/")
SET(CPACK_GENERATOR "STGZ;TGZ;TZ;RPM;DEB")
SET(CPACK_PACKAGE_VERSION_MAJOR "0")
SET(CPACK_PACKAGE_VERSION_MINOR "1")
SET(CPACK_PACKAGE_VERSION_PATCH "0")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MySQL server connections monitor.")
SET(CPACK_PACKAGE_VENDOR "Super Cool Vendor")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "/opt/sqlmonitor/bin")

SET(CPACK_RPM_PACKAGE_SUMMARY "MySQL server connections monitor.")
SET(CPACK_RPM_PACKAGE_NAME "${CPACK_PACKAGE_NAME}")
SET(CPACK_RPM_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}")
SET(CPACK_RPM_PACKAGE_RELEASE "1")
SET(CPACK_RPM_PACKAGE_LICENSE "BSD")
SET(CPACK_RPM_PACKAGE_GROUP "unknown")
SET(CPACK_RPM_PACKAGE_VENDOR "Super Cool Vendor")
SET(CPACK_RPM_PACKAGE_DESCRIPTION "MySQL server connections monitor.")
SET(CPACK_RPM_PACKAGE_REQUIRES "cmake >= 2.6, mysql-devel >= 5.0")

SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "ME")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY 
"${CPACK_PACKAGE_DESCRIPTION_SUMMARY}")
SET(CPACK_PACKAGE_DESCRIPTION "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}")

INCLUDE(CPack)


 FindSQL.cmake 

# Locate MYSQL library
#

# Find MYSQL include.
MESSAGE("-- Looking for MySQL include directory")

FIND_PATH(MYSQL_INCLUDE_DIR
mysql.h
PATHS
/usr/include/mysql
/usr/local/include/mysql

)

IF (MYSQL_INCLUDE_DIR)
MESSAGE("-- MySQL include directory found")
MESSAGE("-- MYSQL_INCLUDE_DIR is ${MYSQL_INCLUDE_DIR}")
ELSE (MYSQL_INCLUDE_DIR)
MESSAGE(FATAL_ERROR "-- Could not find MySQL includes directory")
ENDIF (MYSQL_INCLUDE_DIR)

# Find MYSQL lib.
MESSAGE("-- Looking for MySQL lib directory")

FIND_LIBRARY(MYSQL_LIB_DIR
NAMES
mysqlclient libmysqlclient
PATHS
/usr/local/lib
/usr/local/lib64
/usr/lib
/usr/lib/mysql
/usr/lib64
/usr/lib64/mysql
)


IF (MYSQL_LIB_DIR)
MESSAGE("-- MySQL lib directory found")
MESSAGE("-- MYSQL_LIB_DIR is ${MYSQL_LIB_DIR}")
ELSE (MYSQL_LIB_DIR)
MESSAGE(FATAL_ERROR "-- Could not find MySQL lib directory")
ENDIF (MYSQL_LIB_DIR)

=

Any input would be appreciated. Any complete sample to a CMake to
generate a RPM package
would be greatly appreciated. Anything would be appreciated.

Thank you for your time,

-r
___
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 subsc

[CMake] Librarian Flags

2010-04-09 Thread Aaron_Wright
I'm working with MSVC 9.0 2008 and I want to add a flag (/LTCG) to the 
librarian command line.

I can add flags to the linker successfully with:

SET_PROPERTY(TARGET ${TARGET} PROPERTY LINK_FLAGS "${LINK_FLAGS}")

But this doesn't seem to translate to the librarian command line. I 
couldn't find a flags variable for the librarian. Am I missing it?

(The librarian is what creates my static libraries)
-
Aaron Wright
___
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] VS project reloading

2010-04-08 Thread Aaron_Wright
What version of VS are you using? I saw this behavior in VC++ 2008 
express, but when I upgraded to the full version this went away. None of 
my files are closed during a solution or project refresh.

-
Aaron Wright




From:
James Bigler 
To:
cmake@cmake.org
Date:
04/08/2010 08:47 AM
Subject:
[CMake] VS project reloading
Sent by:
cmake-boun...@cmake.org



I'm wondering if anyone had any thoughts on this issue.

When CMake detects that the project or solution files for VS have changed 
it runs some plugin that unloads the solution and loads it up again.  
While this works to keep things updated, it had the unfortunate 
consequence of loosing any of the undo history in any of the files that 
were being edited in VS.  Does anyone have a workaround for this besides 
using an external editor?  I tried to click "cancel" to let VS do the 
project reloading, but it closes any files that are associated with the 
given project that is reloaded.

I'm getting a lot of push back from developers who are finding unhelpful 
to loose their undo history.

Thanks,
James___
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] Handling library dependencies and minimizing duplicated include_directories

2010-03-22 Thread Aaron_Wright
So... no easy answer for this? The only reason I bring this up is that 
I've looked at the cmake version of boost, and it requires a library of 
several cmake files full of macros and functions that help get their 
project organization to work with cmake. I've had to resort to the same 
kind of thing. ADD_LIBRARY just didn't cut it. I like that cmake allows me 
to get to the functionality I want, but it seems that it becomes a 
scripting language at that point, and cmake is certainly not a scripting 
language. Boost for example has numerous helper functions or macros for 
using named arguments with macros and functions. (They are all very 
cleaver and I totally use them in my project.) Another example is that my 
project has functions and macros for adding the dependencies between 
libraries, dependencies like include directories, link directories, and 
link libraries. Is there something on the horizon for CMake to address 
these issues? Or have they been addressed, but I've missed them?

On a side note, I see questions for this kind of thing all the time on 
this mailing list. I never see a very good answer. Perhaps a wiki page or 
a blog could be made covering project organization. It could perhaps cut 
down on repeat questions.

-
Aaron Wright




From:
aaron_wri...@selinc.com
To:
Michael Jackson 
Cc:
cmake@cmake.org
Date:
03/22/2010 07:47 AM
Subject:
Re: [CMake] Handling library dependencies and minimizing duplicated 
include_directories
Sent by:
cmake-boun...@cmake.org



You mean in the case of a master CMakelists.txt file I assume? That does 
work, and I like that functionality. The same kind of thing works for 
Visual Studio solutions as well. I just don't think this fits the usual 
paradigm of building my developers and I are used to. 

For example, if they want to work on a library, they would instinctively 
go to that library and make a build folder and run CMake. They would not 
think to go to the top of the directory tree, create a build folder in a 
location they never make folders or files or do any work, and then 
progress down the build folder's directory path to the library they want 
to build. Which is in a completely different location than the source 
files of the library, which they'll soon be modifying. 

This would all work though, so it is a valid solution. 

-
Aaron Wright 



From: 
Michael Jackson  
To: 
aaron_wri...@selinc.com 
Cc: 
cmake@cmake.org 
Date: 
03/22/2010 07:32 AM 
Subject: 
Re: [CMake] Handling library dependencies and minimizing duplicated 
include_directories




If you are using any of the "Makefile" generators, you can simply 
drill down into the folder of the library you want to build and issue 
the "make" command. The library, and anything that it depends on will 
be built (or rebuilt) accordingly.
___
Mike Jackson  www.bluequartz.net


On Mar 22, 2010, at 9:52 AM, aaron_wri...@selinc.com wrote:

> I've always been a little confused by FIND_PACKAGE and those "*- 
> config.cmake" files. So much so that I didn't use them in my build 
> system at all. The main question I have is that I have several 
> developers and numerous little and big libraries. Because the whole 
> project is so big it would be prohibitive for them all to work from 
> a master CMakeLists.txt file at the top. I want each developer to be 
> able to go the folder of the library they want to work on today and 
> start building there. I want all the libraries that library depends 
> on to be built or rebuilt if anything has changed in addition to 
> building the current library.
>
> I've been unable to find a simple solution to this problem using 
> CMake, which makes me wonder if what I'm doing is off the wall, but 
> it sounds so normal to me. I see these "*-config.cmake" files but it 
> seems they are generated from a CMakelist.txt file, which wouldn't 
> make any sense, because I'm not going to have a developer go to each 
> dependant library and build it seperately so that the "*- 
> config.cmake" can be generated so that he can have those variables 
> back in the library he really wants to build.
>
> What am I missing?
>
> -
> Aaron Wright
>
>
>
> From:
> Daniel Lidström 
> To:
> Cc:
> 
> Date:
> 03/20/2010 01:25 PM
> Subject:
> Re: [CMake] Handling library dependencies and minimizing 
> duplicatedinclude_directories
> Sent by:
> cmake-boun...@cmake.org
>
>
>
>
> > If the projects UMC3D, GFL etc can be used independently, but
> > are all "under your control", then you shouldn't write
> > FindUMC3D.cmake, FindGFL.cmake etc files, but create
> > UMC3D-config.cmake, GFL-config.cmake etc files instead. Read
> > the documentation of the FIND_PACKAGE command, especially the
> > paragraphs about the "config mode". You'll also find many

Re: [CMake] Handling library dependencies and minimizing duplicated include_directories

2010-03-22 Thread Aaron_Wright
You mean in the case of a master CMakelists.txt file I assume? That does 
work, and I like that functionality. The same kind of thing works for 
Visual Studio solutions as well. I just don't think this fits the usual 
paradigm of building my developers and I are used to. 

For example, if they want to work on a library, they would instinctively 
go to that library and make a build folder and run CMake. They would not 
think to go to the top of the directory tree, create a build folder in a 
location they never make folders or files or do any work, and then 
progress down the build folder's directory path to the library they want 
to build. Which is in a completely different location than the source 
files of the library, which they'll soon be modifying.

This would all work though, so it is a valid solution.

-
Aaron Wright




From:
Michael Jackson 
To:
aaron_wri...@selinc.com
Cc:
cmake@cmake.org
Date:
03/22/2010 07:32 AM
Subject:
Re: [CMake] Handling library dependencies and minimizing duplicated 
include_directories



If you are using any of the "Makefile" generators, you can simply 
drill down into the folder of the library you want to build and issue 
the "make" command. The library, and anything that it depends on will 
be built (or rebuilt) accordingly.
___
Mike Jackson  www.bluequartz.net


On Mar 22, 2010, at 9:52 AM, aaron_wri...@selinc.com wrote:

> I've always been a little confused by FIND_PACKAGE and those "*- 
> config.cmake" files. So much so that I didn't use them in my build 
> system at all. The main question I have is that I have several 
> developers and numerous little and big libraries. Because the whole 
> project is so big it would be prohibitive for them all to work from 
> a master CMakeLists.txt file at the top. I want each developer to be 
> able to go the folder of the library they want to work on today and 
> start building there. I want all the libraries that library depends 
> on to be built or rebuilt if anything has changed in addition to 
> building the current library.
>
> I've been unable to find a simple solution to this problem using 
> CMake, which makes me wonder if what I'm doing is off the wall, but 
> it sounds so normal to me. I see these "*-config.cmake" files but it 
> seems they are generated from a CMakelist.txt file, which wouldn't 
> make any sense, because I'm not going to have a developer go to each 
> dependant library and build it seperately so that the "*- 
> config.cmake" can be generated so that he can have those variables 
> back in the library he really wants to build.
>
> What am I missing?
>
> -
> Aaron Wright
>
>
>
> From:
> Daniel Lidström 
> To:
> Cc:
> 
> Date:
> 03/20/2010 01:25 PM
> Subject:
> Re: [CMake] Handling library dependencies and minimizing 
> duplicatedinclude_directories
> Sent by:
> cmake-boun...@cmake.org
>
>
>
>
> > If the projects UMC3D, GFL etc can be used independently, but
> > are all "under your control", then you shouldn't write
> > FindUMC3D.cmake, FindGFL.cmake etc files, but create
> > UMC3D-config.cmake, GFL-config.cmake etc files instead. Read
> > the documentation of the FIND_PACKAGE command, especially the
> > paragraphs about the "config mode". You'll also find many
> > discussions on this in the archives of this list.
>
> Thanks a lot for your help Mike!
>
> Regards,
>
> Daniel Lidström
> Stockholm, Sweden
> ___
> 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


___
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] Handling library dependencies and minimizing duplicated include_directories

2010-03-22 Thread Aaron_Wright
I've always been a little confused by FIND_PACKAGE and those 
"*-config.cmake" files. So much so that I didn't use them in my build 
system at all. The main question I have is that I have several developers 
and numerous little and big libraries. Because the whole project is so big 
it would be prohibitive for them all to work from a master CMakeLists.txt 
file at the top. I want each developer to be able to go the folder of the 
library they want to work on today and start building there. I want all 
the libraries that library depends on to be built or rebuilt if anything 
has changed in addition to building the current library. 

I've been unable to find a simple solution to this problem using CMake, 
which makes me wonder if what I'm doing is off the wall, but it sounds so 
normal to me. I see these "*-config.cmake" files but it seems they are 
generated from a CMakelist.txt file, which wouldn't make any sense, 
because I'm not going to have a developer go to each dependant library and 
build it seperately so that the "*-config.cmake" can be generated so that 
he can have those variables back in the library he really wants to build.

What am I missing?

-
Aaron Wright




From:
Daniel Lidström 
To:

Cc:

Date:
03/20/2010 01:25 PM
Subject:
Re: [CMake] Handling library dependencies and minimizing duplicated 
include_directories
Sent by:
cmake-boun...@cmake.org



> If the projects UMC3D, GFL etc can be used independently, but 
> are all "under your control", then you shouldn't write 
> FindUMC3D.cmake, FindGFL.cmake etc files, but create 
> UMC3D-config.cmake, GFL-config.cmake etc files instead. Read 
> the documentation of the FIND_PACKAGE command, especially the 
> paragraphs about the "config mode". You'll also find many 
> discussions on this in the archives of this list.

Thanks a lot for your help Mike!

Regards,

Daniel Lidström
Stockholm, Sweden 
___
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] Project Folders in Visual Studio

2010-03-16 Thread Aaron_Wright
I tried the patch listed in that bug report but it didn't change anything. 
The files said they were for Visual Studio 7, but I'm using Visual Studio 
9 2008, so maybe that's why? I'm not sure why the files would target only 
version 7.

Is there a way to vote for features we want in the next version? Because I 
would totally vote for this.

-
Aaron Wright




From:
Surya Kiran Gullapalli 
To:
aaron_wri...@selinc.com
Cc:
cmake@cmake.org
Date:
03/15/2010 11:09 PM
Subject:
Re: [CMake] Project Folders in Visual Studio
Sent by:
cmake-boun...@cmake.org



There's a bug already reported for this.

You can find the details here

Surya___
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] Project Folders in Visual Studio

2010-03-15 Thread Aaron_Wright
I have several libraries, each with numerous test programs, and a top 
level program. Each of these has an individual project in Visual Studio. 
In addition I have a doxygen and coverage target for each library or test 
program. And if I want to make a target depend on a file, I need to create 
a custom target that depends on that file and then make the original 
target depend on this new custom target. With any decent sized program the 
number of projects in Visual Studio can grow quickly.

-
Aaron Wright




From:
Pau Garcia i Quiles 
To:
aaron_wri...@selinc.com
Cc:
cmake@cmake.org
Date:
03/15/2010 02:42 PM
Subject:
Re: [CMake] Project Folders in Visual Studio
Sent by:
cmake-boun...@cmake.org



On Mon, Mar 15, 2010 at 7:49 PM,   wrote:
> I know this has been asked before but I don't think it got an answer. I 
have
> a situation where I have over 200 projects in Visual Studio with no
> organization. Is there anyway to put them under folders? It would really
> save me some headaches. Thanks.

I'm not sure what you are looking for, actually,

If you want each project to be in a different folder, CMake creates a
different project (thus a folder) each time you use
add_library/add_executable.

If you are looking to further split the sources in a project, take a
look at source_group.

-- 
Pau Garcia i Quiles
http://www.elpauer.org
(Due to my workload, I may need 10 days to answer)
___
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] Project Folders in Visual Studio

2010-03-15 Thread Aaron_Wright
I know this has been asked before but I don't think it got an answer. I 
have a situation where I have over 200 projects in Visual Studio with no 
organization. Is there anyway to put them under folders? It would really 
save me some headaches. Thanks.

-
Aaron Wright
___
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] Best way to Generate String

2010-03-05 Thread Aaron_Wright
Is this the best way to generate a comment bar, such as this:



or this:



or this:



IF(OUTPUT_FILE_EXT MATCHES "^\\.h|\\.cpp$")
   SET(COMMENT_CHARACTER "/")
ELSEIF(OUTPUT_FILE_EXT MATCHES "^\\.sql$")
   SET(COMMENT_CHARACTER "-")
ELSEIF(OUTPUT_FILE_EXT MATCHES "^\\.nsi|\\.nsh$")
   SET(COMMENT_CHARACTER "#")
ELSE()
   MESSAGE(WARNING "Unknown file type")
ENDIF()

STRING(RANDOM LENGTH 80 ALPHABET "${COMMENT_CHARACTER}" COMMENT_BAR)

The only reason I ask is that is seems weird to use the STRING(RANDOM 
function to get this done.
-
Aaron Wright
___
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] How to add file dependencies to a target?

2010-03-04 Thread Aaron_Wright
I want to make an executable depend on output of a custom command. The 
custom command just copies a file to a place where the executable will be 
able to find it. I find that I can't get a dependency between an 
executable and, essentially, a file to work.

For example, this doesn't work:

ADD_EXECUTABLE(foo ${foo_SOURCES} ${foo_HEADERS})

ADD_CUSTOM_COMMAND(
   OUTPUT "${PROJECT_BINARY_DIR}/bar.ini"
   COMMAND ${CMAKE_COMMAND} -E copy "${PROJECT_SOURCE_DIR}/bar.ini" 
"${PROJECT_BINARY_DIR}"
   DEPENDS "${PROJECT_SOURCE_DIR}/bar.ini"
   COMMENT "Localizing \"bar.ini\"")

ADD_DEPENDENCIES(foo "${PROJECT_BINARY_DIR}/bar.ini")

I know it'll work if I was generating a source file and feeding that into 
${foo_SOURCES}, but that didn't seem like the right thing to do.
I can also get it to work if I add another target like so:

ADD_EXECUTABLE(foo ${foo_SOURCES} ${foo_HEADERS})

ADD_CUSTOM_COMMAND(
   OUTPUT "${PROJECT_BINARY_DIR}/bar.ini"
   COMMAND ${CMAKE_COMMAND} -E copy "${PROJECT_SOURCE_DIR}/bar.ini" 
"${PROJECT_BINARY_DIR}"
   DEPENDS "${PROJECT_SOURCE_DIR}/bar.ini"
   COMMENT "Localizing \"bar.ini\"")

ADD_CUSTOM_TARGET(copy_bar.ini DEPENDS "${PROJECT_BINARY_DIR}/bar.ini")

ADD_DEPENDENCIES(foo copy_bar.ini)

So do I have to have this additional indirection with the extra target? I 
have way too many targets as is. Is there anyway to get the first approach 
to work? It's like I need to add a file to ${foo_SOURCES} or 
${foo_HEADERS} that isn't compiled or that doesn't show up in the IDE. And 
can this be done after the ADD_EXECUTABLE call, or does it have to be 
before?
-
Aaron Wright
___
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] Windows Version in HEX

2010-02-19 Thread Aaron_Wright
Thanks Michael. I guess I didn't understand what it was asking.

-
Aaron Wright




From:
Michael Wild 
To:
aaron_wri...@selinc.com
Cc:
cmake@cmake.org
Date:
02/18/2010 03:03 PM
Subject:
Re: [CMake] Windows Version in HEX




On 18. Feb, 2010, at 23:34 , aaron_wri...@selinc.com wrote:

> I have a boost::asio library that wants _WIN32_WINNT or _WIN32_WINDOWS 
> defined to the hex version of windows, like 0x0501 for windows xp. I can 

> get 5.1 from CMAKE_SYSTEM_VERSION, but is there a hex version, or do I 
> have to do some converting myself?
> 
> -
> Aaron Wright


That macro should be set to the minimum Windows version your software is 
going to run on, this is not necessarily the same number as 
CMAKE_SYSTEM_VERSION. I think that's probably something you should/can 
hard-code, since it indicates the minimum version of Windows you require 
API-wise.

HTH

Michael


___
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] Windows Version in HEX

2010-02-18 Thread Aaron_Wright
I have a boost::asio library that wants _WIN32_WINNT or _WIN32_WINDOWS 
defined to the hex version of windows, like 0x0501 for windows xp. I can 
get 5.1 from CMAKE_SYSTEM_VERSION, but is there a hex version, or do I 
have to do some converting myself?

-
Aaron Wright
___
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] File permissions on CONFIGURE_FILE output

2010-02-03 Thread Aaron_Wright
I tried your way Michael and liked the simplicity of it, however, it 
seemed that CMake configuration would have to run much more often in my 
case, because the file I want to append to the configured file is a 
source/header file and it will be modified frequently during development. 
I also didn't use the FILE(COPY) command because it didn't seem to be able 
to change permissions on a file in-place, and I didn't want to figure out 
a place to copy the file from or to that was different than where it 
already was. It was just easier to use the FILE(READ), FILE(REMOVE), 
FILE(WRITE) method suggested by Chris. 

Seems like a FILE(PERMISSIONS) command would be useful.

-
Aaron Wright




From:
Michael Wild 
To:
Chris Hillery 
Cc:
cmake@cmake.org, aaron_wri...@selinc.com
Date:
02/03/2010 04:21 AM
Subject:
Re: [CMake] File permissions on CONFIGURE_FILE output
Sent by:
cmake-boun...@cmake.org



You're right, I could have sworn that file(COPY...) has been around for 
ages ;-)


Michael

On 3. Feb, 2010, at 12:05 , Chris Hillery wrote:

> Whoops - I take it back. I see that it IS there in the 2.8 online docs, 
as a
> separate file( entry as you said. Not terribly clear IMHO, 
but
> anyway. So I guess this is a new 2.8 feature (it really truly isn't 
there in
> 2.6.4).
> 
> Ceej
> aka Chris Hillery
> 
> On Wed, Feb 3, 2010 at 3:04 AM, Chris Hillery 
wrote:
> 
>> 
>> You probably didn't grep the man-page thoroughly ;-) It is documented 
as
>>> "file("
>>> 
>> 
>> I did, actually! It ain't there on the online manual:
>> 
>> http://www.cmake.org/cmake/help/cmake2.6docs.html#command:file
>> 
>> Moreover, your script doesn't work here with CMake 2.6.4. Maybe it was
>> added in CMake 2.8? I don't have that available for testing, but it's 
not in
>> the online documentation for 2.8 either:
>> 
>> http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:file
>> 
>> I'm glad it's apparently been added, but I guess it must be a very new
>> thing!
>> 
>> So, tell me - are there any other features for generically modifying 
file
>> permissions without copying the file?
>> 
>> Ceej
>> aka Chris Hillery
>> 

___
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] File permissions on CONFIGURE_FILE output

2010-02-02 Thread Aaron_Wright
I run CONFIGURE_FILE on a file that is read only. The output file is also 
read only, which is a problem because I need to append to it. Is there a 
way to change this behavior? Or a work around?

-
Aaron Wright
___
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] Coverage - Accumulating results

2010-01-21 Thread Aaron_Wright
What does it mean when my continuous build seems to process coverage just 
fine, but doesn't seem to get any results? I can use my own coverage tool 
and get results that are correct so the coverage build is working. I think 
I'm just missing a simple thing here. I get:

Performing coverage
   Processing coverage (each . represents one file):
.. processed: 50 out 
of 59
.
   Accumulating results (each . represents one file):

Covered LOC: 0
Not covered LOC: 0
Total LOC:   0
Percentage Coverage: 0.00%

So there's lots of files processed, and it does take a bit to do all that 
processing, but then I get nothing for results.
-
Aaron Wright___
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] Update and Coverage steps of Continuous Testing

2010-01-14 Thread Aaron_Wright
I was trying to get together a continuous build for my project but am 
having some trouble. Well, not real trouble, as it works, but I have a 
question none the less. My repository is not SVN or CVS, nor is like unto 
those; it's ClearCase. Is there any support for non-CVS or non-SVN 
repositories, or can I disable the Update portion of the Continuous build? 
The same goes for Coverage; it doesn't seem to work, so can I disable it? 
Like I said the continuous build gets recorded on the dashboard, so it 
works, but it actually fails on the command line; probably because it 
can't find coverage files.
-
Aaron Wright___
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] Unknown CMake command "UNSET".

2010-01-04 Thread Aaron_Wright
I didn't mean to imply that CMake itself was a pain to build or use on 
linux. I work in a pretty controlled environment that needs to be 
reproducible. I use debootstrap to create this environment, thus, 
everything is a nice little deb package. The destro is hardy, which is a 
little old, and so the latest backport was version 2.6.2. To get a new 
version of CMake I'd have to do the backport myself, which isn't too hard. 
I'd have to create the deb package and stuff it in my repo. All steps I 
was hoping to avoid.

It might be worth using 2.8, so I could go through the effort.

Thanks for providing a work-around.
-
Aaron Wright



Alexander Neundorf  
Sent by: cmake-boun...@cmake.org
01/04/2010 10:45 AM
Please respond to
a.neundorf-w...@gmx.net


To
cmake@cmake.org
cc
aaron_wri...@selinc.com
Subject
Re: [CMake] Unknown CMake command "UNSET".






On Monday 04 January 2010, aaron_wri...@selinc.com wrote:
> I'm not trying to do anything too fancy, just trying to call:
>
> UNSET( CACHE)
>
> It works with MSVC, but in linux I get:
>
> Unknown CMake command "UNSET".
>
> Am I missing something? Linux is version 2.6.2, and MSVC is 2.6.4. I'm

http://www.cmake.org/Wiki/CMake_Released_Versions

unset() exists since 2.6.3:
http://www.cmake.org/Wiki/CMake_2.6.3_Docs
http://www.cmake.org/Wiki/CMake_2.6.2_Docs

In many cases a 
set(FOO NOTFOUND CACHE STRING "docs..." FORCE)
(or FALSE or "" instead of NOTFOUND) is also good enough.

> asking first because I don't want to update the linux version, as that 
is
> difficult.

You can just download the binary packages for Linux available here:
http://www.cmake.org/cmake/resources/software.html
(http://www.cmake.org/files/v2.8/cmake-2.8.0-Linux-i386.tar.gz), and 
unpack it 
somewhere on your machine (e.g. in /opt/) and then call this cmake 
executable 
directly.

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

___
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] Unknown CMake command "UNSET".

2010-01-04 Thread Aaron_Wright
I'm not trying to do anything too fancy, just trying to call:

UNSET( CACHE)

It works with MSVC, but in linux I get:

Unknown CMake command "UNSET".

Am I missing something? Linux is version 2.6.2, and MSVC is 2.6.4. I'm 
asking first because I don't want to update the linux version, as that is 
difficult.
-
Aaron Wright___
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] getting undefined error to my own libs.

2009-12-29 Thread Aaron_Wright
Just put the implementation of the template class in the declaration. Get 
that to work, then try to get fancy if you want to.
-
Aaron Wright



"e...@cs.bgu.ac.il"  
Sent by: cmake-boun...@cmake.org
12/29/2009 08:54 AM

To
Eric Noulard 
cc
cmake@cmake.org
Subject
Re: [CMake] getting undefined error to my own libs.






ok, I've read the links, let say I'm not use the export option, when I 
look at the how to avoid link errors here: 
http://www.parashift.com/c++-faq-lite/templates.html#faq-35.13 I see that 
what I've did is the same, isn't it? 
I'm not sure where to follow from here... if I've did what they say and I 
still get a undefined error, then I must have miss configured cmake.
when I add extern to the deceleration in the header, I get this error: 
storage class specified for `Array`

On Tue 29 Dec 17:16 2009 Eric Noulard wrote:
> 2009/12/29 e...@cs.bgu.ac.il :
> > hello Eric, thanks for the response.
> > I'd like to solve the Array issue first, then the boost because I have 
a feeling it is a different one because when I disable the relevant code 
it doesn't generates the error even when other parts of the program (such 
as the threadpool).
> > here are the array files content: http://codepad.org/klDWMowB
> 
> I assume the content of the .hpp is between #ifndef CARRAY_HPP
> then the code is the .cpp file.
> 
> The trouble comes from the fact that your class is a template one,
> so that the content of the .cpp file may not be compiled independently
> "as-is" because it must be instantiated first.
> 
> I invite you to read this:
> http://www.parashift.com/c++-faq-lite/templates.html#faq-35.12
> and may be this one too:
> http://corfield.org/index.cfm/event/cplusplus.section/section/ptexp
> 
> Note that the "export keyword" solution may not be a good one
> because many compilers do not implement it, beginning with gcc:
> http://gcc.gnu.org/bugs/#nonbugs_cxx
> 
> > beside a strange typo that I've done, I don't thing I've miss 
configured it somehow.
> 
> I think may be you did not played a lot with templated classes.
> (just a guess I may be wrong).
> 
> Concerning this issue, I'm pretty sure this is not a CMake one.
> 
> -- 
> Erk
> Membre de l'April - « promouvoir et défendre le logiciel libre » -
> http://www.april.org
> 




___
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] getting undefined error to my own libs.

2009-12-29 Thread Aaron_Wright
With templates it's easiest to declare and implement in one file. The 
compiler likes this. Anything else you try requires extra work. Unless 
you're working in an embedded environment I don't see how executable size 
should even be a concern.
-
Aaron Wright



"e...@cs.bgu.ac.il"  
12/29/2009 09:11 AM

To
aaron_wri...@selinc.com
cc
cmake@cmake.org
Subject
Re: [CMake] getting undefined error to my own libs.






I'm trying to refrain from using that because it can bloat up the 
executable size... unless you can tell me otherwise. in general the 
program will be compiled using g++ for now, maybe I'll add support for 
windows compiler later.
also, I'm trying to keep the definitions to the header files and the code 
to the src files.
On Tue 29 Dec 18:59 2009 aaron_wri...@selinc.com wrote:
Just put the implementation of the template class in the declaration. Get 
that to work, then try to get fancy if you want to. 
-
Aaron Wright 


"e...@cs.bgu.ac.il"  
Sent by: cmake-boun...@cmake.org 
12/29/2009 08:54 AM 


To
Eric Noulard  
cc
cmake@cmake.org 
Subject
Re: [CMake] getting undefined error to my own libs.







ok, I've read the links, let say I'm not use the export option, when I 
look at the how to avoid link errors here: 
http://www.parashift.com/c++-faq-lite/templates.html#faq-35.13 I see that 
what I've did is the same, isn't it? 
I'm not sure where to follow from here... if I've did what they say and I 
still get a undefined error, then I must have miss configured cmake.
when I add extern to the deceleration in the header, I get this error: 
storage class specified for `Array`

On Tue 29 Dec 17:16 2009 Eric Noulard wrote:
> 2009/12/29 e...@cs.bgu.ac.il :
> > hello Eric, thanks for the response.
> > I'd like to solve the Array issue first, then the boost because I have 
a feeling it is a different one because when I disable the relevant code 
it doesn't generates the error even when other parts of the program (such 
as the threadpool).
> > here are the array files content: http://codepad.org/klDWMowB
> 
> I assume the content of the .hpp is between #ifndef CARRAY_HPP
> then the code is the .cpp file.
> 
> The trouble comes from the fact that your class is a template one,
> so that the content of the .cpp file may not be compiled independently
> "as-is" because it must be instantiated first.
> 
> I invite you to read this:
> http://www.parashift.com/c++-faq-lite/templates.html#faq-35.12
> and may be this one too:
> http://corfield.org/index.cfm/event/cplusplus.section/section/ptexp
> 
> Note that the "export keyword" solution may not be a good one
> because many compilers do not implement it, beginning with gcc:
> http://gcc.gnu.org/bugs/#nonbugs_cxx
> 
> > beside a strange typo that I've done, I don't thing I've miss 
configured it somehow.
> 
> I think may be you did not played a lot with templated classes.
> (just a guess I may be wrong).
> 
> Concerning this issue, I'm pretty sure this is not a CMake one.
> 
> -- 
> Erk
> Membre de l'April - « promouvoir et défendre le logiciel libre » -
> http://www.april.org
> 




___
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] functions as first class objects

2009-11-19 Thread Aaron_Wright
I agree with Michael. C/C++ does not allow you pass around functions. You 
can only pass around pointers to functions.

Perhaps this line is confusing you:

int (*Func)(int,int) = SomeFunction;

This is not assigning SomeFunction to Func. It's assigning a pointer to 
SomeFunction to Func. It technically should be written as:

int (*Func)(int,int) = &SomeFunction;

But the compiler is helping you out, or hurting you depending on the way 
you look at it.

-
Aaron Wright
Software Engineer - DCS Group
Schweitzer Engineering Laboratories, Inc.
Pullman, WA 99163
509-334-8087



Michael Wild  
Sent by: cmake-boun...@cmake.org
11/19/2009 07:46 AM

To
Jed Brown 
cc
CMake List 
Subject
Re: [CMake] functions as first class objects







On 19. Nov, 2009, at 15:44 , Jed Brown wrote:

> Michael Wild wrote:
>>
>> On 19. Nov, 2009, at 15:06 , Jed Brown wrote:
>>
>>> Michael Wild wrote:
>>>
 Not sure I'd like that... Instead of being more expressive, I 
 think this
 would be very confusing.
>>>
>>> This is not a some magic beast coming out of functional 
>>> languages.  In
>>> fact, it's pretty hard to find a language that can't do this sort of
>>> thing, even older Fortrans let you pass functions.
>>>
>>> Jed
>>
>> Yes, but that's something completely different! It's not like you're
>> able to do (using your notation):
>
> (not my notation)
>
>> set(&tmp &install)
>> set(&install &add_executable)
>> set(&add_executable &tmp)
>>
>> In C/C++ and to various extent in Fortran (depending on the 
>> version) you
>> can pass around "function pointers". This is _not_ a function. 
>> There's
>> no way of doing that in C/C++ or Fortran (that is, without using ugly
>> preprocessor magic).
>
> CMake is untyped where as C, for example, is statically typed and only
> allows symbols to be defined once (C++ breaks this with templates, but
> you're supposed to be careful so that all definitions are equivalent).

Although this is OT, I have to say that this is not true. C++ is still 
statically typed. You can overload functions, but then it really is 
the same thing as the function signature is considered to be part of 
the name. Also templates do not change this, as the template 
parameters are part of the type name.

> In any case, you sure can do
>
>  int (*Func)(int,int) = SomeFunction;
>  int x = Func(5,6);
>  int y = FoldL(Func,array,size,3);
>
> and so on.
>

Sure, but you're not _renaming_ a function. You're just assigning the 
address of a function to a pointer which can then be used to invoke 
that function. It is _always_ clear that Func is a pointer to a 
function and not something else.

> Jed
>

Anyways, I didn't want to get into a language-war, but rather voiced 
my dislike for such dubious flexibility. CMake is very domain-specific 
language used to create build systems, not a general-purpose language.

BTW, in the OP's particular case I would prefer to patch the upstream 
source without any voodoo.

Michael

___
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] Double Substitution in IF Statement

2009-11-18 Thread Aaron_Wright
I have a little question about how to prevent double substitution in an IF 
statement.

Consider this macro that looks through a list for a string, and sets a 
variable to TRUE if it is found. The problem I have is that the IF 
statement substitutes ${VALUE2} with LIB, and then substitutes LIB with 
HELLO, and finds what it's looking for, even though it wasn't really 
there. I want it to stop at the first substitution to prevent this weird 
behavior. Ideas?

MACRO(LIST_CONTAINS VAR VALUE)
SET(${VAR})

FOREACH(VALUE2 ${ARGN})
IF(${VALUE} STREQUAL ${VALUE2})
SET(${VAR} TRUE)
ENDIF()
ENDFOREACH()
ENDMACRO()

SET(LIB HELLO)
SET(LIBS LIB IS GREAT)

LIST_CONTAINS(CONTAINS_LIB ${LIB} ${LIBS})

MESSAGE(STATUS "CONTAINS_LIB = ${CONTAINS_LIB}")
-
Aaron Wright
Software Engineer - DCS Group
Schweitzer Engineering Laboratories, Inc.
Pullman, WA 99163
509-334-8087___
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] NMake Generation Error: machine type 'X86' conflicts with target machine type 'x64'

2009-11-13 Thread Aaron_Wright
I'm sorry, I was being a little flippant. I had an un-escaped "\" in my 
perl script that set the INCLUDE environment variable. Apparently, CMake 
was unable to compile a test program because of this messed up path, and 
thus assumed the box must be x64. I didn't mean to mislead you.

-
Aaron Wright



John Drescher  
11/13/2009 11:24 AM

To
aaron_wri...@selinc.com, CMake mailing list 
cc

Subject
Re: [CMake] NMake Generation Error: machine type 'X86' conflicts with 
target machine type 'x64'






On Fri, Nov 13, 2009 at 1:15 PM,  wrote:

Bill, 
I think you were right. I took a hard look at my SDK paths and 
changed a capital "I" to a lower-case "i" and everything seems better. 
Thanks for help. 

I am confused about that. Windows paths and filenames are not case 
sensitive.

John
___
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] NMake Generation Error: machine type 'X86' conflicts with target machine type 'x64'

2009-11-13 Thread Aaron_Wright
Bill,
I think you were right. I took a hard look at my SDK paths and 
changed a capital "I" to a lower-case "i" and everything seems better. 
Thanks for help.

On a side note, perhaps "assuming" x64 when x86 fails is a bad 
algorithm, or at least confusing.
-
Aaron Wright




Bill Hoffman  
Sent by: cmake-boun...@cmake.org
11/13/2009 09:07 AM

To
aaron_wri...@selinc.com
cc
CMake , Bill Hoffman 
Subject
Re: [CMake] NMake Generation Error: machine type 'X86' conflicts with 
target machine type 'x64'






aaron_wri...@selinc.com wrote:
> 
> I have the windows SDK installed. It came with Visual Studio. I run 
> everything from perl, so in my script, I set the environment to:
> 
>  $ENV{"VSINSTALLDIR"} = "C:\\Program Files\\Microsoft Visual 
> Studio 9.0";
>  $ENV{"VCINSTALLDIR"} = "C:\\Program Files\\Microsoft Visual 
> Studio 9.0\\VC";
>  $ENV{"FrameworkDir"} = "C:\\WINDOWS\\Microsoft.NET\\Framework";
>  $ENV{"FrameworkVersion"} = "v2.0.50727";
>  $ENV{"Framework35Version"} = "v3.5";
>  $ENV{"DevEnvDir"} = "C:\\Program Files\\Microsoft Visual Studio 

> 9.0\\Common7\\IDE";
>  $ENV{"PATH"} = "C:\\Program Files\\Microsoft Visual Studio 
> 9.0\\Common7\\IDE;C:\\Program Files\\Microsoft Visual Studio 
> 9.0\\VC\\BIN;C:\\Program Files\\Microsoft Visual Studio 
> 
9.0\\Common7\\Tools;C:\\WINDOWS\\Microsoft.NET\\Framework\\v3.5;C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727;C:\\Program
 

> Files\\Microsoft Visual Studio 9.0\\VC\\VCPackages;*C:\\Program 
> Files\\Microsoft SDKs\\Windows\\v6.0A\\bin*;" . $ENV{"PATH"};
>  $ENV{"INCLUDE"} = "C:\\Program Files\\Microsoft Visual Studio 
> 9.0\VC\\INCLUDE;*C:\\Program Files\\Microsoft 
> SDKs\\Windows\\v6.0A\\Include*;" . $ENV{"INCLUDE"};
>  $ENV{"LIB"} = "C:\\Program Files\\Microsoft Visual Studio 
> 9.0\\VC\\LIB;*C:\\Program Files\\Microsoft SDKs\\Windows\\v6.0A\\Lib*;" 
> . $ENV{"LIB"};
>  $ENV{"LIBPATH"} = 
> 
"C:\\WINDOWS\\Microsoft.NET\\Framework\\v3.5;C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727;C:\\Program
 

> Files\\Microsoft Visual Studio 9.0\\VC\\LIB;" . $ENV{"LIBPATH"};
> 

Look in the CMakeError.log and CMakeOutput.log files to see why it 
thinks it is 64 bit.  The 64 detect is sort of a hack... It tries to 
build with 32 bit flags, and if that fails it assumes 64.  Most of the 
time when it gets this wrong it means that it can not find the system 
libraries from the SDK.

-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

Re: [CMake] NMake Generation Error: machine type 'X86' conflicts with target machine type 'x64'

2009-11-13 Thread Aaron_Wright
I have the windows SDK installed. It came with Visual Studio. I run 
everything from perl, so in my script, I set the environment to:

 $ENV{"VSINSTALLDIR"} = "C:\\Program Files\\Microsoft Visual 
Studio 9.0";
 $ENV{"VCINSTALLDIR"} = "C:\\Program Files\\Microsoft Visual 
Studio 9.0\\VC";
 $ENV{"FrameworkDir"} = "C:\\WINDOWS\\Microsoft.NET\\Framework";
 $ENV{"FrameworkVersion"} = "v2.0.50727";
 $ENV{"Framework35Version"} = "v3.5";
 $ENV{"DevEnvDir"} = "C:\\Program Files\\Microsoft Visual Studio 
9.0\\Common7\\IDE";
 $ENV{"PATH"} = "C:\\Program Files\\Microsoft Visual Studio 
9.0\\Common7\\IDE;C:\\Program Files\\Microsoft Visual Studio 
9.0\\VC\\BIN;C:\\Program Files\\Microsoft Visual Studio 
9.0\\Common7\\Tools;C:\\WINDOWS\\Microsoft.NET\\Framework\\v3.5;C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727;C:\\Program
 
Files\\Microsoft Visual Studio 9.0\\VC\\VCPackages;C:\\Program 
Files\\Microsoft SDKs\\Windows\\v6.0A\\bin;" . $ENV{"PATH"};
 $ENV{"INCLUDE"} = "C:\\Program Files\\Microsoft Visual Studio 
9.0\VC\\INCLUDE;C:\\Program Files\\Microsoft SDKs\\Windows\\v6.0A\\Include
;" . $ENV{"INCLUDE"};
 $ENV{"LIB"} = "C:\\Program Files\\Microsoft Visual Studio 
9.0\\VC\\LIB;C:\\Program Files\\Microsoft SDKs\\Windows\\v6.0A\\Lib;" . 
$ENV{"LIB"};
 $ENV{"LIBPATH"} = 
"C:\\WINDOWS\\Microsoft.NET\\Framework\\v3.5;C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727;C:\\Program
 
Files\\Microsoft Visual Studio 9.0\\VC\\LIB;" . $ENV{"LIBPATH"};

Note the Windows SDK

-
Aaron Wright



Bill Hoffman  
Sent by: cmake-boun...@cmake.org
11/13/2009 08:26 AM

To
aaron_wri...@selinc.com
cc
CMake 
Subject
Re: [CMake] NMake Generation Error: machine type 'X86' conflicts with 
target machine type 'x64'






aaron_wri...@selinc.com wrote:
> 
> I've tried this on several machines and CMake always seems to think the 
> box is x64 even though it clearly says it's x86. I can fix the problem 
> by deleting CMakeCache.txt and running CMake again, which is weird. I'm 
> trying to automate the whole thing in a night build script so this 
> behavior is not helpful. Ideas?
> -
> Aaron Wright

You need to install the windows SDK for CMake to work.

-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

Re: [CMake] NMake Generation Error: machine type 'X86' conflicts with target machine type 'x64'

2009-11-13 Thread Aaron_Wright
I'm not moving CMakeCache.txt around. I start with a completely new and 
empty folder each time. I run CMake and it thinks that the target machine 
is x64. I don't specify any funny business with cross-compiling to a 
different target machine or anything.

I understand the "ctest -S" for night builds and dashboards and whatnot, 
but the company already has their own night build system and dashboard and 
I have to fit their model, which is not that hard, I just to automate this 
build. NMake seemed to be a good idea, but CMake seems unable to configure 
for it in one pass.
-
Aaron Wright



Richard Wackerbarth  
Sent by: cmake-boun...@cmake.org
11/13/2009 08:46 AM
Please respond to
Richard Wackerbarth 


To
aaron_wri...@selinc.com
cc
CMake 
Subject
Re: [CMake] NMake Generation Error: machine type 'X86' conflicts with 
target machine type 'x64'






Aaron,

Perhaps I have it wrong, but I think that the problem is that you are 
using CMakeCache.txt that was created on a different machine.

CMakeCache.txt acts as a "configuration file" that overrides the registry, 
environmental variables, and everything else that has a default value.
This allows the user to define the values that he wishes to have used.

As for automated nightly builds, the standard technique is to use "ctest 
-S" to set up and run the dashboard. In that case, you usually have it 
delete the previous build directory and you populate the initial cache 
with only those values that you wish to "force" (for example, you might 
select a particular compiler for one run and another for a different run). 
Variables that you want to have their default value are simply omitted 
from the initial cache.  See the notes files on almost any of the nightly 
submissions to the CMake dashboard for examples.

Richard

On Nov 13, 2009, at 10:25 AM, Bill Hoffman wrote:

> aaron_wri...@selinc.com wrote:
>> I've tried this on several machines and CMake always seems to think the 
box is x64 even though it clearly says it's x86. I can fix the problem by 
deleting CMakeCache.txt and running CMake again, which is weird. I'm 
trying to automate the whole thing in a night build script so this 
behavior is not helpful. Ideas?
>> -
>> Aaron Wright
> 
> You need to install the windows SDK for CMake to work.
> 
> -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

Re: [CMake] NMake Generation Error: machine type 'X86' conflicts with target machine type 'x64'

2009-11-13 Thread Aaron_Wright
I've tried this on several machines and CMake always seems to think the 
box is x64 even though it clearly says it's x86. I can fix the problem by 
deleting CMakeCache.txt and running CMake again, which is weird. I'm 
trying to automate the whole thing in a night build script so this 
behavior is not helpful. Ideas?
-
Aaron Wright



Aaron Wright/SEL 
11/12/2009 02:36 PM

To
CMake 
cc

Subject
NMake Generation Error: machine type 'X86' conflicts with target machine 
type 'x64'





I'm trying to use nmake to build a simple library, but cmake seems to have 
a problem figuring out if my machine is x86 or x64. For example, I run,

cmake -G "NMake Makefiles" ..

and I get:

CMakeFiles\cmTryCompileExec.dir\testCCompiler.c.obj : fatal error LNK1112:
module machine type 'X86' conflicts with target machine type 'x64'

My CMakeOutput.log files says:

The system is: Windows - 5.1 - x86
Determining if this is a 64 bit system passed:
CreateProcessError: The system cannot find the file specified.


for command: cl /nologo "C:\Program Files\CMake 
2.6\share\cmake-2.6\Modules\CMakeTestForFreeVC.cxx" /link /machine:i386 
in dir: X:/dcs/components/directory/nmake_build/CMakeFiles/CMakeTmp3

Compiling the C compiler identification source file "CMakeCCompilerId.c" 
succeeded.
Compiler: C:/Program Files/Microsoft Visual Studio 9.0/VC/bin/cl.exe 
Build flags: ;/DWIN32;/D_WINDOWS;/W3;/Zm1000
Id flags: 

The output was:
0
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 
80x86
Copyright (C) Microsoft Corporation.  All rights reserved.

Which seems pretty x86 to me. Where is this x64 coming from?

I'm using a Visual Studio 9 2008 Express command prompt.

Aaron Wright

___
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] NMake Generation Error: machine type 'X86' conflicts with target machine type 'x64'

2009-11-12 Thread Aaron_Wright
I'm trying to use nmake to build a simple library, but cmake seems to have 
a problem figuring out if my machine is x86 or x64. For example, I run,

cmake -G "NMake Makefiles" ..

and I get:

CMakeFiles\cmTryCompileExec.dir\testCCompiler.c.obj : fatal error LNK1112:
module machine type 'X86' conflicts with target machine type 'x64'

My CMakeOutput.log files says:

The system is: Windows - 5.1 - x86
Determining if this is a 64 bit system passed:
CreateProcessError: The system cannot find the file specified.


for command: cl /nologo "C:\Program Files\CMake 
2.6\share\cmake-2.6\Modules\CMakeTestForFreeVC.cxx" /link /machine:i386 
in dir: X:/dcs/components/directory/nmake_build/CMakeFiles/CMakeTmp3

Compiling the C compiler identification source file "CMakeCCompilerId.c" 
succeeded.
Compiler: C:/Program Files/Microsoft Visual Studio 9.0/VC/bin/cl.exe 
Build flags: ;/DWIN32;/D_WINDOWS;/W3;/Zm1000
Id flags: 

The output was:
0
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 
80x86
Copyright (C) Microsoft Corporation.  All rights reserved.

Which seems pretty x86 to me. Where is this x64 coming from?

I'm using a Visual Studio 9 2008 Express command prompt.

Aaron Wright
___
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] How to build INSTALL project from the command line?

2009-11-10 Thread Aaron_Wright
That did the trick. I've never used nmake directly before.
-
Aaron Wright
Software Engineer - DCS Group
Schweitzer Engineering Laboratories, Inc.
Pullman, WA 99163
509-334-8087



"Dixon, Shane"  
11/10/2009 02:17 PM

To
, "CMake" 
cc

Subject
RE: [CMake] How to build INSTALL project from the command line?






Aaron,
 
Visual Studios should just be a driver for "nmake", so you could use:
 
cmake -G "NMake Makefiles" ..
 
and then use:
 
nmake install
 
The catch is that you have to run all that from the Visual Studio Command 
Prompt so it knows where to find "nmake", "cl" and "link".
 

--
Shane Dixon
Linux Engineer
Atmel Corporation

 

From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf 
Of aaron_wri...@selinc.com
Sent: Tuesday, November 10, 2009 3:09 PM
To: CMake
Subject: [CMake] How to build INSTALL project from the command line?


I've been trying to build the INSTALL project as part of the solution from 
the commandline. For example, after running: 

cmake -G "Visual Studio 9 2008" .. 

I've tried: 

msbuild /t:INSTALL /p:Configuration=Release solution.sln 

But this builds ALL_BUILD and then tells me tells me: 

The project "INSTALL" is not selected for building in solution 
configuration "Release|Win32" 

Is there a way to make this work from cmake's end? I've tried every 
commandline swtich I can think of for msbuild but have had no luck. I can 
build the INSTALL.vcproj directly, but this looses the dependencies 
between projects, like INSTALL's dependency on ALL_BUILD. I'd like to get 
this done with one call if possible. 
-
Aaron Wright
___
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] How to build INSTALL project from the command line?

2009-11-10 Thread Aaron_Wright
I've been trying to build the INSTALL project as part of the solution from 
the commandline. For example, after running:

cmake -G "Visual Studio 9 2008" ..

I've tried:

msbuild /t:INSTALL /p:Configuration=Release solution.sln

But this builds ALL_BUILD and then tells me tells me:

The project "INSTALL" is not selected for building in solution 
configuration "Release|Win32"

Is there a way to make this work from cmake's end? I've tried every 
commandline swtich I can think of for msbuild but have had no luck. I can 
build the INSTALL.vcproj directly, but this looses the dependencies 
between projects, like INSTALL's dependency on ALL_BUILD. I'd like to get 
this done with one call if possible.
-
Aaron Wright___
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] Include Guard to Stop Duplicate Targets?

2009-10-26 Thread Aaron_Wright
That solution works pretty good Mike. Not quite what I thought I was 
looking for, but it works.
-
Aaron Wright
Software Engineer - DCS Group
Schweitzer Engineering Laboratories, Inc.
Pullman, WA 99163
509-334-8087



Mike Jackson  
Sent by: cmake-boun...@cmake.org
10/24/2009 04:50 AM

To
aaron_wri...@selinc.com
cc
cmake@cmake.org
Subject
Re: [CMake] Include Guard to Stop Duplicate Targets?






Few possibilities:
Are Components a and b just libraries that do NOT really depend on
Executable A, B, or C? If so, then in the top level CMakeLists.txt
file add those subdirectories FIRST, then add the Executable's
directories with dependencies on components a and b.

   If components a and b are something like plugins and they need the
executables A, B or C built first then you may have to add some logic
to the components a and b to avoid adding them again.

_
Mike Jackson  mike.jack...@bluequartz.net
BlueQuartz Softwarewww.bluequartz.net
Principal Software Engineer  Dayton, Ohio




On Fri, Oct 23, 2009 at 6:09 PM,   wrote:
>
> I have a small project with several different parts that I would like to
> build with CMake, but I'm having some trouble pulling it all together.
>
>  For example purposes, there's an overall project with three executables
> that use two static libraries. The executables and static libraries are
> produced as part of the build. The directory structure looks like this:
>
>/
>   projects/
>  00-/
> CMakeLists.txt
>   products/
>  executable_a/
> src/
> include/
>CMakeLists.txt
>  executable_b/
> src/
> include/
>CMakeLists.txt
>  executable_c/
> src/
> include/
>CMakeLists.txt
>   components/
>  a/
> src/
> include/
> CMakeLists.txt
>  b/
> src/
> include/
> CMakeLists.txt
>
> I would like /projects/00-/CMakeLists.txt to be the top level
> CMakeLists.txt file and to contain:
>
>PROJECT(00-)
>
>ADD_SUBDIRECTORY(../../products/executable_a executable_a)
>ADD_SUBDIRECTORY(../../products/executable_b executable_b)
>ADD_SUBDIRECTORY(../../products/executable_c executable_c)
>
> And /products/executable_a/CMakeLists.txt to contain:
>
>PROJECT(executable_a)
>
>ADD_SUBDIRECTORY(../../components/a a)
>
> And /products/executable_b/CMakeLists.txt to contain:
>
>PROJECT(executable_b)
>
>ADD_SUBDIRECTORY(../../components/b b)
>
> And /products/executable_c/CMakeLists.txt to contain:
>
>PROJECT(executable_c)
>
>ADD_SUBDIRECTORY(../../components/a a)
>ADD_SUBDIRECTORY(../../components/b b)
>
> So I have each executable using ADD_SUBDIRECTORY to get the components 
it
> needs. The problem obviously is that the CMakeLists.txt for components a 
and
> b are included twice, producing duplicate targets that CMake doesn't 
like. I
> was thinking that this was similar to header files in C/C++, and in that
> world every header files uses an include guard to prevent duplication. 
So is
> there a way in CMake to implement include guards, or rather 
ADD_SUBDIRECTORY
> guards?
>
> Or, am I headed down the wrong path entirely?
>
> -
> Aaron Wright
> ___
> 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

___
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 Guard to Stop Duplicate Targets?

2009-10-23 Thread Aaron_Wright
I have a small project with several different parts that I would like to 
build with CMake, but I'm having some trouble pulling it all together.

 For example purposes, there's an overall project with three executables 
that use two static libraries. The executables and static libraries are 
produced as part of the build. The directory structure looks like this:

   /
  projects/
 00-/
CMakeLists.txt
  products/
 executable_a/
src/
include/
   CMakeLists.txt
 executable_b/
src/
include/
   CMakeLists.txt
 executable_c/
src/
include/
   CMakeLists.txt
  components/
 a/
src/
include/
CMakeLists.txt
 b/
src/
include/
CMakeLists.txt

I would like /projects/00-/CMakeLists.txt to be the top level 
CMakeLists.txt file and to contain:

   PROJECT(00-)

   ADD_SUBDIRECTORY(../../products/executable_a executable_a)
   ADD_SUBDIRECTORY(../../products/executable_b executable_b)
   ADD_SUBDIRECTORY(../../products/executable_c executable_c)

And /products/executable_a/CMakeLists.txt to contain:

   PROJECT(executable_a)

   ADD_SUBDIRECTORY(../../components/a a)

And /products/executable_b/CMakeLists.txt to contain:

   PROJECT(executable_b)

   ADD_SUBDIRECTORY(../../components/b b)

And /products/executable_c/CMakeLists.txt to contain:

   PROJECT(executable_c)

   ADD_SUBDIRECTORY(../../components/a a)
   ADD_SUBDIRECTORY(../../components/b b)

So I have each executable using ADD_SUBDIRECTORY to get the components it 
needs. The problem obviously is that the CMakeLists.txt for components a 
and b are included twice, producing duplicate targets that CMake doesn't 
like. I was thinking that this was similar to header files in C/C++, and 
in that world every header files uses an include guard to prevent 
duplication. So is there a way in CMake to implement include guards, or 
rather ADD_SUBDIRECTORY guards?

Or, am I headed down the wrong path entirely?

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