[CMake] Fwd: Re: how to do this: svn info?

2012-06-28 Thread m.hergarden



Will a string replace combo help in your case? We use it to replace line
endings with ; to make a cmake list variable from a filelist:

STRING(REPLACE "\n" "\\" svn_lastlog_with_slashes ${svn_lastlog})

regards,
Micha

On 06/29/2012 01:56 AM, Totte Karlsson wrote:

Hi,

I'm trying to get some svn information into a build of a C library.

The cmake currently looks like this (gathered from various posts)

INCLUDE(FindSubversion)
IF(SUBVERSION_FOUND)
Subversion_WC_INFO(${PROJECT_SOURCE_DIR} rr)
Subversion_WC_LOG(${PROJECT_SOURCE_DIR} rr)

SET(infoFile rr_svn_info)

FILE(WRITE ${infoFile}.txt
"#ifndef ${infoFile}H
#define ${infoFile}H
const int SVN_VERSION =  ${rr_WC_REVISION};\n
const char* SVN_LAST_COMMIT_AUTHOR =\"${rr_WC_LAST_CHANGED_AUTHOR}\";\n
const char* SVN_LASTLOG =\"${rr_LAST_CHANGED_LOG}\";\n
#endif"
)

EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy_if_different
${infoFile}.txt ${infoFile}.h)
ENDIF(SUBVERSION_FOUND)


Currently I have two problems:
When generating the header, the svn_lastlog expands to something like

const char* SVN_LASTLOG ="

r505 | tottek | 2012-06-28 14:11:49 -0700 (Thu, 28 Jun 2012) | 20 lines

New release
. etc..

The above will not compile, because a string spanning multiple lines
in C must have a continuation character at the end of each line, e.g.

const char* SVN_LASTLOG ="\
\
r505 | tottek | 2012-06-28 14:11:49 -0700 (Thu, 28 Jun 2012) | 20 lines\
 etc...

How would one solve that in CMake?

The second problem is the execute process command
EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy_if_different
${infoFile}.txt ${infoFile}.h)

which do create the txt file, but fails to copy it to the .h file.
Just getting an error saying
Error copying file (if different) from "the txt file" to "the h file"

Any tips?

-totte







--

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 do this: svn info?

2012-06-28 Thread Totte Karlsson

Hi,

I'm trying to get some svn information into a build of a C library.

The cmake currently looks like this (gathered from various posts)

INCLUDE(FindSubversion)
IF(SUBVERSION_FOUND)
Subversion_WC_INFO(${PROJECT_SOURCE_DIR} rr)
Subversion_WC_LOG(${PROJECT_SOURCE_DIR} rr)

SET(infoFile rr_svn_info)

FILE(WRITE ${infoFile}.txt
"#ifndef ${infoFile}H
#define ${infoFile}H
const int SVN_VERSION =  ${rr_WC_REVISION};\n
const char* SVN_LAST_COMMIT_AUTHOR =\"${rr_WC_LAST_CHANGED_AUTHOR}\";\n
const char* SVN_LASTLOG =\"${rr_LAST_CHANGED_LOG}\";\n
#endif"
)

EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy_if_different 
${infoFile}.txt ${infoFile}.h)

ENDIF(SUBVERSION_FOUND)


Currently I have two problems:
When generating the header, the svn_lastlog expands to something like

const char* SVN_LASTLOG =" 


r505 | tottek | 2012-06-28 14:11:49 -0700 (Thu, 28 Jun 2012) | 20 lines

New release
. etc..

The above will not compile, because a string spanning multiple lines in C must 
have a continuation character at the end of each line, e.g.


const char* SVN_LASTLOG ="\ 
\

r505 | tottek | 2012-06-28 14:11:49 -0700 (Thu, 28 Jun 2012) | 20 lines\
 etc...

How would one solve that in CMake?

The second problem is the execute process command
EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy_if_different 
${infoFile}.txt ${infoFile}.h)


which do create the txt file, but fails to copy it to the .h file. Just getting 
an error saying

Error copying file (if different) from "the txt file" to "the h file"

Any tips?

-totte

--
.
Totte Karlsson, Ph.D.
Dune Scientific, LLC
425-296 1980 (office)
425-780 9648 (cell)
www.dunescientific.com
.


--

Powered by www.kitware.com

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

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

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


Re: [CMake] FindSubversion

2012-06-28 Thread Totte Karlsson

>
> In your build directory run:
>
> cmake -D  Subversion_SVN_EXECUTABLE=c:/some/thing/svn.exe .
>

Well, I want clients of this library to be able to compile it without too many 
tricks. I assume your command changes the path in the cache to a different svn 
client. Is that right?


I found that uninstalling the cygwin svn client, makes things work (cmake then 
finds the tortoise command line client). So I'll just tell my clients that they 
have to uninstall their cygwin svn client if they want to compile this code.


Having two svn command line clients may seem odd anyway..?

Perhaps, having the user setting up svn (giving the path to) in the UI would 
make most sense, since the findcommand fails in this case? Not sure how to do 
that however...


Thanks,
-totte
--

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

2012-06-28 Thread Rolf Eike Beer
Totte Karlsson wrote:
> Hi,
> I am doing development on windows. I also have cygwin installed, to do
> things from the commandline once in a while. I also use TortoiseSVN.
> 
> When trying to use
> SUBVERSION_WC_INFO(${PROJECT_SOURCE_DIR} info)
> 
> In a cmake file, I get the following error:
> 
>   Command "c:/cygwin/bin/svn.exe info
>C:/roadrunnerwork/source/trunk/Wrappers" failed with output:
> 
>svn: E155007:
>'/cygdrive/c/rrBuilds/xe/rr/C:/roadrunnerwork/source/trunk/Wrappers' is
> not a working copy
> 
> So it seems it found the cygwin svn comman line client. The path:
> '/cygdrive/c/rrBuilds/xe/rr/C:/roadrunnerwork/source/trunk/Wrappers'
> 
> is composed of the path where I execute the make command and the source
> folder, for which I want the svn info..
> 
> How to recover from this?

In your build directory run:

cmake -D  Subversion_SVN_EXECUTABLE=c:/some/thing/svn.exe .

Eike
-- 


signature.asc
Description: This is a digitally signed message part.
--

Powered by www.kitware.com

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

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

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

[CMake] FindSubversion

2012-06-28 Thread Totte Karlsson

Hi,
I am doing development on windows. I also have cygwin installed, to do things 
from the commandline once in a while. I also use TortoiseSVN.


When trying to use
SUBVERSION_WC_INFO(${PROJECT_SOURCE_DIR} info)

In a cmake file, I get the following error:

 Command "c:/cygwin/bin/svn.exe info
  C:/roadrunnerwork/source/trunk/Wrappers" failed with output:

  svn: E155007:
  '/cygdrive/c/rrBuilds/xe/rr/C:/roadrunnerwork/source/trunk/Wrappers' is not
  a working copy

So it seems it found the cygwin svn comman line client. The path:
'/cygdrive/c/rrBuilds/xe/rr/C:/roadrunnerwork/source/trunk/Wrappers'

is composed of the path where I execute the make command and the source folder, 
for which I want the svn info..


How to recover from this?

-totte



--
.
Totte Karlsson, Ph.D.
Dune Scientific, LLC
425-296 1980 (office)
425-780 9648 (cell)
www.dunescientific.com
.


--

Powered by www.kitware.com

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

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

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


Re: [CMake] Supplying different debug flags during compile and link stages for libraries and executables

2012-06-28 Thread Brett Delle Grazie
Hi Petr, et. al.

It looks like I spoke too soon.
I cannot see any way to separate the debug compile flag (-g) so that
it does not appear on the linker lines for static and shared
libraries.

The creation rules for static / shared libraries all include
"" which inevitably includes the debug flags.

On AIX, the '-g' debug flag should only be supplied to executable
targets otherwise duplicate symbol errors result.

I'll take a look at the sources and see if anything can be done there
otherwise I might have to raise a defect.

If anyone has any alternative suggestions please let me know.

Kind regards,

Brett

On 28 June 2012 14:31, Brett Delle Grazie  wrote:
> Hi Petr,
>
> Thanks very much ... I saw something extremely similar in the VS
> /STACK:1000 and managed to work it out from there.
> I've been playing around with it today and have managed to get somewhere.
>
> Thanks again,
>
> Brett
>
> On 28 June 2012 08:06, Petr Kmoch  wrote:
>> Hi Brett,
>>
>> as far as I know, compilation flags come from
>> CMAKE__FLAGS_, while linker flags come from
>> CMAKE_{SHARED|EXE}_LINKER_FLAGS[_]. So you should be able to
>> override CMAKE_SHARED_LINKER_FLAGS_Debug (not sure with correct case
>> for configuration name) and remove -g from there.
>>
>> Petr
>>
>> On Wed, Jun 27, 2012 at 10:36 PM, Brett Delle Grazie
>>  wrote:
>>> Hi,
>>>
>>> On AIX using the XLC compiler I've determined the debug flag (-g)
>>> should be used for all compile stages but should only be supplied to
>>> the final
>>> link stage of an executable (not a library target), otherwise
>>> duplicate symbol errors result.
>>> For reference see:
>>> http://www.ibm.com/developerworks/forums/thread.jspa?threadID=438591&tstart=0
>>>
>>> Is there an easy way of supplying a different set of debug flags for
>>> the compile stage as opposed to the link stage?
>>>
>>> I could potentially override:
>>> CMAKE_C_FLAGS_DEBUG_INIT
>>> CMAKE_CXX_FLAGS_DEBUG_INIT
>>>
>>> but I can't really see where these are combined into the compile / link 
>>> rules.
>>>
>>> Does anyone have any suggestions? Any guidance / help is appreciated.
>>>
>>> Thanks,
>>>
>>> --
>>> Best Regards,
>>>
>>> Brett Delle Grazie
>>> --
>>>
>>> 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,
>
> Brett Delle Grazie



-- 
Best Regards,

Brett Delle Grazie
--

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] Latest Xcode install (4.3.x) and CMake error

2012-06-28 Thread Michael Jackson
Thanks. I'll give that a try.

___
Mike JacksonPrincipal Software Engineer
BlueQuartz SoftwareDayton, Ohio
mike.jack...@bluequartz.net  www.bluequartz.net

On Jun 28, 2012, at 9:30 AM, Sean McBride wrote:

> On Thu, 28 Jun 2012 09:16:31 -0400, Michael Jackson said:
> 
>> Error: No developer directory found at /Developer.  Run
>> /usr/bin/xcode-select to update the developer directory path.
> 
> Hey Mike!
> 
> Maybe your xcode-select is still pointing to /Developer?  Try rerunning 
> xcode-select to point it to /Applications/Xcode.app (or where ever).  It has 
> a pretty good man page too BTW.
> 
> --
> 
> Sean McBride, B. Eng s...@rogue-research.com
> Rogue Researchwww.rogue-research.com
> Mac Software Developer  Montréal, Québec, Canada
> 
> 

--

Powered by www.kitware.com

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

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

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


[CMake] LINK_LIBRARIES not spilled to response file

2012-06-28 Thread Zaheer Chothia
Hello,

I encountered an issue while building a CMake project where one target is linked
against a large number of libraries.  Unlike object files, libraries are not
placed into a response file, which can lead to build commands which exceed the
length limits on Windows.  For reference, I am using the CMake 2.8.9-rc1 and
Ninja generator with Microsoft compilers.

Following this mail is a testcase generator [1] to demonstrate this issue
(sample project attached for convenience).  The build fails with this error (for
readibility I replaced a long sequence of libraries with <...>):

FAILED: cmd.exe /c cd. && "C:\Program Files
(x86)\CMake\bin\cmake.exe" -E vs_link_exe
C:\PROGRA~2\MICROS~3.0\VC\bin\cl.exe  /nologo @hello.exe.rsp  /DWIN32
/D_WINDOWS /W3 /Zm1000 /D_DEBUG /MDd /Zi  /Ob0 /Od /RTC1 /Fehello.exe
/Fdhello.pdb -link /implib:hello.lib /version:0.0  /STACK:1000
/machine:X86  /debug /INCREMENTAL /subsystem:console
src\abcdefghijklmnopqrstuvwxyz0123456789\library1.lib
src\abcdefghijklmnopqrstuvwxyz0123456789\library2.lib <...>
kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib
oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd.
The command line is too long.

ninja: build stopped: subcommand failed.

Although this example may seem artificial, with the use case I refer to (i)
libraries are are specified by absolute paths so they are indeed reasonably long
and (ii) since there are third-party libraries involved I would not be able to
simply combine source files into one large library as is possible here.  I
should also mention that this issue does not affect the Visual Studio
generators, however it is present with the following: Ninja, MinGW
Makefiles, NMake Makefiles, MSYS Makefiles.  For Ninja I suspect that the
indirection via cmd.exe imposes a maximum command length of 8192 KB, whereas for
the others this will likely be 32 KB (CreateProcess).

I would be quite content if this is fixed for the Ninja generator.  A simple fix
would be to adapt the build rules by moving $LINK_LIBRARIES from 'command' to
'rspfile_content':

--- rules.ninja.bak 2012-06-28 15:23:35 +0100
+++ rules.ninja 2012-06-28 15:38:09 +0100
@@ -40,10 +40,10 @@
 # Rule for linking C executable.

 rule C_EXECUTABLE_LINKER_RSPFILE
-  command = cmd.exe /c $PRE_LINK && "C:\Program Files
(x86)\CMake\bin\cmake.exe" -E vs_link_exe
C:\PROGRA~2\MICROS~3.0\VC\bin\cl.exe  /nologo @$out.rsp  $FLAGS
/Fe$out /Fd$TARGET_PDB -link /implib:$TARGET_IMPLIB /version:0.0
$LINK_FLAGS $LINK_LIBRARIES && $POST_BUILD
+  command = cmd.exe /c $PRE_LINK && "C:\Program Files
(x86)\CMake\bin\cmake.exe" -E vs_link_exe
C:\PROGRA~2\MICROS~3.0\VC\bin\cl.exe  /nologo @$out.rsp  $FLAGS
/Fe$out /Fd$TARGET_PDB -link /implib:$TARGET_IMPLIB /version:0.0
$LINK_FLAGS && $POST_BUILD
   description = Linking C executable $out
   rspfile = $out.rsp
-  rspfile_content = $in
+  rspfile_content = $in $LINK_LIBRARIES

Best,

--Zaheer

 [1]: BEGIN: testcase.sh ---
#!/bin/bash -e

NUM_LIBRARIES=500
# Use a long path to quickly exhaust the command-line length limit.
SRC_DIR=src/abcdefghijklmnopqrstuvwxyz0123456789

# Root directory: application and CMakeLists.txt
echo "int main() { return 0; }" > hello.c

cat << EOF > CMakeLists.txt
cmake_minimum_required(VERSION 2.8)

project(Hello)

add_subdirectory($SRC_DIR)

add_executable(hello hello.c)
target_link_libraries(hello
EOF

for ((i = 1; i <= $NUM_LIBRARIES; i++)); do
echo "library$i" >> "CMakeLists.txt"
done

echo ")" >> "CMakeLists.txt"

# Libraries: sources and CMakeLists.txt
mkdir -p "$SRC_DIR"
[[ -f "$SRC_DIR/CMakeLists.txt" ]] && rm "$SRC_DIR/CMakeLists.txt"
for ((i = 1; i <= $NUM_LIBRARIES; i++)); do
echo "int function$i() { return $i; }" > "$SRC_DIR/function$i.c"
echo "add_library(library$i function$i.c)" >> "$SRC_DIR/CMakeLists.txt"
done

echo "Testcase has been setup: now build with CMake and Ninja generator."
 [1]: END: testcase.sh ---


cmake_testcase_many_libraries_rspfile.tar.bz2
Description: BZip2 compressed data
--

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] Supplying different debug flags during compile and link stages for libraries and executables

2012-06-28 Thread Brett Delle Grazie
Hi Petr,

Thanks very much ... I saw something extremely similar in the VS
/STACK:1000 and managed to work it out from there.
I've been playing around with it today and have managed to get somewhere.

Thanks again,

Brett

On 28 June 2012 08:06, Petr Kmoch  wrote:
> Hi Brett,
>
> as far as I know, compilation flags come from
> CMAKE__FLAGS_, while linker flags come from
> CMAKE_{SHARED|EXE}_LINKER_FLAGS[_]. So you should be able to
> override CMAKE_SHARED_LINKER_FLAGS_Debug (not sure with correct case
> for configuration name) and remove -g from there.
>
> Petr
>
> On Wed, Jun 27, 2012 at 10:36 PM, Brett Delle Grazie
>  wrote:
>> Hi,
>>
>> On AIX using the XLC compiler I've determined the debug flag (-g)
>> should be used for all compile stages but should only be supplied to
>> the final
>> link stage of an executable (not a library target), otherwise
>> duplicate symbol errors result.
>> For reference see:
>> http://www.ibm.com/developerworks/forums/thread.jspa?threadID=438591&tstart=0
>>
>> Is there an easy way of supplying a different set of debug flags for
>> the compile stage as opposed to the link stage?
>>
>> I could potentially override:
>> CMAKE_C_FLAGS_DEBUG_INIT
>> CMAKE_CXX_FLAGS_DEBUG_INIT
>>
>> but I can't really see where these are combined into the compile / link 
>> rules.
>>
>> Does anyone have any suggestions? Any guidance / help is appreciated.
>>
>> Thanks,
>>
>> --
>> Best Regards,
>>
>> Brett Delle Grazie
>> --
>>
>> 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,

Brett Delle Grazie
--

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] Latest Xcode install (4.3.x) and CMake error

2012-06-28 Thread Sean McBride
On Thu, 28 Jun 2012 09:16:31 -0400, Michael Jackson said:

> Error: No developer directory found at /Developer.  Run
> /usr/bin/xcode-select to update the developer directory path.

Hey Mike!

Maybe your xcode-select is still pointing to /Developer?  Try rerunning 
xcode-select to point it to /Applications/Xcode.app (or where ever).  It has a 
pretty good man page too BTW.

-- 

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com 
Mac Software Developer  Montréal, Québec, Canada


--

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] Latest Xcode install (4.3.x) and CMake error

2012-06-28 Thread Michael Jackson
I have the latest Xcode installed on a new Mac Laptop and I am trying to 
configure my project with CMake and generate Xcode projects but I am getting 
the following error:

CMake Error at /Applications/CMake 
2.8-8.app/Contents/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 
(MESSAGE):
 The C compiler "/usr/bin/gcc" is not able to compile a simple test program.

 It fails with the following output:

  Change Dir: 
/Users/svenkata/Desktop/Work/Tomography/TomoSoftware/HAADFSTEM/C-Code/eimtomo_Mike/Build/CMakeFiles/CMakeTmp



 Run Build Command:/Applications/CMake\ 2.8-8.app/Contents/bin/cmakexbuild
 -project CMAKE_TRY_COMPILE.xcodeproj build -target
 cmTryCompileExec2510098932 -configuration Debug

 Error: No developer directory found at /Developer.  Run
 /usr/bin/xcode-select to update the developer directory path.





 CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
 CMakeLists.txt:11 (project)


-- Configuring incomplete, errors occurred!


Is there anything special with this setup that I should know about?

Thanks
___
Mike JacksonPrincipal Software Engineer
BlueQuartz SoftwareDayton, Ohio
mike.jack...@bluequartz.net  www.bluequartz.net

--

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] Ninja fails, Make succeeds...

2012-06-28 Thread Mikael Lyngvig
I need the files to be copied at build time, not a compile time: They are
files I am editing and I need the build system to export the files to the
binary directory tree whenever they are changed.

I know it looks stupid and probably is as well :-)  The reason is that when
the project is being used by clients, I want them to include each file as
follows (something which I use myself):

#include "Braceless/Frontend/Scanner.hpp"

And the only way I could figure out to get it working was by naming the
build directory "Braceless" and then do that thing I'm doing.  The project
is organized like this:

   src/AST
   src/Driver
   src/Frontend
   ...

And I want to be able to write "Braceless" in front so that it works also
when the header files and libraries have been installed on a system.  In
the LLVM system, they solve this problem by storing the headers in another
location than the source files - something I deeply loathe as it makes it
very difficult to search for strings and even to edit a given source file
and its header at the same time.

I'll try out your comments, but I don't see any way of getting rid of that
../.. construct.  By the way, I am a CMake newbie so I just did what I
could do to make it work somehow.


Cheers,
Mikael

2012/6/27 Rolf Eike Beer 

> > Sigh, now I sent you the code from the wrong directory, but the code for
> > the "Backend" component is virtually identical.  I don't know how to use
> > functions with CMake, so I simply made a verbatim copy of the below code
> > in
> > each subfolder and edited it to match the subfolder.  So the Backend
> > project looks like this:
> >
> > project(Backend)
> >
> > set(PublicHeaders
> > "Backend.hpp"
> > "Context.hpp"
> > )
> > set(PublishedHeaders "")
> > foreach(Header IN LISTS PublicHeaders)
> > get_filename_component(HeaderFilename "${Header}" NAME)
> > set(Source "${CMAKE_CURRENT_SOURCE_DIR}/${Header}")
> > set(Output "${CMAKE_CURRENT_BINARY_DIR}/${HeaderFilename}")
> > list(APPEND PublishedHeaders "${Output}")
> > add_custom_command(
> > OUTPUT "${Output}"
> > COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${Source}"
> > "${Output}"
> > MAIN_DEPENDENCY "${Source}"
> > COMMENT "Publishing ${HeaderFilename}"
> > VERBATIM
> > )
>
> Why don't you simply use configure_file(... COPYONLY) here?
>
> > endforeach()
> > add_custom_target(
> > publish_backend_headers
> > ALL
> > DEPENDS ${PublishedHeaders}
> > SOURCES ${PublicHeaders}
> > )
> > include_directories("${CMAKE_BINARY_DIR}/../")
>
> This is almost certainly wrong. Guess my build dir is /tmp/foo, why on
> earth do you want to include /tmp? I could understand if it would be
> ${CMAKE_CURRENT_BINARY_DIR}/.. if you are in a subdirectory, but otherwise
> this is likely completely bogus.
>
> > include_directories("$ENV{LLVM}/include")
> >
> > add_definitions(-D__STDC_CONSTANT_MACROS)
> > add_definitions(-D__STDC_LIMIT_MACROS)
> >
> > add_library(Backend
> > "Backend.cpp"
> > )
> >
> > add_dependencies(Backend publish_backend_headers)
>
> I think you can avoid the whole add_custom_target/add_library by just
> writing
>
> add_library(Backend Backend.cpp ${PublishedHeaders})
>
> (Untested. May only reliably work if you use configure_file. ymmv).
>
> Eike
> --
>
> 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: inconsistent build of DLL on different computers.

2012-06-28 Thread Casper Madsen
Hi,

Using CMake and Visual Studio 2010exp to build DLLs for use in Wireshark we are 
seeing inconsistent results. On all our computers the build verdict is 
successful. Unfortunately it appears that the DLLs are broken when built on 
some computers - the DLLs can not be loaded.

 Tool setup 
CMake version: 2.8.7
Visual Studio Version: 2010 express,
Cygwin and Msys shells

I have compared the build output from a computer that builds working DLLs with 
the output from a build resulting in broken DLLs.

 The build output from the "corrupt" builds: 
Manifest:

  C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\mt.exe /nologo /verbose 
/out:"csr_log_proto_ws_1_2_0.dir\Debug\csr_log_proto_ws_1_2_0.dll.embed.manifest"
 /manifest 
csr_log_proto_ws_1_2_0.dir\Debug\csr_log_proto_ws_1_2_0.dll.intermediate.manifest

  All outputs are up-to-date.

LinkEmbedManifest:

  All outputs are up-to-date.
  csr_log_proto_ws_1_2_0.vcxproj -> 
S:\p4\synergy\frw\main\output\vs10\plugin\Debug\csr_log_proto_ws_1_2_0.dll

FinalizeBuildStatus:

  Deleting file 
"csr_log_proto_ws_1_2_0.dir\Debug\csr_log_proto_ws_1_2_0.unsuccessfulbuild".
  Touching 
"csr_log_proto_ws_1_2_0.dir\Debug\csr_log_proto_ws_1_2_0.lastbuildstate".


 The build output from the "functional" builds: 
Manifest:

  C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\mt.exe /nologo /verbose 
/out:"csr_log_proto_ws_1_2_0.dir\Debug\csr_log_proto_ws_1_2_0.dll.embed.manifest"
 /manifest 
csr_log_proto_ws_1_2_0.dir\Debug\csr_log_proto_ws_1_2_0.dll.intermediate.manifest

  C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\rc.exe /nologo 
/fo"csr_log_proto_ws_1_2_0.dir\Debug\csr_log_proto_ws_1_2_0.dll.embed.manifest.res"
 csr_log_proto_ws_1_2_0.dir\Debug\csr_log_proto_ws_1_2_0_manifest.rc

LinkEmbedManifest:

  C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\link.exe 
/ERRORREPORT:QUEUE 
/OUT:"S:\p4\synergy\frw\main\output\vs10\plugin\Debug\csr_log_proto_ws_1_2_0.dll"
 /INCREMENTAL /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib 
shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib 
"..\..\..\..\..\..\tools\wireshark\wireshark-win32-libs\glib\lib\glib-2.0.lib" 
"..\..\..\..\..\..\tools\wireshark\wireshark-1.2.0\epan\libwireshark.lib" 
/MANIFEST 
/ManifestFile:"csr_log_proto_ws_1_2_0.dir\Debug\csr_log_proto_ws_1_2_0.dll.intermediate.manifest"
 /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG 
/PDB:"S:\p4\synergy\frw\main\output\vs10\plugin\Debug\csr_log_proto_ws_1_2_0.pdb"
 /SUBSYSTEM:CONSOLE /STACK:"1000" /TLBID:1 /DYNAMICBASE /NXCOMPAT 
/IMPLIB:"S:/p4/synergy/frw/main/output/vs10/lib/Debug/csr_log_proto_ws_1_2_0.lib"
 /MACHINE:X86 /DLL 
csr_log_proto_ws_1_2_0.dir\Debug\csr_log_proto_ws_1_2_0.dll.embed.manifest.res

  "csr_log_proto_ws_1_2_0.dir\Debug\packet-utils.obj"
  csr_log_proto_ws_1_2_0.dir\Debug\csr_proto_plugin.obj
  "csr_log_proto_ws_1_2_0.dir\Debug\packet-bccmd.obj"
  "csr_log_proto_ws_1_2_0.dir\Debug\packet-bcsp-slip.obj"
  "csr_log_proto_ws_1_2_0.dir\Debug\packet-bcsp.obj"
  "csr_log_proto_ws_1_2_0.dir\Debug\packet-hqcmd.obj"  /machine:X86 /debug

 Creating library 
S:/p4/synergy/frw/main/output/vs10/lib/Debug/csr_log_proto_ws_1_2_0.lib and 
object S:/p4/synergy/frw/main/output/vs10/lib/Debug/csr_log_proto_ws_1_2_0.exp

  csr_log_proto_ws_1_2_0.vcxproj -> 
S:\p4\synergy\frw\main\output\vs10\plugin\Debug\csr_log_proto_ws_1_2_0.dll

FinalizeBuildStatus:

  Deleting file 
"csr_log_proto_ws_1_2_0.dir\Debug\csr_log_proto_ws_1_2_0.unsuccessfulbuild".

  Touching 
"csr_log_proto_ws_1_2_0.dir\Debug\csr_log_proto_ws_1_2_0.lastbuildstate".


 Steps performed on both computers 

-  Checkout source from our source control server

-  Create a new (empty) output directory

-  Generate a build system (cmake -G "Visual Studio 10" )

-  Build code (cmake -build .)

Considering that I am performing a completely clean build I am a bit puzzled 
that the "corrupt" builds reach the conclusion that some part of the build is 
"up-to-date" in the "manifest" and "LinkEmbedManifest" stages.
We have tried to force a no-parallel build by specifying maxcpucount=1 to VS, 
but the "corrupt" build still reach the conclusion that some parts are 
up-to-date and there for skips the resource compiler.

I see the same result building from command line and when building from the 
IDE. The "corrupt" computer can however produce working DLL's if the 
configuration is set to "Release" instead of "Debug" (currently "debug" is our 
default configuration)

Currently I have "functional" builds from two different computers and "corrupt" 
builds from 2 other computers. It should be noted that the two "corrupt" 
computers can produce functional DLLs with VS2008.

Am I doing something wrong? Is there something that I need to give special 
attention when building DLL's with the CMake + VS2010 combination? Is there a 
CMake option to force the environment to be completely clean during the build 
process?

Re: [CMake] Can we control component package name in 2.8.8?

2012-06-28 Thread Eric Noulard
2012/6/28 hce :
>
> m.hergarden wrote
>>
>> The unspecified may come from an Install statement that does not have a
>> component specified.
>>
>> Micha
>>
>
> I actually double checked, there are only two install statements which all
> have component specified.  Could it be the bug?

Yes it could but did you start over from a pristine build tree?

Could you try:
$ find . -name "cmake_install.cmake"  -exec grep -Hn "Unspecified" {}
\;vi ./Source/kwsys/cmake_install.cmake

and see if any "cmake_install.cmake" file is containing teh handling
of "Unspecified" ?

Whatever the result you can always specify the CPACK_COMPONENTS_ALL
yourself in the CMakeListst.txt (before including CPack)  and not let
CPack set it on his own:

So you can:
set(CPACK_COMPONENTS_ALL yourcomp1 yourcomp2)
...
include(CPack)

and CPack (when used in component mode) will only install the
specified components


-- 
Erk
Le gouvernement représentatif n'est pas la démocratie --
http://www.le-message.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


Re: [CMake] Can we control component package name in 2.8.8?

2012-06-28 Thread hce

m.hergarden wrote
> 
> The unspecified may come from an Install statement that does not have a 
> component specified.
> 
> Micha
> 

I actually double checked, there are only two install statements which all
have component specified.  Could it be the bug?

Thank you.

Jupiter


--
View this message in context: 
http://cmake.3232098.n2.nabble.com/Can-we-control-component-package-name-in-2-8-8-tp7580641p7580677.html
Sent from the CMake mailing list archive at Nabble.com.
--

Powered by www.kitware.com

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

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

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


Re: [CMake] CPack and NSIS failure

2012-06-28 Thread Eric Noulard
2012/6/27 David Demelier :
>
> Thanks for your help, it worked!
>
> Now, the last problem, I noticed that CPACK_PACKAGE_EXECUTABLES you
> can't set an icon, thus I used my own CreateShortCut and Delete with
> respectively CPACK_NSIS_CREATE_ICONS_EXTRA and
> CPACK_NSIS_DELETE_ICONS_EXTRA. The first one works, but not the
> second.
>
>        set(CPACK_NSIS_CREATE_ICONS_EXTRA "CreateShortCut                      
>  
>            '$SMPROGRAMS$STARTMENU_FOLDER${PROJECT_NAME}.lnk'          
>  
>            '$INSTDIRsd-tris.exe'                                          
>  
>            ''                                                                 
>  
>            '${ICONPATH}'"
>        )
>        set(CPACK_NSIS_DELETE_ICONS_EXTRA "Delete                              
>  
>            '$SMPROGRAMS$STARTMENU_FOLDER${PROJECT_NAME}.lnk'"
>        )
>
> When uninstalling, the window menu entry is still there and not
> removed at all. But the project.nsi has the line
>
> Delete                          \
>            '$SMPROGRAMS\$STARTMENU_FOLDER\sd-tris.lnk'
>
> But this command is not executed by the Uninstall.exe.

Looks like an NSIS script error.
Would you be able to create a working project.nsi (starting wiht the
one generated by CPack)
and tell us what could make the generated one work?



-- 
Erk
Le gouvernement représentatif n'est pas la démocratie --
http://www.le-message.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


Re: [CMake] Supplying different debug flags during compile and link stages for libraries and executables

2012-06-28 Thread Petr Kmoch
Hi Brett,

as far as I know, compilation flags come from
CMAKE__FLAGS_, while linker flags come from
CMAKE_{SHARED|EXE}_LINKER_FLAGS[_]. So you should be able to
override CMAKE_SHARED_LINKER_FLAGS_Debug (not sure with correct case
for configuration name) and remove -g from there.

Petr

On Wed, Jun 27, 2012 at 10:36 PM, Brett Delle Grazie
 wrote:
> Hi,
>
> On AIX using the XLC compiler I've determined the debug flag (-g)
> should be used for all compile stages but should only be supplied to
> the final
> link stage of an executable (not a library target), otherwise
> duplicate symbol errors result.
> For reference see:
> http://www.ibm.com/developerworks/forums/thread.jspa?threadID=438591&tstart=0
>
> Is there an easy way of supplying a different set of debug flags for
> the compile stage as opposed to the link stage?
>
> I could potentially override:
> CMAKE_C_FLAGS_DEBUG_INIT
> CMAKE_CXX_FLAGS_DEBUG_INIT
>
> but I can't really see where these are combined into the compile / link rules.
>
> Does anyone have any suggestions? Any guidance / help is appreciated.
>
> Thanks,
>
> --
> Best Regards,
>
> Brett Delle Grazie
> --
>
> 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