Re: [CMake] Accessing Variables from within a *.cmake file

2012-02-23 Thread John Drescher
On Thu, Feb 23, 2012 at 10:39 AM, Hashim Mir  wrote:
> Hi,
>
>
> I am trying to control the flow of my program based on the value of a cmake
> variable called CMAKE_SIZEOF_VOID_P.
>
>
>
> To start off, I wanted to just see what value this variable took under
> multiple different configurations, by issuing the following command in my
> cmakelists.txt file:
>
>
>
> message(${CMAKE_SIZEOF_VOID_P})
>
>
>
> This works perfectly. However, whenever I try to run the above command on my
> *.cmake file, I get no value returned to me (it just throws an error).
>

Is there a PROJECT()

before you include your .cmake

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] passing arguments to the final make

2012-02-22 Thread John Drescher
> And another thing, is it actually \${SCRIPT} a portable solution that works
> on all the generators?
>

This is not about generators but about what shell you are running
cmake from. For example that would not work on windows since the
command prompt has a different syntax for variables.

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] Shared intermediary files

2012-02-21 Thread John Drescher
On Mon, Feb 20, 2012 at 4:07 PM, Kevin Schmidt  wrote:
> Hello,
>
>   I’m in the process of converting over a large, monolithic tree with many
> libraries from a custom build solution over to cmake.  So far, we’ve loved
> it.  I am wondering about others’ solutions to a problem we have
> encountered.
>
>
>
> We have more than a few cases of generated source files - for example, Qt
> moc files.   These all get dumped into CMAKE_CURRENT_BINARY_DIR.  Now, the
> libraries we have build both static & shared, and have the same source
> files.  In Visual Studio, this generates two projects in the solution.  It
> seems that these do not share dependencies.  Occasionally, this means that
> both libraries try to write to the generated source file at the same time,
> which generates a (false) build failure.
>
>
>
> What do others do?  Am I misunderstanding something?
>

I have my batch build script that calls cmake --build for each
configuration build 2 times. This works for almost all cases. However
when building VTK in parallel the generation of 1 unicode header
usually fails.

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] Cmake hangs on testing -- Check for working C compiler using: Visual Studio 10

2012-02-18 Thread John Drescher
On Sat, Feb 18, 2012 at 11:23 PM, Nicky Perian  wrote:
> Applied 5 additional microsoft updates related to sp1 and seems to by
> working. Need to follow my own advice and apply updates to exhaustion.

I do have Microsoft Update running on all machines that I use CMake/VS
2010 and all of them are kept up to date.

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] Cmake hangs on testing -- Check for working C compiler using: Visual Studio 10

2012-02-18 Thread John Drescher
> Now I don't know what is happening. This is no longer working. Back to
> hanging up.
>

I have never had this hang and I use visual studio 2010 SP1 daily for
over a year with cmake. Now I am on cmake-2.8.7 however I have used
probably every other 2.8 release as well.

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] Generating CMake scripts from Visual Studio solutions & projects?

2012-02-18 Thread John Drescher
> "2+ years"? That could easily end up like a Yugo vs. Porsche surprise ;)
>
>
> The original vcproj2cmake script was composed of 300 lines,
> and now the project is to the tune of around 4000 lines.
>

I have a lot of 5 to 15 year old MFC code(applications, dlls, static
libraries) that I would like to use this on. I could give it a test
sometime next week.

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] Generating CMake scripts from Visual Studio solutions & projects?

2012-02-17 Thread John Drescher
> Did you try the tool listed in the Wiki
> http://www.cmake.org/Wiki/CMake#Visual_Studio
>

I would be interested in if you get any of these to work well with non
trivial projects. When I last looked at some of these (probably 2+
years ago so things may have changed) they did not work well with my
complex visual studio projects.

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] Doesn't anyone know how to get precompiled headers working under CMake for Visual Studio 2010?

2012-02-16 Thread John Drescher
On Thu, Feb 16, 2012 at 7:39 PM,   wrote:
> My team has been using precompiled headers under CMake and Visual Studio
> 2008 for quite a while.  Now we’ve switched to VS 2010,  the cmake code we
> used to support precompiled headers is no longer working.
>
>
>
> The following is the code in question and we’re just using
> set_source_files_properties to add the appropreiate /Yc , /Yu and /FI flags.
>
>
>
> It appears, under VS 2010, the property manager is not accepting or over
> writing these settings.
>
>
>
> Doesn’t anyone know how to get precompiled headers working under CMake for
> Visual Studio 2010?
>
>
>
>
>
>
>
>
>
> IF(EXISTS ${pch_unity})
>
>    FILE(READ ${pch_unity} buffer)
>
> ENDIF(EXISTS ${pch_unity})
>
> IF(NOT (${buffer} STREQUAL ${file_contents}))
>
>    FILE(WRITE ${pch_unity} ${file_contents})
>
> ENDIF(NOT (${buffer} STREQUAL ${file_contents}))
>
> SET_SOURCE_FILES_PROPERTIES(${pch_unity}  PROPERTIES COMPILE_FLAGS
> "/Yc\"${pch_abs}\"")
>
>
>
> ###
>
> #
>
> # Update properties of source files to use the precompiled header.
>
> # Additionally, force the inclusion of the precompiled header at beginning
> of each source file.
>
> #
>
> FOREACH(source_file ${srcFilesThatUsePCH} )
>
>    SET_SOURCE_FILES_PROPERTIES(
>
>  ${source_file}
>
>  PROPERTIES COMPILE_FLAGS
>
>  "/Yu\"${pch_abs}\" /FI\"${pch_abs}\""
>
>    )
>
> ENDFOREACH(source_file)
>
>
>
> ###
>
> #
>
> # Finally, update the source file collection to contain the precompiled
> header translation unit
>
> #
>
> SET(${FILES_VARIABLE_NAME} ${${FILES_VARIABLE_NAME}} ${pch_unity}
> PARENT_SCOPE)
>
>

For me I use the same exact macro that I have used since VS 2005.

Attached is the macro and here is an example library that uses the macro.

SET( ${PROJECT_NAME}_SRCS
./src/smException.cxx
./src/smitkIndent.cxx
./src/smState.cxx
./src/smPropertyMap.cxx
./src/smOperation.cxx
./src/smPgmSettings.cxx
./src/smStringList.cxx
./src/smObject.cxx
./src/smAppBase.cxx
./src/smSpawnJob.cxx
./src/smLog.cxx
./src/smBIRADS7.cxx
./src/smErrorBase.cxx
)

SET( ${PROJECT_NAME}_EXT_HDRS
./Include/smException.h
./Include/smitkIndent.h
./Include/smMacros.h
./Include/smPropertyMap.h
./Include/smOperation.h
./Include/smPgmSettings.h
./Include/smStringList.h
./Include/smConstants.h
./Include/smLog.h
./Include/smBIRADS7.h
./Include/smErrorBase.h
)

SET( ${PROJECT_NAME}_MOC_HDRS
./Include/smState.h
./Include/smObject.h
./Include/smAppBase.h
./Include/smSpawnJob.h
)

# some .ui files
SET( ${PROJECT_NAME}_UIS
)

# and finally an resource file
SET( ${PROJECT_NAME}_RCS
)

SET( ${PROJECT_NAME}_INT_HDRS

)

#Add precompiled header support
MSVC_PCH_SUPPORT(${PROJECT_NAME})

# this command will generate rules that will run rcc on all files from
UPMC_LA_RCS
# in result UPMC_LA_RC_SRCS variable will contain paths to files produced by rcc
QT4_ADD_RESOURCES( ${PROJECT_NAME}_RC_SRCS ${${PROJECT_NAME}_RCS} )

# and finally this will run moc:
QT4_WRAP_CPP( ${PROJECT_NAME}_MOC_SRCS ${${PROJECT_NAME}_MOC_HDRS} )

# this will run uic on .ui files:
QT4_WRAP_UI( ${PROJECT_NAME}_UI_HDRS ${${PROJECT_NAME}_UIS} )

IF(BUILD_EXPERIMENTAL)
add_subdirectory(Experimental)
ENDIF(BUILD_EXPERIMENTAL)

include_directories(
${PROJECT_BINARY_DIR}
${PROJECT_BINARY_DIR}/..
${PROJECT_SOURCE_DIR}/Include
${STUDY_MANAGER_SRC}/Include
)

add_library(${PROJECT_NAME}
${${PROJECT_NAME}_SRCS}
${${PROJECT_NAME}_EXT_HDRS}
${${PROJECT_NAME}_MOC_HDRS}
${${PROJECT_NAME}_MOC_SRCS}
${${PROJECT_NAME}_INT_HDRS}
${${PROJECT_NAME}_UI_HDRS}
${${PROJECT_NAME}_RC_SRCS}
)

John


MSVCPCHSupport.cmake
Description: Binary 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] On WINDOWS, Is it Possible to build 64-bit and 32-bit Solutions in One Go?

2012-02-16 Thread John Drescher
On Thu, Feb 16, 2012 at 3:27 PM, John Drescher  wrote:
> On Thu, Feb 16, 2012 at 2:54 PM, Hashim Mir  wrote:
>> Hi,
>>
>>
>>
>> This is what I am doing presently in order to compile both a 32-bit and a
>> 64-bit version of my project:
>>
>>
>>
>> cmake.exe -G “Visual Studio 9 2008” #for x32
>>
>> cmake.exe -G “Visual Studio 9 2008 Win64”   #for x64
>>
>>
>>
>> Is it possible to consolidate the two individual statements into one
>> somehow, in order to compile both 32 and 64 bit configurations of my project
>> files with one command?
>>
>
> No. CMake does not allow this. Only 1 generator can exist for a solution.
>
And I mean in the same build folder tree. You can however make 2 build
folder trees and use a batch file to have both build separately at the
same time from the command prompt.

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] On WINDOWS, Is it Possible to build 64-bit and 32-bit Solutions in One Go?

2012-02-16 Thread John Drescher
On Thu, Feb 16, 2012 at 2:54 PM, Hashim Mir  wrote:
> Hi,
>
>
>
> This is what I am doing presently in order to compile both a 32-bit and a
> 64-bit version of my project:
>
>
>
> cmake.exe -G “Visual Studio 9 2008” #for x32
>
> cmake.exe -G “Visual Studio 9 2008 Win64”   #for x64
>
>
>
> Is it possible to consolidate the two individual statements into one
> somehow, in order to compile both 32 and 64 bit configurations of my project
> files with one command?
>

No. CMake does not allow this. Only 1 generator can exist for a solution.

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] What can cause cmake (2.8.4 and 7) to fail after upgrade of Visual Studio 10 Express to Professional? stackoverflow question. posting here

2012-02-13 Thread John Drescher
On Mon, Feb 13, 2012 at 12:15 AM, Nicky Perian  wrote:
>
> Solved by uninstalling all versions of Visual Studio and reinstalling Visual 
> Studio 10 Professional.
>


Although I have no idea why you had this problem, I have 5 versions of
Visual Studio installed and I use cmake 2.8.7 with 3 of them without
this issue.


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


[CMake] Fwd: Portable revision lookup?

2012-02-02 Thread John Drescher
-- Forwarded message --
From: John Drescher 
Date: Thu, Feb 2, 2012 at 4:36 PM
Subject: Re: [CMake] Portable revision lookup?
To: Oliver kfsone Smith 


On Thu, Feb 2, 2012 at 4:10 PM, Oliver kfsone Smith  wrote:
> Right now I wrap my Linux-based build process with a script that features
> the line
>
> REVISION=`svn info ${SRC_PATH} | awk '/^Revision/ { print $2 }'`
>
> Which is neither OS or VCS portable.
>
> I'm trying to put together a CPack configuration to make the builds, and I'd
> like to name the resulting installer for the revision it was built from.
>
> Is there any kind of built-in mechanism I can use for this, or would I be
> best just using IFs and executing os-specific commands? (I'm not quite sure
> how I'm going to pluck the info out under Windows)
>
> I'm also wondering if there is a way to query other repository attributes -
> specifically the URL - I'd like to build installers named
>
>     ...
>
> e.g.
>
>     my-client.baseline.57721.deb
> or
>     my-server.branches.1.35.57804.tbz2
>
> Any pointers?
>

Cmake has support for pulling the svn and I believe git revs using
cmake modules. Here is what I do for svn

#-
# If subversion is found append the svn rev to the patch version.
#
FIND_PACKAGE(Subversion)
IF(Subversion_FOUND)
       OPTION(SVN_APPEND_REV "Append subversion rev to application version" ON)
       IF(SVN_APPEND_REV)
               Subversion_WC_INFO(${PROJECT_SOURCE_DIR} Project)
               MESSAGE("Current revision is ${Project_WC_REVISION}")

               OPTION(SVN_GET_LOG "Get the SVN LOG" OFF)
               if(SVN_GET_LOG)
                       Subversion_WC_LOG(${PROJECT_SOURCE_DIR} Project)
                       MESSAGE("Last changed log is
${Project_LAST_CHANGED_LOG}")
               endif(SVN_GET_LOG)

               set (${PROJECT_NAME}_VERSION_PATCH
${${PROJECT_NAME}_VERSION_PATCH}.${Project_WC_REVISION})
       ENDIF(SVN_APPEND_REV)

ENDIF(Subversion_FOUND)

John


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


Re: [CMake] CMAKE 2.8.5 - CMAKE_GENERATOR Bug?

2012-02-02 Thread John Drescher
On Thu, Feb 2, 2012 at 12:33 PM, Sarnath K - ERS, HCLTech
 wrote:
> All,
>
>
>
> I was trying to use the external project add feature to add a 32-bit VC++
> project on a 64-bit parent build system.
>
> However, I ran into problems while compiling the 32-bit project.
>
> “devenv” used to complain “invalid solution configuration”
>
> I tried to explicitly set “CMAKE_BUILD_TYPE” using –D option as well as in
> the CMakeLists.txt.
> Nothing changed.
>
>
>
> However, when I enabled “CMAKE_VERBOSE_MAKEFILE”, I found that “CMAKE” was
> “not” passing the –G option correctly.
>
> Instead of passing , cmake was actually
> configuring the project as 
>
> (Note that –G is inside the double-quote)
>
>
>
> When I isolate the build-step and build it manually using the correct
> syntax, everything works flawlessly.
>
>
>
> Specifying the generator via “CMAKE_ARGS” helps me compile. But CMAKE still
> appends the faulty –G syntax and
>
> hence is not producing the intended results for me.
>
>
>
> If this is indeed a bug, can some one tell me:
>
> 1.    What is the temporary workaround for this?
>
> 2.    If at all fixed, how long will it take the build to come out?
>

I am not seeing this breakage. However you are 2 versions behind in cmake.

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] 'Parallel' CMakeLists.txt?

2012-01-31 Thread John Drescher
> This sounds like a job for distributed version control.  In Git you
> could keep a branch with your CMakeLists.txt changes and keep merging
> from the main branch to keep up with the other changes.
>

That is basically what I do when I make changes that I know will break
the build. I create a new branch in subversion and work from there
till I know it works and then merge the changes back to the trunk.

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] Visual Studio 2010 is crashing when building project

2012-01-26 Thread John Drescher
> Is it normal for the C++ project icon in the solution explorer to look like
> "web projects"? I see a globe around angle brackets < > in the small icon.
>
No. I do not see that at all ever.


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] Visual Studio 2010 is crashing when building project

2012-01-26 Thread John Drescher
>> I am using CMake 2.8.7 and generating for VS2010. When I build any
>> project, visual studio crashes. I think it might be because of ZERO_CHECK.
>>

I have not seen any Visual Studio 2010 crashes from cmake based
projects and I have used VS2010 for over 1 year on 5 to 10 machines
mostly in x64. I am using SP1 however since there is an optimization
bug in the retail version that causes Qt applications (designer ..) to
crash when compiled with Visual Studio 2010. With SP1 this crash goes
away.

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] compiler flags visual studio

2012-01-24 Thread John Drescher
On Tue, Jan 24, 2012 at 8:33 AM, Tom Deblauwe  wrote:
> Hello,
>
> What compiler flags do you need to enable if you want to use the possibility
> to have something like this in your code:
>
> char Image[width(), height()];
>
> This worked before with my compiler(visual studio 2005) but not with the
> cmake generated project. It complains about expecting a constant expression.
> Anybody knows?
>

No compiler flags support that.

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


[CMake] Fwd: building libs and specifying addition folders

2012-01-18 Thread John Drescher
-- Forwarded message --
From: John Drescher 
Date: Thu, Jan 19, 2012 at 1:00 AM
Subject: Re: [CMake] building libs and specifying addition folders
To: Dev Guy 


On Wed, Jan 18, 2012 at 10:57 PM, Dev Guy  wrote:
> Hi,
>
> I am relatively new to CMake and I've read the tutorial. However I
> have a few questions.
>
> 1. How can I declare a CMakeLists file to create a project to build a
> DLL or static lib ? I assume if I build a DLL on windows, it will
> build as a shared lib on Linux

put SHARED in the add_library statement

For more info than that type the following from a command prompt or shell:

cmake --help-command add_library

>
> 2. If my main source folder has 2 sub-folders, one that only includes
> header files call is Include and another folder that contains source
> files call it Utils. How do I add declare them to my CMakeLists files
> so that both the header and addition source files are found and and
> compiled in the main source folder to build the final binary.
>

add_subdirectory

Again for help:
cmake --help-command add_subdirectory


John


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


Re: [CMake] How to add CMake includes and libraries to Visual Studio Solution?

2012-01-16 Thread John Drescher
On Mon, Jan 16, 2012 at 2:44 PM,   wrote:
> Hmm this is strange, INCLUDE_DIRECTORIES is used but no effect.
> I try to set:
>
>  INCLUDE_DIRECTORIES("C:/binrev/development/boost/1.47/")
>
> But the additional directory entry of my MSVC solution holds only
> the default settings:
>
> $(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)\include;
>
> Is there any chance that i could check if INCLUDE_DIRECORIES is
> set correctly by CMake? Maybe the settings are truncated by visual
> studio ..
>

Is the project being regenerated and reloaded after the change?

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


Re: [CMake] How to add CMake includes and libraries to Visual Studio Solution?

2012-01-16 Thread John Drescher
On Mon, Jan 16, 2012 at 1:15 PM, J Decker  wrote:
> On Mon, Jan 16, 2012 at 10:08 AM, Rolf Eike Beer  wrote:
>> J Decker wrote:
>>> I just use
>>> include_directories( ... )
>>
>> This is right.
>>
>>> LINK_DIRECTORIES( ...} )
>>
>> This is almost surely wrong. LINK_DIRECTORIES is only needed for very seldom
>> special cases and only causes headache in all other cases.
>
> oh, what's the preferred method to specify the directory where the
> library is then?
>

I believe the full path on the target_link_libraries.

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] How to add CMake includes and libraries to Visual Studio Solution?

2012-01-16 Thread John Drescher
> Where did you define your INCLUDE_DIRECTORIES? I also tried to set an absolute
> path instead of using the CMake list, same result. Nothing is set...

For me this works as well. Define  INCLUDE_DIRECTORIES anywhere above
the ADD_EXECUTABLE or ADD_LIBRARY and visual studio will use it.

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


Re: [CMake] Copying of 3rd party DLLs in a POST-BUILD step

2012-01-10 Thread John Drescher
On Tue, Jan 10, 2012 at 3:17 PM, Ben Medina  wrote:
> I'd guess the performance of fixup_bundle will be a big pitfall if
> you're planning on doing this after every build.
>

One other approach is not making it a post build step but a custom
target that the user can build only when needed. This custom build
step will copy the dlls like the post build step did.

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] MSBuild and automatic project file regenation

2012-01-09 Thread John Drescher
On Mon, Jan 9, 2012 at 1:56 PM, Óscar Fuentes  wrote:
> Michael Hertling 
> writes:
>
>> On 01/09/2012 02:34 PM, David Cole wrote:
>>> No trick, but to avoid this, perhaps we should change the "--build"
>>> handler to run the cmake configure & generate step before calling out
>>> to MSBuild. You can easily do this yourself from the command line by
>>> adopting the pattern:
>>>
>>>   cmake . && cmake --build . --config Release
>
> Fortunately my cmake scripts are simple enough so the extra invocation
> does not add much to the build.
>
> Thanks David.
>
>>> This is a good idea for a feature request. Not sure if we should just
>>> always do that by default and provide a way to turn off with a
>>> "--no-regenerate", or vice-versa with a "--please-generate-first" ...
>>> :-)
>
> The effect of --no-regenerate would be the same as the current buggy
> behavior (MSBuild.exe uses outdated project files). IMHO the
> --please-generate-first is the right thing.
>

One problem I have with doing this automatically in the --build
command is I run in parallel builds for each configuration (using a
program called RunJobs from codeproject.com):

cmake --build X:/64Bit/VC.100/Qt/StudyManager --config RelWithDebInfo
cmake --build X:/64Bit/VC.100/Qt/StudyManager --config Release
cmake --build X:/64Bit/VC.100/Qt/StudyManager --config Debug

for this I do the
cmake X:/64Bit/VC.100/Qt/StudyManager

step first then run the parallel jobs. I worry if --build forced a
configure that parallel building like this could break.

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] Copying of 3rd party DLLs in a POST-BUILD step

2012-01-09 Thread John Drescher
> Awesome! Sometimes you just need to know what's already available to solve 
> your problems in a very elegant way. I'll have a look at these bundles and 
> probably switch to them instead of maintaining my own stuff!
>

Same here. I have spent a few hours writing scripts that keep a list
of necessary dlls. This approach is much cleaner.



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] Copying of 3rd party DLLs in a POST-BUILD step

2012-01-09 Thread John Drescher
2012/1/9 Hauke Heibel :
> Hi Michael,
>
> What I do is running a custom command which itself executes a CMake
> script. Usually similar to
>
> add_custom_command(TARGET CopyDlls
>  COMMAND ${CMAKE_COMMAND}
>        -DMSVC_BUILD_CONFIG_DIR=${CMAKE_CFG_INTDIR}
>        -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
>        -P "/yourCopyDlls.cmake"
>  VERBATIM
> )
>
> In the "yourCopyDlls.cmake", you can GLOB your DLLs with or without
> the "d" postfix depending on MSVC_BUILD_CONFIG_DIR. You can now even
> copy additional files such as e.g. PDB files.
>

Thanks for sharing this. I use cmake generate a batch file (using
FILE(append ...) ) that calls cmake -E copy_if_different for each
file. then add this as a custom target however your method looks much
cleaner..


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] Some issues with visual studio

2012-01-08 Thread John Drescher
On Sun, Jan 8, 2012 at 10:30 AM, Mateusz Loskot  wrote:
> On 8 January 2012 15:21, Renato Utsch  wrote:
>> Yes, but I want to be able to change with CMake, but if I can't do
>> that, at least I want to be able to set the default to the Release
>> version :X
>
> You have to understand there is difference between generators like
> makefiles and generators for projects for IDEs which allow to switch
> between build configurations from within IDE, like Visual Studio does.
>
> IMHO, CMAKE_BUILD_TYPE is irrelevant for IDEs like Visual Studio
> and valid workflow is equivalent to this:
>
> cmake -G "Visual Studio 2010"
> msbuild myproj.sln /p:Configuration=Debug
>
> or
>
> load myproj.sln in VS IDE and change configuration there.
>
> Obviously, for makefiles, CMAKE_BUILD_TYPE is the way to go.
>

An alternate way is

cmake --build myprojectsbuildfolder --config myconfiguration

for example:

cmake --build X:/64bit/VC.100/Qt/StudyManager --config Debug

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] Visual Studio Generator: Unable to show property page for custom build tool

2012-01-04 Thread John Drescher
On Wed, Jan 4, 2012 at 4:30 PM, Michael Guerrero  wrote:
> Hi, I’ve been experimenting with using Visual Studio’s “Custom Build Tool”
> per cpp file to perform some specialized operations.  However, the property
> page is not visible (not editable) when I generate a project with cmake.  To
> see what this looks like, see here:
> http://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/496e301c-de2e-49bf-bbfa-ea8de335a0a5
> .
>
> To reproduce:
> 1) Generate a c++ project for visual studio (I’m using vs2010)
> 2) Right click a .cpp file in the solution and go to properties
> 3) Under Configuration Properties/General, change “Item Type” to “Custom
> Build Tool”
> 4) Click Apply
> 5) Select Configuration Properties / Custom Build Tool / General
>
> I’ve attempted to hand edit the solution and project files to determine what
> is causing this but nothing I removed seemed to have any affect.
>
> Any ideas on how to fix this or where to look?
>

A little off topic but even if this worked won't all settings you make
get overwritten when CMake regenerates your project or are these
stored in .user files or something else that CMake does not touch?

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] CPack - Windows 7 x64

2012-01-03 Thread John Drescher
On Tue, Jan 3, 2012 at 8:05 PM, Nicholas Yue  wrote:
> Hi,
>
>    I am building and installing full 64bit applications and libraries.
>
>    When I package it up as an installer via NSIS, it installs to "C:\Program
> Files (x86)\"
>
>    What CPACK_ variables do I need to inform cpack that it should be
> installed in "C:\Program Files\"
>


I have had this problem for over a year (with CMake versions up to
2.8.7) although I have not spent much effort trying to fix it.
Tomorrow I will try the fix from David and report if that fixes the
issue for me.

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] configuration of VTK 5.8 using cmake 2.6 on 64-bit windows 7

2011-12-08 Thread John Drescher
On Thu, Dec 8, 2011 at 10:51 PM, rakesh patil  wrote:
> Hello,
>
> I want to compile VTK 5.8 for 64bit windows machine. I have cmake 2.6 for
> 32-bit windows. I downloaded vtk source code from www.vtk.org website. While
> configuring, I select Visual Studio 9(64) and continued configuration. Then
> I made following changes
>
> CMAKE_CXX_FLAGS = /D_WIN64 /D_WINDOWS (Default was /DWIN32 /D_WINDOWS)
> CMAKE_C_FLAGS = /D_WIN64 /D_WINDOWS (Default was /DWIN32 /D_WINDOWS)
> CMAKE_INSTALL_PREFIX = Appropriate path where lib, header and dll files will
> be saved
> VTK_DATA_ROOT = Path where vtk data resides.
>
> Now what i want to ask is that
> 1) Is it perfectly fine to use 32-bit version of cmake to compile 64bit
> version of VTK?

Yes. I have done that dozens of times.

> 2) What effect will it be if WIN32 is replaced with _WIN64 in flags above?
>

I can't answer that. I have never ever set _WIN64 for any of my 64 bit
builds and I have been programming in 64 bit Visual Studio with cmake
for over 2 years.

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] parallel build using "cmake --build"?

2011-11-26 Thread John Drescher
On Fri, Nov 25, 2011 at 10:16 PM, Steve M. Robbins  wrote:
> Hi,
>
> To build VTK on our windows build server, I wrote a small batch script
> that invokes "cmake --build".
>
> My developer machine is multicore; is there a way to get "cmake --build"
> to run multiple jobs?
>

On windows, I use the following tool

http://www.codeproject.com/KB/cpp/runjobs.aspx

to build each configuration (Debug, Release, RelWithDebInfo ...) in
parallel using separate calls to cmake --build.

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] VS2005 and cmake

2011-11-25 Thread John Drescher
On Fri, Nov 25, 2011 at 3:55 AM, Tom Deblauwe  wrote:
> Hello,
>
> Are you sure that is not some kind of extension or plugin that you are
> using?
> I don't think you can reload all the projects at once in VS2005?
> Best regards,
> Tom,
>

CMake installs a visual studio macro that handles this. When there is
a large change the macro should pop up in the GUI asking you ( I
believe) if you want to continue building or cancel. In either case it
should reload all projects. In the 3 to 4 years I have used CMake with
visual studio (2005 and 2008) I have sometimes seen this fail and
Visual Studio would prompt for reloading.

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] Don't export symbols but the one I want

2011-11-23 Thread John Drescher
On Wed, Nov 23, 2011 at 12:30 PM, Stephen Kelly  wrote:
> David Demelier wrote:
>
>> Hello,
>>
>> I'm creating a library that use a lot of internal code (not static
>> because it should be visible by other compilation units) so I would like
>> to don't export any symbols but only the one I want.
>>
>> Usually you use __declspec(dllexport) for windows but on unix and gcc
>> everything is exported and I don't know any portable way to disable this.
>>
>> Does CMake can handle this problem and export some symbols without using
>> ten thousand of #ifdef #endif in C files?
>>
>> Cheers,
>>
>
> See also cmake --help-command GenerateExportHeader in cmake 2.8.6.
>
>
jmd0 work # cmake --help-command GenerateExportHeader
cmake version 2.8.6
Argument "generateexportheader" to --help-command is not a CMake
command.  Use --help-command-list to see all commands.


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] Call to QTextStream(stdin) crashes the program built by CMake and Visual Studio

2011-11-23 Thread John Drescher
On Wed, Nov 23, 2011 at 8:53 AM, Yegor Derevenets
 wrote:
> Hi All,
>
> The following Qt program crashes with access violation when being built
> on Windows by Microsoft Visual Studio 2010 using cmake 2.8.6 and doesn't
> crash when being built using qmake:
>
> #include 
> #include 
>
> int main(int argc, char *argv[]) {
>    QTextStream qin(stdin, QIODevice::ReadOnly);
>
>    return 0;
> }
>
> Expected behaviour would be that the program wouldn't crash in both cases.
>
> The example and generated configuration files are available in the archive:
> http://yegor.f1recat.com/cmake_vs_qmake.7z
>
> The Qt version used is 4.7.4. Arguments to configure were:
> -release -shared -no-webkit -nomake examples -nomake demos
>
> The problem seems to be remotely similar to this one (although in my case
> nobody must be trying to do static linking):
> https://bugreports.qt.nokia.com//browse/QTBUG-9272
>
> Any ideas on what to look at next?
>
Is there some other version of Qt installed on your system? Are you
running release mode for your application? Remember debug mode for
your application can will crash since you did not create a debug build
of Qt and Microsoft debug and release configurations are not
compatible.

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] VC2010 Express crashing

2011-11-21 Thread John Drescher
> Yes it is 100% reproducible.
> I don't know if telling someone to send reports to Microsoft and have them
> fix the problem is the most reasonable solution.
>

Isn't it a Microsoft bug? I mean even if the sln file was somehow
wrong Visual Studio should not crash when using it.

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] Workflow of a collaborative project in Visual Studio+CMake

2011-11-12 Thread John Drescher
On Sat, Nov 12, 2011 at 11:08 AM, Bill Hoffman  wrote:
> On 11/12/2011 10:51 AM, John Drescher wrote:
>>>
>>> It basically comes down to the inconvenience of having to do that with
>>> Visual Studio being outweighed (considerably!) by the cross-platform
>>> benefits of CMake.  (It does help that none of our developers use Windows
>>> as
>>> their primary development platform, so it only comes up when we make sure
>>> things are working on Windows...)
>>>
>>
>> I use Visual Studio 2010 daily for the last 6 months or so and the bug
>> is not that difficult for me to work with at all. I do admit it is
>> annoying when you get prompted 50 times to reload projects but most of
>> the time it does not do that. I mean if you only add files to a single
>> project it will not prompt you for the other 49. Now if I know the
>> change will be big, I usually close the solution and run cmake
>> externally from a script.
>>
> Does this solution work for VS 2010:
>
> There is an out of cmake solution for this.
>
> http://vscommands.com/ [^]
>
> If you install the VSCommands plugin free version, it will fix the reload
> dialog to only ask once.
>
I have not tried that. I will do so and report back in around 2 weeks.
I am leaving for a vacation at 4:00 AM tomorrow and I do not think I
will have any time to test this..

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] Workflow of a collaborative project in Visual Studio+CMake

2011-11-12 Thread John Drescher
> It basically comes down to the inconvenience of having to do that with
> Visual Studio being outweighed (considerably!) by the cross-platform
> benefits of CMake.  (It does help that none of our developers use Windows as
> their primary development platform, so it only comes up when we make sure
> things are working on Windows...)
>

I use Visual Studio 2010 daily for the last 6 months or so and the bug
is not that difficult for me to work with at all. I do admit it is
annoying when you get prompted 50 times to reload projects but most of
the time it does not do that. I mean if you only add files to a single
project it will not prompt you for the other 49. Now if I know the
change will be big, I usually close the solution and run cmake
externally from a script.

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] QtCreator generator?

2011-11-11 Thread John Drescher
> There should have been a "*.sln" file that you open.?
>

Not for a "Code Blocks -NMake Makefile" project.

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] How to build ccmake.exe on Windows?

2011-11-11 Thread John Drescher
On Fri, Nov 11, 2011 at 3:24 PM, Robert Dailey  wrote:
> According to the root CMakeLists.txt in cmake, there is no way to do this on
> Windows. I'll probably have to build it through Cygwin itself, assuming UNIX
> is truthy when using Cygwin.
>   # Use curses?
>   IF (UNIX)
>     # there is a bug in the Syllable libraries which makes linking ccmake
> fail, Alex
>     IF(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable)
>       SET(CURSES_NEED_NCURSES TRUE)
>       FIND_PACKAGE(Curses QUIET)
>       IF (CURSES_LIBRARY)
>         OPTION(BUILD_CursesDialog "Build the CMake Curses Dialog ccmake" ON)
>       ELSE (CURSES_LIBRARY)
>         MESSAGE("Curses libraries were not found. Curses GUI for CMake will
> not be built.")
>         SET(BUILD_CursesDialog 0)
>       ENDIF (CURSES_LIBRARY)
>     ELSE(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable)
>       SET(BUILD_CursesDialog 0)
>     ENDIF(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable)
>   ELSE (UNIX)
>     SET(BUILD_CursesDialog 0)
>   ENDIF (UNIX)
> -
> Robert Dailey
>
>
> On Fri, Nov 11, 2011 at 2:21 PM, Robert Dailey  wrote:
>>
>> I'm using Cygwin with the MSVC toolchain and I need ccmake.exe. I can't
>> use the one from the Cygwin package manager because it's older than the
>> version I'm using. I'd like to build it myself through Visual Studio like I
>> did with cmake and cmake-gui if possible. Any help?
>>

BTW, there is a cmake in cygwin setup. I believe it is recommended to
use that instead of the windows cmake.exe

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] Visual Studio 10 property pages for single source file gone with CMake 2.8.5 and 2.8.6

2011-11-11 Thread John Drescher
> In order to work around http://public.kitware.com/Bug/view.php?id=12570 I
> think it should be sufficient to have a different drive *letter* when
> specifying where to build the binaries than the drive letter(s) of the path
> names of the source files. So I guess one might work around this issue by
> mapping a new drive letter to the build/bin directory, even while this
> directory might be located at the same physical drive as the source files.
> Right?
>

You could also probably use the subst command to substitute the root drive.

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] VS2003 and reloading projects

2011-11-10 Thread John Drescher
> That's fine & dandy but I have a solution with 120+ projects that each have
> SCC bindings... that makes them load especially slow!
> I wish VS was smart enough to just reload the changed projects properly...
> :(
>

I think also if you hit cancel on the CMake dialog. Then wait till the
projects are all reloaded then click build you can avoid needing to
close the solution. Perhaps also look at the settings for Documents
detecting outside changes.

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] VS2003 and reloading projects

2011-11-10 Thread John Drescher
> I've been struggling with a real nuisance lately. When I run a build in
> VS2003 and my CMake scripts are out of date, it regenerates and then prompts
> me if I would like to stop the build & reload the projects. Once I do that,
> my projects reload but for some reason their settings are still out of date.
> Either it didn't reload the actual projects that changed or this is a bug of
> some sort. In any case the only way I can get reliable behavior is to close
> VS2003 completely, run CMake on the outside, and then reopen my solution.
> I've read that this has been a constant struggle from the start for the
> CMake team, so just wondering if there are any workarounds & tips.
> Thanks in advance.
>

I like to close my projects in Visual Studio before making a change
that requires a configure like adding several source files. Then I
launch cmake to regenerate the solution from a configure.bat batch
file I have generated in my projects build folder.

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] Need a full list of reserved words

2011-10-30 Thread John Drescher
On Sun, Oct 30, 2011 at 3:14 PM, Robert Dailey  wrote:
> I'm trying to help the Notepad++ author update his list of keywords for
> CMake since it is pretty out of date, however I don't want to manually have
> to type up a list of all commands, variables, properties, and
> options/parameters.
> Is there a list of everything in the CMake source code someone can just
> paste here? I can then send that on to the Notepad++ developers to get the
> list updated.
> Thanks!
>

You can do a

cmake --help-command-list

cmake --help-variable-list

cmake --help-property-list

to get this answer.

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] "cl" is not able to compile -VS2010 C1060: compiler out of heap space

2011-10-27 Thread John Drescher
On Thu, Oct 27, 2011 at 9:10 AM, Nelis  wrote:
> Hi John
>
> Yes installed SP1 immediately after the base system. No other updates
> though.
> Strange behaviour that the clean cache compile should differ from the filled
> cache compile.
> BTW, thanks for your time.
>

What generator are you selecting?

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] "cl" is not able to compile -VS2010 C1060: compiler out of heap space

2011-10-27 Thread John Drescher
On Thu, Oct 27, 2011 at 8:52 AM, Nelis  wrote:
> Hi John
>
>>I have 5 versions of Visual Studio installed on my 64 bit windows 7
>>box at work and CMake-2.6.1 still works with the versions of VS I
>>tested (2008,2010) Did you rename VS2005 before or after you had this
>>problem?
>
> Renamed VS2005 after finding the heap problem on building CMake project sln
> files,
> but outcome still the same before and after renaming.
>
> Working through the few CMake files after CMaking, I find no 'incorrect'
> path.
>
> Immediately after deleting cache, on configure, I find this:
> 1>-- Build started: Project: cmTryCompileExec, Configuration: Debug
> Win32 --
> 1> testCCompiler.c
> 1>c1 : fatal error C1060: compiler is out of heap space
>
> when I configure again, but with cache intact, I find different warnings,
> same error:
> 1>-- Build started: Project: cmTryCompileExec, Configuration: Debug
> Win32 --
> 1>cl : Command line warning D9035: option 'GZ' has been deprecated and will
> be removed in a future release
> 1>cl : Command line warning D9036: use 'RTC1' instead of 'GZ'
> 1> testCCompiler.c
> 1>c1 : fatal error C1060: compiler is out of heap space
>
> could it be attributable to VS2010 picking up some setting from VS2005 on
> install?
>

Have you installed the VS2010 SP1 yet? If not please do so. There are
a few serious compiler bugs that I have seen. Although I have not seen
this one in my testing.

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] "cl" is not able to compile -VS2010 C1060: compiler out of heap space

2011-10-27 Thread John Drescher
On Thu, Oct 27, 2011 at 8:35 AM, Nelis  wrote:
> Hi
>
> CMake 2.8.6, newly installed VS2010, previously VS2005 (dir renamed for
> now), XPSP3, swap space 5GB.
>
> Running configure freshly after the cache is deleted, on two different
> CMakeLists project files.
>
> CMake Error at C:/Program Files/CMake
> 2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
>  The C compiler "cl" is not able to compile a simple test program.
> ...
>  Run Build Command:C:\PROGRA~1\MICROS~2.0\Common7\IDE\devenv.com
>  CMAKE_TRY_COMPILE.sln /build Debug /project cmTryCompileExec
>  Microsoft (R) Visual Studio Version 10.0.40219.1.
>  1>-- Build started: Project: cmTryCompileExec, Configuration: Debug
> Win32 --
>  1> testCCompiler.c
>  1>c1 : fatal error C1060: compiler is out of heap space
>  == Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped
> ==
>  CMake will not be able to correctly generate this project.
> Call Stack (most recent call first):
>  CMakeLists.txt:16 (PROJECT)
>
> The same little cmake test program compiles inside VS2010 IDE.
>
> The CMakeLists project file works on other PCs, but not mine.
>
> Could it be as a result of stuff from previous VS versions lying around?
> - cleaned out all environmental variables
> - renamed VS2005 directory to false name, so that paths to VS2005 won't
> work.
>

I have 5 versions of Visual Studio installed on my 64 bit windows 7
box at work and CMake-2.6.1 still works with the versions of VS I
tested (2008,2010) Did you rename VS2005 before or after you had this
problem?

> Any idea where I can start to search for the solution?
>
> regards
>
> nelis
>
>
>
>
> --
> View this message in context: 
> http://cmake.3232098.n2.nabble.com/cl-is-not-able-to-compile-VS2010-C1060-compiler-out-of-heap-space-tp6936159p6936159.htm
> 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
>



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


Re: [CMake] Setting Platform (Win32 or x64) for Visual Studio in CMake

2011-10-26 Thread John Drescher
On Wed, Oct 26, 2011 at 10:17 AM, Ludovic Hoyet  wrote:
> Just to know, is there a way to set the platform in the CMakeList? At the
> moment if I select VS_XXX if creates uses the Win32 platform, and the x64 is
> used if I select VS_XXX x64. I would like to set a variable to the default
> platform (no pb with that), and let the users modify if if they really want
> (therefore create a Win32 platform from VS_XXX x64 if that's what they want,
> from setting this variable)...
> Thanks
>

You do this by setting the generator. I would not hardwire that in a
CMakeLists.txt file. Instead if you want create a batch file that
calls cmake.exe with the appropriate generator..
--

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] Precompiled header support in Visual Studio?

2011-10-25 Thread John Drescher
On Tue, Oct 25, 2011 at 12:01 PM, John Drescher  wrote:
> On Tue, Oct 25, 2011 at 11:43 AM, Robert Dailey  wrote:
>> Bumping this in hopes for some help!
>>
>
> Your version is different than the stackoverflow example
>
>
> Line
> SET(Sources ${${SourcesVar}})
>
> should be
>
> SET(Sources ${${source}})
>
> since you renamed the SourcesVar parameter.
>

Also it looks the other parameters are renamed and need to be fixed.

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


Re: [CMake] Precompiled header support in Visual Studio?

2011-10-25 Thread John Drescher
On Tue, Oct 25, 2011 at 11:43 AM, Robert Dailey  wrote:
> Bumping this in hopes for some help!
>

Your version is different than the stackoverflow example


Line
SET(Sources ${${SourcesVar}})

should be

SET(Sources ${${source}})

since you renamed the SourcesVar parameter.

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] Solution directory support

2011-10-24 Thread John Drescher
On Mon, Oct 24, 2011 at 6:14 PM, Robert Dailey  wrote:
> Does CMake support the creation of solution directories yet? Also the
> ability to assign targets to solution directories would be essential.
> The main reason I would use them is to organize/hide CTest projects so that
> they don't double the list of projects in the solution (I have 120 projects
> right now, after tests I would have over 300 projects. I need to be able to
> stuff the 180 test projects in a solution directory to keep them out of the
> way)
>

This is called Solution Folders.

Add this to the top level CMakeLists.txt
#Use solution folders.
set_property(GLOBAL PROPERTY USE_FOLDERS ON)



# Then in some target add this to put the target in the Development folder.
set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER Development)
--

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] Common CMake setup for several projects

2011-10-14 Thread John Drescher
On Fri, Oct 14, 2011 at 7:33 AM, Paul Hansen  wrote:
> Hi
>
> Is it possible to make a common CMake setup that can be used in several
> projects?
>
> The projects are independant but do use common libraries. Would be nice to
> set this up in one place and not in the CMakeLists.txt for each project.
>
> Can it be done "preprocessor-like":
> #include "/path/to/common/CMakeLists.txt"
>

Yes.

include(/path/to/common/CMakeLists.txt)

However I would change the name to something like the following:
include(/path/to/common/InitilaizeProjects.cmake)

> or is the way to make a top CMakeLists.txt that uses
> add_subdirectory(project1)
> add_subdirectory(project2)
>
> or a third way?
>
> Thank you very much
> Paul
>
> --
>
> 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
>



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


Re: [CMake] simple cmake example

2011-10-08 Thread John Drescher
On Fri, Oct 7, 2011 at 11:23 PM, Tim Coddington
 wrote:
> Thank you.  After adapting your file ccmake complains about line 7:
>
>  include(${MRPT_USE_FILE})
>
> "CMake Error at CMakeLists.txt:7 (include):
>   include called with wrong number of arguments.  Include only takes
> one file."
>
> How is MRPT_USE_FILE defined?
>
Sorry. In the 2 minutes I spent on creating the example for you I did
not look up the finder for MRPT but assumed it followed the standard
that most other packages use. Do as Michael says for that..

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] simple cmake example

2011-10-07 Thread John Drescher
On Fri, Oct 7, 2011 at 6:00 PM, Tim Coddington
 wrote:
> Hi
>   I recently started working with open source code that uses cmake for
> build.  I've been able to make do since most of the CMakeLists.txt files
> are provided or specific instructions are given.
>
>   I'm about to embark on my first contribution to build a driver for an
> IMU and I want to build an example that is very similar to mine but it's
> been "extracted" from an existing code tree, i.e. current CMakeLists.txt
> files would port easily.
>
>   I'm having problems constructing what should be a relatively
> straightforward CMakeLists.txt file for the extracted code that I want
> to run in isolation.  I've been reading tutorials, etc but I don't seem
> to get it.  Please consider
> taking my general C++ example described below and tell me what (exactly)
> the CMakeLists.txt should look.
>
> [Ubuntu 11.04, cmake 2.8.3, C++ code]
>
> Given:
> Top level directory "proj/" and subdir "proj/src"
>
> The proj/ directory shall contain the parent CMakeLists.txt and
> proj/src shall contain a child CMakeLists.txt (if
> necessary/appropriate).
>
> The src/ directory contains these source related files:
>
> file1.h       >> header only no associated cpp file
> file2.h       >> header only "
> file3.h
> file3.cpp
> file4.h
> file4.cpp
> main.cpp
>
> In addition to standard references, some of these files depend on
> external library which is found with the FIND_PACKAGE(MRPT REQUIRED
> hwdrivers slam)    [note: these libraries come from Mobile Robot
> Programming Toolkit]
>
> Please tell me what the two (or one) CMakeLists.txt file(s) should
> contain in order to build this code.
>

Something like the following:

cmake_minimum_required(VERSION 2.8)

PROJECT(MYProjectName)

FIND_PACKAGE(MRPT REQUIRED hwdrivers slam)
include(${MRPT_USE_FILE})

 # Set your files and resources here
SET(${PROJECT_NAME}_SRC
./src/file3.cpp
./src/file4.cpp
./src/main.cpp
)

SET(${PROJECT_NAME}_HDR
./src/file1.h
./src/file2.h
./src/file3.h
./src/file4.h
 )

include_directories(src)

ADD_EXECUTABLE( ${PROJECT_NAME} ${${PROJECT_NAME}_SRC} ${${PROJECT_NAME}_HDR})

TARGET_LINK_LIBRARIES( ${PROJECT_NAME} ${MRPT_LIBRARIES)
--
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] ExternalProject: avoiding rebuilds

2011-09-24 Thread John Drescher
On Sat, Sep 24, 2011 at 4:11 AM, Rolf Eike Beer  wrote:
> Am Freitag, 23. September 2011, 16:26:46 schrieb Ben Medina:
>> Hello all,
>>
>> I'm trying to adopt greater usage of ExternalProject in my project.
>> One problem I'd like to resolve is spurious rebuilds of external
>> projects.
>
> [...]
>
>> This works great: building "test" first untars the CLAPACK source and
>> builds it, as expected. However, if I rebuild test (i.e. in Visual
>> Studio, right-click on test and rebuild), then the CLAPACK tarball get
>> extracted *again*, and a full rebuild of CLAPACK happens. I'd expect
>> that, unless the tarball is changed, a rebuild of the external project
>> is a no-op.
>>
>> Is there a way to achieve my desired behavior?
>
> Yes, use the correct option. Rebuild means "rebuild this target and all of
> it's dependencies". There is a different option, something like "rebuild only
> this target". Just use this one.
>

That may be difficult in practice. I mean I typically have 20 to 40
targets in my projects and sometimes I would want them all rebuilt.
However I there is a batch build option in Visual Studio that can be
used for that. In this case you check which targets you want built so
you can click select all and then uncheck the external project.

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] User generated header file

2011-09-19 Thread John Drescher
> On Mon, Sep 19, 2011 at 14:13, John Drescher  wrote:
>> My question is can't you have CMake generate the header for the user
>> instead of them supplying a file? Is it just defines in this header?
>>
>
> It's basically user/site-specific defines that is based on user
> preferences and availability of libraries/devices on their Windows
> platform. At the moment for Windows Visual Studio users we force them
> to do this manually.
>

To me this sounds like something that would be perfect to do with
CMake options and some usage of find_libraray, maybe some environment
variables to help out. However I do not mean to tell you how to
configure your software..

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] User generated header file

2011-09-19 Thread John Drescher
>>> Do you want the user to manually add the header, or do you want cmake
>>> to create it?
>>>
>>
>> User will manually add it before compile, so Eric mentioned setting
>> the GENERATED property to true, it works.
>
> The fact is it works the way you want, which is good, but beside that
> why would it be better for the user to face a failing build (because
> he forgot to create the file)
> than
> face a failing CMake run (because he forgot to create the file)?
>

My question is can't you have CMake generate the header for the user
instead of them supplying a file? Is it just defines in this header?

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] Why do jom/nmake generators require cl to build with mingw?

2011-09-15 Thread John Drescher
On Thu, Sep 15, 2011 at 8:08 AM, John R. Cary  wrote:
> I was trying to configure a project to use jom or name with the
> mingw compilers.
>
> I was configuring with
>
> cmake \
>  -DCMAKE_INSTALL_PREFIX:PATH=C:/winsame/volatile-mingw/txphysics-r1504-ser \
>  -DCMAKE_BUILD_TYPE:STRING=RELEASE \
>  -DCMAKE_VERBOSE_MAKEFILE:BOOL=TRUE \
>  -DCMAKE_INSTALL_ALWAYS:BOOL=TRUE \
>  -DCMAKE_COLOR_MAKEFILE:BOOL=FALSE \
>  -G 'NMake Makefiles' \
>  -DCMAKE_C_COMPILER:FILEPATH='mingw32-gcc' \
>  -DCMAKE_CXX_COMPILER:FILEPATH='mingw32-g++' \
>  -DCMAKE_Fortran_COMPILER:FILEPATH='mingw32-gfortran' \
>  C:/cygwin/home/user/vorpalall-mg/txphysics
>
> but got the warning,
>
> CMake Warning at CMakeLists.txt:10 (project):
>  To use the NMake generator, cmake must be run from a shell that can use the
>  compiler cl from the command line.  This environment does not contain
>  INCLUDE, LIB, or LIBPATH, and these must be set for the cl compiler to
>  work.
>
> and ultimately the error,
>
> CMake Error at C:/Program Files/CMake
> 2.8/share/cmake-2.8/Modules/CMakeRCInformation.cmake:22
> (GET_FILENAME_COMPONENT):
>  get_filename_component called with incorrect number of arguments
> Call Stack (most recent call first):
>  C:/Program Files/CMake
> 2.8/share/cmake-2.8/Modules/Platform/Windows-GNU.cmake:60 (enable_language)
>  C:/Program Files/CMake
> 2.8/share/cmake-2.8/Modules/Platform/Windows-GNU-C.cmake:1 (include)
>  C:/Program Files/CMake
> 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:56 (INCLUDE)
>  CMakeLists.txt:2 (PROJECT)
>
> So I did put cl in my path, and now it configures, but this seems strange.
> Is it necessary to still have cl when using mingw?
>

I thought jom and nmake Generators were both for Visual Studio.

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] deploy VS2008 application

2011-08-27 Thread John Drescher
> The application I deployed is a DEBUG version and I have 
> include(InstallRequiredSystemLibraries) in my CMakeLists.txt.
>
> However, msvc(m/p/r)90.dll instead of msvc(m/p/r)90d.dll are copied to the 
> destination folder.  Any idea why this happened?
>

Do you realize that it is a violation of your Visual Studio license to
deploy debug libraries?

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] append command

2011-08-15 Thread John Drescher
> Anybody else has an opinion on this ?

My preference is to drop the idea since the set command already allows
you to append a string.

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] Fwd: [CMake 0012398]: "IF" infamous functionality fails to work with macro arguments

2011-08-15 Thread John Drescher
On Mon, Aug 15, 2011 at 11:26 AM, David Cole  wrote:
> Thanks, Michael...
>
> I'll give this another week or so here on the mailing list (and in the
> bug tracker) to gather feedback.
>
> If I don't hear anything else, I'll consider changing some
> documentation to clarify the existing situation, but I don't see a
> reasonable way to accommodate this feature request *and* maintain
> backwards compatibility with existing real world uses of macro and if
> commands.
>

I would like to see the documentation expanded to better explain the
differences between a function and a macro. Before this discussion I
have never used a function (did not understand what that gave me over
a macro) however I have ran into this problem with using if statements
in macros.

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


[CMake] Fwd: access absolute path of parent directory

2011-08-09 Thread John Drescher
-- Forwarded message --
From: John Drescher 
Date: Tue, Aug 9, 2011 at 4:56 PM
Subject: Re: [CMake] access absolute path of parent directory
To: Vinay Raj Hampapur 


On Tue, Aug 9, 2011 at 4:24 PM, Vinay Raj Hampapur
 wrote:
> Sure.
> Here is what I have(I've tried it with double quotes as well):
>
> set(Bob     /..)
> set(Dave   ${Bob}/Dave)
> set(D_src     ${Dave/Dave.cpp)
>
> ... and corresponding add executable command at which point the following
> error is produced:
>
>

You are setting Bob to be the root folder of your system. Remove the /
in your first set

set(Bob ..)

John



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


Re: [CMake] access absolute path of parent directory

2011-08-09 Thread John Drescher
>   I've been trying to access the parent directory by using
> CMakeLists.txt. However, the  "../" or ".." or "/../" notations don't access
> said parent directory.


Can you show a small example? I know this has worked for me.

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] How to create a 64-bit Windows build of cmake?

2011-08-01 Thread John Drescher
On Mon, Aug 1, 2011 at 10:02 PM, John R. Cary  wrote:
> On 8/1/11 7:04 PM, John Drescher wrote:
>>
>> On Mon, Aug 1, 2011 at 8:34 PM, John R. Cary  wrote:
>>>
>>> I believe I have followed what I have found on the web for
>>> building a Win64 version of CMake.  I have downloaded the
>>> win32 version and used it to configure the cmake source.
>>> I used the Visual Studio 9 2008 Win64 generator.
>>>
>> Last Friday I pulled in the cmake-git configured for 64 bit Visual
>> Studio 2010 and generated.
>
> Thanks!  I will try.  I found http://www.vtk.org/Wiki/CMake/Git.
> So then I did:
>
> git clone git://cmake.org/cmake.git CMake
> cd CMake
> git checkout -b release origin/release
>
> Where do I find "the cmake-git configured for 64 bit Visual
> Studio 2010"?
>

You need to use a 32 bit version of cmake to configure and generate.

Open up cmake-gui,
set the source folder to where you put the git.

set the binary folder to a location you want to build cmake. Note:
this should not be in the same folder as the source.

Then configure. cmake will ask you to select the compiler.

After this you want to build cmake-gui as well. There is a
configuration option for that. Also cmake probably will not find Qt so
you need to set the location of qmake to a 64 bit build of Qt. You
will most likely have to build that since nokia does not supply 64 bit
windows binaries.

Then generate.

This will create a visual studio project in the binary folder.

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] How to create a 64-bit Windows build of cmake?

2011-08-01 Thread John Drescher
On Mon, Aug 1, 2011 at 8:34 PM, John R. Cary  wrote:
> I believe I have followed what I have found on the web for
> building a Win64 version of CMake.  I have downloaded the
> win32 version and used it to configure the cmake source.
> I used the Visual Studio 9 2008 Win64 generator.
>

Last Friday I pulled in the cmake-git configured for 64 bit Visual
Studio 2010 and generated. Opened the project it generated and built
release. Then I built the package target and installed the package and
I had a 64 bit version of cmake. Although with this said I have yet to
see a reason to need CMake to be 64 bit except for the install
location being Program Files instead of Program Files (x86).

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] CMake Wiki spammed

2011-06-30 Thread John Drescher
I think I fixed it.

John

On Thu, Jun 30, 2011 at 7:30 PM, David Cole  wrote:
> I have forwarded this to our IT team... Hopefully it's not too hard to
> recover from for them.
>
> Thanks,
> David
>
>
> On Thu, Jun 30, 2011 at 7:24 PM, John Drescher  wrote:
>>
>> On Thu, Jun 30, 2011 at 6:27 PM, Moreland, Kenneth 
>> wrote:
>> > It looks like the CMake Wiki recently got spammed.  I see several links
>> > were
>> > recently added that do not belong (head lice treatment?).  Even more
>> > annoying, it looks like the spammer removed some links that do belong
>> > there.
>>
>> It's a mess. I was trying to back out of this but there are multiple
>> SPAM edits in between a few good edits. Ahmed appears to have done
>> most of the spamming.
>>
>> 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
>
>



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


Re: [CMake] CMake Wiki spammed

2011-06-30 Thread John Drescher
On Thu, Jun 30, 2011 at 6:27 PM, Moreland, Kenneth  wrote:
> It looks like the CMake Wiki recently got spammed.  I see several links were
> recently added that do not belong (head lice treatment?).  Even more
> annoying, it looks like the spammer removed some links that do belong there.

It's a mess. I was trying to back out of this but there are multiple
SPAM edits in between a few good edits. Ahmed appears to have done
most of the spamming.

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] How does cmake find libraries?

2011-06-16 Thread John Drescher
>    [ 74%] Built target test_sethandler
>    make[2]: *** No rule to make target `/usr/local/lib/libpng.dylib', needed
> by `tests/na/common/test_common'.  Stop.
>    make[1]: *** [tests/na/common/CMakeFiles/test_common.dir/all] Error 2
> The obvious reason is that /usr/local/lib/libpng.dylib doesn't exist:
>   arc:mbuild douglasl$ ls /usr/local/lib/ | grep png
>   arc:mbuild douglasl$
> But my cmake cache shows:
>   LIBPNG_INCLUDE_DIR:PATH=/Library/Frameworks/Mono.framework/Headers
>   LIBPNG_LIBRARY:FILEPATH=/usr/local/lib/libpng.dylib
>   //ADVANCED property for variable: LIBPNG_INCLUDE_DIR
>   LIBPNG_INCLUDE_DIR-ADVANCED:INTERNAL=1
>   //ADVANCED property for variable: LIBPNG_LIBRARY
>   LIBPNG_LIBRARY-ADVANCED:INTERNAL=1
> Can someone shed some light on how cmake is finding that module?
> Sounds like the machine config is broken, but I'm not sure exactly how to
> fix it.

Does png.h exist in this folder

/Library/Frameworks/Mono.framework/Headers

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] CMake 2.8.5-rc1 ready for testing!

2011-06-15 Thread John Drescher
On Wed, Jun 15, 2011 at 3:31 AM, Andrea Galeazzi  wrote:
> I think it would be great if http://public.kitware.com/Bug/view.php?id=11258
> could be fixed in 2.8.5. Without such a fix VS2010 will keep on being
> useless.
>

Hmm. I have been using VS2010 for a few weeks (not primarily I use
more than 1 compiler) and its certainly not useless. I have not
experienced this bug yet however.

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] Dealing with down servers when using FindSubversion.cmake

2011-06-13 Thread John Drescher
On Mon, Jun 13, 2011 at 3:16 PM, Rolf Eike Beer  wrote:
> Am Montag, 13. Juni 2011, 13:02:34 schrieb John Drescher:
>> I use code like the following to append a version to my applications
>> based on the current svn rev.
>>
>> FIND_PACKAGE(Subversion)
>> IF(Subversion_FOUND)
>>       Subversion_WC_INFO(${PROJECT_SOURCE_DIR} Project)
>>       MESSAGE("Current revision is ${Project_WC_REVISION}")
>>       Subversion_WC_LOG(${PROJECT_SOURCE_DIR} Project)
>>       MESSAGE("Last changed log is ${Project_LAST_CHANGED_LOG}")
>>       set (${PROJECT_NAME}_VERSION_PATCH
>> ${${PROJECT_NAME}_VERSION_PATCH}.${Project_WC_REVISION})
>> ENDIF(Subversion_FOUND)
>>
>> The problem is if the server is down it prevented me from working
>> since the failure to get a version ends up blocking the generate so I
>> added an option to disable the appending if I disable the option:
>
> I think your problem is not the version, but the log. The log is fetched from
> the server, the revisions of the files are stored inside the working copy and
> therefore are available offline, too. Just remove that log thing.
>
Thanks, I will try that. I am trying to remember why I put the log
part in there. I know it was nice to see the last commit in the
cmake-gui but if that holds me up no reason for that..

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


[CMake] Dealing with down servers when using FindSubversion.cmake

2011-06-13 Thread John Drescher
I use code like the following to append a version to my applications
based on the current svn rev.

FIND_PACKAGE(Subversion)
IF(Subversion_FOUND)
Subversion_WC_INFO(${PROJECT_SOURCE_DIR} Project)
MESSAGE("Current revision is ${Project_WC_REVISION}")
Subversion_WC_LOG(${PROJECT_SOURCE_DIR} Project)
MESSAGE("Last changed log is ${Project_LAST_CHANGED_LOG}")
set (${PROJECT_NAME}_VERSION_PATCH
${${PROJECT_NAME}_VERSION_PATCH}.${Project_WC_REVISION})
ENDIF(Subversion_FOUND)


The problem is if the server is down it prevented me from working
since the failure to get a version ends up blocking the generate so I
added an option to disable the appending if I disable the option:

FIND_PACKAGE(Subversion)
IF(Subversion_FOUND)
OPTION(APPEND_SVN_REV "Append subversion rev to application version" ON)

IF(APPEND_SVN_REV)
Subversion_WC_INFO(${PROJECT_SOURCE_DIR} Project)
MESSAGE("Current revision is ${Project_WC_REVISION}")
Subversion_WC_LOG(${PROJECT_SOURCE_DIR} Project)
MESSAGE("Last changed log is ${Project_LAST_CHANGED_LOG}")

set (${PROJECT_NAME}_VERSION_PATCH
${${PROJECT_NAME}_VERSION_PATCH}.${Project_WC_REVISION})
ENDIF(APPEND_SVN_REV)

ENDIF(Subversion_FOUND)


Is there an easy way it can just cache result of these checks and if
the server is down just use the cache instead of being fatal so I do
not have to use the switch to turn off this when the server is down?

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


Re: [CMake] Determine Installer Build Configuration in Visual Studio

2011-06-09 Thread John Drescher
> I've managed to get an NSIS project up and running in VIsual Studio with
> CPack, but I can't figure out how to determine which configuration type is
> being built.  Is it possible to write up a CMakeLists that will run through
> different conditionals based off of the Build Configuration Type selected in
> Visual Studio?  If a user selects a Debug build I'd like to be able to tell
> the installer to be built with the Debug libraries instead of the Release.
>

That is what it does. When debug is selected in Visual Studio and you
build the PACKAGE project it will build this using debug libs.

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] FindQt4.cmake to automatically include QT_USE_FILE?

2011-06-07 Thread John Drescher
> If you don't care for the macros and want to set up the
> include-directories and defines yourself, no. Also, it is common to
> find_package(Qt4) in the top-level CMakeLists.txt file, but then include
> QT_USE_FILE only in specific subdirectories, where Qt is actually used.
>

I have started doing that in my projects. It cuts down on the
unnecessary includes for subprojects that do not need Qt.

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] Forcing CMake to never search install path

2011-05-15 Thread John Drescher
> I've been struggling to find a way to prevent CMake from using
> CMAKE_INSTALL_PREFIX in any of its FIND_* routines.  Generally
> speaking, stripping it out of CMAKE_SYSTEM_PREFIX_PATH seems to work,
> but we're still getting situations on Windows where it is finding old
> libraries from previous program installs.  I've tried ensuring all of
> the CMAKE_SYSTEM_*_PATH variables are stripped, but that doesn't seem
> to make a difference.
>
> Is there a mechanism I can use to specify to CMake to NEVER search in
> a given path, excluding it from all FIND_* routine searches?  It is
> very typical in our development process to have older builds installed
> and be building newer versions at the same time, so we really need a
> good solid way to make sure previously built libraries aren't picked
> up by FIND routines.
>

Not that I have a solution however I too am looking to solve this
problem. For me its not so much about INSTALL paths since I almost
never run the INSTALL targets (at least not on projects that do not
have different names for release and debug) on windows but it's more
that a 32 bit build for Visual Studio 2005 will find the 64 bit Qt I
built for Visual Studio 2010. I am thinking of looking into batch
files and environment variables however I am not sure how many
packages will use environment variables like ( ITK_DIR, VTK_DIR ...)

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] How do you go about building the cmake-gui from source in 2.8.4?

2011-05-13 Thread John Drescher
> Yeah, I figured that part out indirectly.
>
> I had to install the QT4 SDK to get the necessary bits, but rcc.exe (Windows
> XP, desktop component of QT) fails for no obvious reason.
>

Did you build that from scratch using Visual Studio 2005 and not any
other compiler or version?

>
> Here is what I posted on the QT installation/deployment forum about the
> problem:
>
> I’m trying to rebuild CMake-gui.

Are you trying to modify it for some reason? I also do not see the
need to rebuild it.

> I’ve gotten to the point where I downloaded
> and installed the QT4 SDK, configured CMake for VS 2005 and fired up the
> build, which failed when trying to run rcc.exe. When I try to run RCC.EXE
> directly from the command prompt, I get:
>
> The system cannot execute the specified program.
>
> When I try it from cygwin’s command prompt, I get:
>

You should not mix cygwin building and visual studio building. What
are you doing here?

> Permission Denied
>
> Firing up Dependency Walker, I get an error when opening rcc.exe:
>
> The side-by-side configuration information for
> “…desktop\qt\4.7.3\msvc2005\bin\RCC.EXE” contains errors. This application
> has failed to start because the application configuration is incorrect.
> Reinstalling the application may fix this problem (14001).
>

This usually means you do not have the correct run times installed.
Did you download the Visual Studio 2008 binary release. That will not
work with Visual Studio 2005. You need to build Qt for your compiler.

> Which I tried with no joy.
>
> There are a couple of delay loaded dlls that aren’t present, IESHIMS and
> WER, but these appear to be more or less specific to Vista and don’t apply
> to XP (which is what I’m running on).
>
> So how do I get around this? Is this an SDK problem? or something really
> obscure in Windoze? I’m not primarily a Windows person so I’m not 100% on
> all the ins and outs here, but I would think that the RCC.EXE as installed
> by the QT4 SDK installer should at least start on XP.
>
> Any and all hints will be appreciated.
>
> Best,
>
> Dick Munroe
>
> Any clues?
>
> On 5/13/11 5:45 AM, cmake-requ...@cmake.org wrote:
>>
>> Message: 5
>> Date: Thu, 12 May 2011 16:43:04 -0600
>> From: "clin...@elemtech.com  "
>> Subject: Re: [CMake] How do you go about building the cmake-gui from
>>        source in       2.8.4?
>> To:cmake@cmake.org
>> Message-ID:<20110512224256.a45c3129...@mta1.zcs.xmission.com>
>> Content-Type: text/plain; charset="utf-8"
>>
>> It is under Source/QtDialog and the cmake option has QtDialog in its name.
>>
>> Clint
>>
>> - Reply message -
>> From: "Dick Munroe"
>> Date: Thu, May 12, 2011 11:07 am
>> Subject: [CMake] How do you go about building the cmake-gui from source in
>>      2.8.4?
>> To:
>>
>> The title pretty much says it all.  I can't find anything obvious in the
>> source tree and I want to rebuild cmake-gui for windows.
>>
>> tia,
>>
>> Dick Munroe
>
> ___
> 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
>



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


Re: [CMake] Testing and DLLs

2011-05-04 Thread John Drescher
On Wed, May 4, 2011 at 12:25 PM, Michael Jackson
 wrote:
> Funny, I did the same thing using pure CMake code because I couldn't figure 
> out batch files.
>

BTW, I started from your example of your macro to create my macro. Thanks.

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] Testing and DLLs

2011-05-04 Thread John Drescher
> I am curious whether there is a common way of dealing with unit tests
> when the actual project to be tested is a DLL? The issue I am facing
> is a common Windows issue where the required DLL is not found in the
> path.
>
> I tried to put all binaries in the same directory by modifying
> CMAKE_*_OUTPUT_DIRECTORY but that did not affect my tests (added via
> add_test).
>
> Another solution I can think of is running "make INSTALL" before
> running the tests but that feels like a strange approach since I
> typically want to test before installing.
>
> Its also not really possible to adapt the PATH environment variable -
> how could I possible guess where somebody is going to build my code!?
>
> So again, I am really curious if there is a well working solution.
>

I now have a custom build script that generates a batch file that
copies (using cmake commands) the required dlls into the Debug,
Release, RelWithDebInfo folders for me for the few libraries that
require dlls (Qt ). For ITK, VTK ... I use static libs so no need to
copy these.





option (GET_RUNTIME "Create a target that will get the 
runtime" ON)

IF (GET_RUNTIME)

SET (${PROJECT_NAME}_PACKAGING_RUNTIME "")

SET (RUNTIME_BATCH_FILENAME "${PROJECT_BINARY_DIR}/GetRuntime.bat"
CACHE FILEPATH "${PROJECT_BINARY_DIR}/GetRuntime.bat")

add_custom_target(GetRuntime  "${RUNTIME_BATCH_FILENAME}")

#

macro( add_runtime_file BatchFileName RuntimeFile Configuration )

# Test if this is a valid configuration.
STRING( REGEX MATCH ${Configuration} __MATCHED__ 
${CMAKE_CONFIGURATION_TYPES})
if ( NOT "${__MATCHED__}" STREQUAL "" )

IF (NOT EXISTS 
"${EXECUTABLE_OUTPUT_PATH}/${Configuration}")
file( MAKE_DIRECTORY 
"${EXECUTABLE_OUTPUT_PATH}/${Configuration}" )
ENDIF (NOT EXISTS 
"${EXECUTABLE_OUTPUT_PATH}/${Configuration}")

GET_FILENAME_COMPONENT( BatchFile ${BatchFileName} 
NAME_WE )

#The following will truncate the file on the first call 
to add_runtime_file.
if ( NOT DEFINED __add_runtime_file_${BatchFile}__ )
set ( __add_runtime_file_${BatchFile}__ 1)
file( WRITE ${BatchFileName} "REM This file 
will copy the runtimes
to the Debug and Release binary folders\n" )
endif ( NOT DEFINED __add_runtime_file_${BatchFile}__)

#The following line will add the entry in the batch 
file for
copying the Runtime file to the folder
${PROJECT_BINARY_DIR}/${Configuration}/
file( APPEND ${BatchFileName} "\"${CMAKE_COMMAND}\" -E
copy_if_different \"${RuntimeFile}\"
\"${EXECUTABLE_OUTPUT_PATH}/${Configuration}/\"\n" )
endif(  NOT "${__MATCHED__}" STREQUAL "" )
endmacro( add_runtime_file )

#

macro( add_runtime_file_for_packaging RuntimeFile )
SET( ${PROJECT_NAME}_PACKAGING_RUNTIME
${${PROJECT_NAME}_PACKAGING_RUNTIME} ${RuntimeFile} )
endmacro( add_runtime_file_for_packaging )

ENDIF(GET_RUNTIME)
___
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] manifest version mismatch with VS 2008 and InstallRequiredSystemLibraries

2011-05-03 Thread John Drescher
On Tue, May 3, 2011 at 11:43 AM, Tyler  wrote:
> My project makes use of the CMake/CPack module
> InstallRequiredSystemLibraries to package Microsoft Visual C Runtime
> libraries with other build artifacts. Despite this and despite the
> presence of appropriate-looking files showing up in the installed
> image, my project does not run on XP and Vista machines unless the
> user installs the vcredist package from Microsoft.
>
> The VC runtime libraries provided by Microsoft and picked up by
> CMake/CPack have a manifest version of 9.0.30729.4148. I believe this
> version string refers to VS2008 SP1 + some hotfix. This seems
> reasonable since my Windows build machine is running VS2008 SP1 + some
> hotfix.
>
> However, all the binaries produced by the build system have the
> version sting 9.0.21022 embedded internally in a manifest.
>

Are you sure that all the libraries and dlls you use in your project
were compiled with "VS2008 SP1 + some hotfix."

I have in the past when I updated the compiler but forgot to clean
build all of the dependencies (like Qt and VTK).

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

2011-04-26 Thread John Drescher
> 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] Disable buffer security check in visual studio /GS-

2011-04-20 Thread John Drescher
On Wed, Apr 20, 2011 at 12:55 PM, John Drescher  wrote:
> After profiling my Visual Studio 2005 application I see that over 5%
> of the execution time in the Release build was spent doing buffer
> security checks. I found the following link for CMake support
>
> http://www.cmake.org/pipermail/cmake-commits/2008-March/003844.html
>

I guess that is not the best link since its a patch to enable
detecting 64 bit portability but it does show CMake identifies the
option.

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


[CMake] Disable buffer security check in visual studio /GS-

2011-04-20 Thread John Drescher
After profiling my Visual Studio 2005 application I see that over 5%
of the execution time in the Release build was spent doing buffer
security checks. I found the following link for CMake support

http://www.cmake.org/pipermail/cmake-commits/2008-March/003844.html

however I do not understand what that buys me. There is no option that
I can see in cmake-gui for disabling buffer security checks. I would
expect I could add my own option for my application  but that would
not help itk or vtk.

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


Re: [CMake] Bug fix requests for the *next* release of CMake...

2011-03-29 Thread John Drescher
http://public.kitware.com/Bug/view.php?id=11206

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


[CMake] Fwd: Setting Build properties for VS 2008

2011-03-17 Thread John Drescher
-- Forwarded message --
From: John Drescher 
Date: Thu, Mar 17, 2011 at 5:43 AM
Subject: Re: [CMake] Setting Build properties for VS 2008
To: Dan Furtney 


On Wed, Mar 16, 2011 at 11:25 PM, Dan Furtney  wrote:
> Is there a way for cmake to set the active build in a multi-project VS 
> solution?
>
Not directly.

However you may be able to generate a .user file (xml based user
settings file) without too much effort.

John



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


Re: [CMake] PREDEFINED_TARGETS_FOLDER and ALL_BUILD Target

2011-03-04 Thread John Drescher
On Fri, Mar 4, 2011 at 11:50 AM,   wrote:
> Hi All,
>
>
>
> I was just trying out the Target folders stuff in 2.8.4.  The ALL_BUILD
> target doesn’t seem to be affected by the PREDEFINED_TARGETS_FOLDER
> property.
>
>
>
> Is that by design or an oversight?
>
I see that here since I started using Solution Folders a few months
back. Although this is a slight inconvenience I would like to see that
moved to the CMakePredefindedTargets folder.

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] Including a header file fails

2011-03-01 Thread John Drescher
On Tue, Mar 1, 2011 at 2:15 PM, Enrique Izaguirre
 wrote:
> Sorry, I didn't explain correctly.
>
> All the source files are in variable ${hostFiles}
> and I generated and executable using add_executable (myprj ${hostFiles})
> now I need to add the w32api folder from Windows, which has header files
> called from one of the source files contained in ${hostFiles} and are
> located in
>
> ${MYPRJ_SOURCE_DIR}/../../../usr/include/w32api
>
> How can I do this?
>

You add the appropriate

include_directories()

command in CMake. If that header requires linking to a Microsoft
library then you do add the Microsoft library to the
target_link_libraries not the header file.

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] Including a header file fails

2011-03-01 Thread John Drescher
> The header file is already #included in one of the source files. What I
> don't know is how to link it.
> Can I do it only with target_link_libraries ( ) or how?
>

You do not link header files. You link source files. Why are you not
specifying your source files on the target_link_libararies() line?

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] QtCreator project generator

2011-03-01 Thread John Drescher
On Tue, Mar 1, 2011 at 9:15 AM, John Drescher  wrote:
> On Tue, Mar 1, 2011 at 6:45 AM, Campbell Barton  wrote:
>> QT-Creator which currently supports CMake by reading code::blocks project 
>> files.
>>
>> The problem with this is code::blocks project files don't write in
>> #defines, so the IDE shows #ifdef's incorrecyly.
>>
>> For the short term I wrote a eclipse -> qtcreator project converter in
>> python, which has a few hard coded values but could easily be made
>> generic.
>> http://www.pasteall.org/19595/python
>>
>> So I was wondering if CMake developers would accept a patch to add
>> native generation of qtcreator project files?
>>
>> An alternative solutions could be to write defines into code::blocks
>> files, or for qtcreator to read in eclipse files instead but qtcreator
>> project files are quite simple to write so if this feature is
>> acceptable I was thinking to try and write a patch.
>
> Recent versions of QtCreator use CMakeLists.txt directly? Is there
> something missing in this functionality?
>

Sorry. I have to quit answering forum posts while distracted..

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] QtCreator project generator

2011-03-01 Thread John Drescher
On Tue, Mar 1, 2011 at 6:45 AM, Campbell Barton  wrote:
> QT-Creator which currently supports CMake by reading code::blocks project 
> files.
>
> The problem with this is code::blocks project files don't write in
> #defines, so the IDE shows #ifdef's incorrecyly.
>
> For the short term I wrote a eclipse -> qtcreator project converter in
> python, which has a few hard coded values but could easily be made
> generic.
> http://www.pasteall.org/19595/python
>
> So I was wondering if CMake developers would accept a patch to add
> native generation of qtcreator project files?
>
> An alternative solutions could be to write defines into code::blocks
> files, or for qtcreator to read in eclipse files instead but qtcreator
> project files are quite simple to write so if this feature is
> acceptable I was thinking to try and write a patch.

Recent versions of QtCreator use CMakeLists.txt directly? Is there
something missing in this functionality?

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] include_directories and relative paths

2011-02-22 Thread John Drescher
> I don't need to move/copy "CMake build tree", I just want to generate
> and move/copy "VC proj/solution files".

You can not generate portable Visual Studio solution files with CMake.
The solution files generated would still require CMake. Its best not
to even package these. Just use CMake on all development machines and
generate your builds separately.
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] Solution folders

2011-02-19 Thread John Drescher
On Sat, Feb 19, 2011 at 11:22 AM, Robert Bielik
 wrote:
> Hi all,
>
> Running CMake 2.8.2 and generating build files for VS 9 (2008), I'm trying
> to "tidy up" the workspace by putting projects in solution folders.
> So I do:
>
> add_library(MyLib .)
>
> set_target_properties(MyLib
>  PROPERTIES
>  FOLDER "Libraries");
>
> add_executable(MyExe .)
>
> set_target_properties(MyLib
>  PROPERTIES
>  FOLDER "Executables");
>
> But nothing happens. All projects are still top level as usual. Ideas ?

You need this at the top of your main CMakeLists.txt

#Use solution folders.
set_property(GLOBAL PROPERTY USE_FOLDERS ON)

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] Expected boost path structure.

2011-02-17 Thread John Drescher
> You're welcome. Also, if you have to run it again, your "message" code
> should run before and after finding boost so you can see what it
> changed...
>
It changed exactly as you said:

Check for working C compiler using: Visual Studio 9 2008
Check for working C compiler using: Visual Studio 9 2008 -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working CXX compiler using: Visual Studio 9 2008
Check for working CXX compiler using: Visual Studio 9 2008 -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
BOOST_ROOTENV=X:/32bit/VC.90/Libraries/boost-1.45.0
BOOST_ROOTCMake=
Boost version: 1.45.0
Configuring done
___
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] Expected boost path structure.

2011-02-17 Thread John Drescher
> Take away the quotes in the env var. They are actually embedded in the
> env var, so they'll end up in the CMake variable, too. If you print
> out the CMake variable that gets set based on that env value, then it
> will have double quotes in it.
>
Okay that worked. Thanks a lot.


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


Re: [CMake] Expected boost path structure.

2011-02-17 Thread John Drescher
On Thu, Feb 17, 2011 at 11:37 AM, John Drescher  wrote:
>> According to FindBoost.cmake:
>>
>>  if (NOT BOOST_ROOT AND NOT $ENV{BOOST_ROOT} STREQUAL "")
>>    set(BOOST_ROOT $ENV{BOOST_ROOT})
>>  endif()
>>
>> So, it should work with an ENV var, too. But the way this is phrased,
>> it would have to have forward slashes "/" and no spaces in it for it
>> to work.
>>
>
> I launched cmake-gui from a Visual Studio 2008 32 bit command prompt
> with the BOOST_ROOT environment variable set in that command prompt.
>
> X:\Other\Libraries\boost_1_45_0>set BOOST_ROOT
> BOOST_ROOT="X:/32bit/VC.90/Libraries/boost-1.45.0"
>
> Is there a way to have cmake-gui show its environment variables?
>

Here is some debug output.

Check for working C compiler using: Visual Studio 9 2008
Check for working C compiler using: Visual Studio 9 2008 -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working CXX compiler using: Visual Studio 9 2008
Check for working CXX compiler using: Visual Studio 9 2008 -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
BOOST_ROOTENV="X:/32bit/VC.90/Libraries/boost-1.45.0"
BOOST_ROOTCMake=
Could NOT find Boost
Configuring done

This was generated with the following CMakeLists.txt:

cmake_minimum_required(VERSION 2.8)

PROJECT(BoostExamples)

MESSAGE( STATUS BOOST_ROOT ENV = $ENV{BOOST_ROOT} )
MESSAGE( STATUS BOOST_ROOT CMake = ${BOOST_ROOT} )


# The following line will add additional finders to CMake without the
need to be placed in the CMake install path
#LIST(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMake/Modules)

#SET (LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin CACHE INTERNAL
"Single output directory for building all libraries.")
#SET (EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin CACHE INTERNAL
"Single output directory for building all executables.")

#set(BOOST_ROOT "X:/32bit/VC.90/Libraries/boost-1.45.0")
FIND_PACKAGE(BOOST REQUIRED)

Now with #set(BOOST_ROOT "X:/32bit/VC.90/Libraries/boost-1.45.0")
uncommented, cache dropped and reconfigured:
Check for working C compiler using: Visual Studio 9 2008
Check for working C compiler using: Visual Studio 9 2008 -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working CXX compiler using: Visual Studio 9 2008
Check for working CXX compiler using: Visual Studio 9 2008 -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
BOOST_ROOTENV="X:/32bit/VC.90/Libraries/boost-1.45.0"
BOOST_ROOTCMake=
Boost version: 1.45.0
Configuring done

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] Expected boost path structure.

2011-02-17 Thread John Drescher
> According to FindBoost.cmake:
>
>  if (NOT BOOST_ROOT AND NOT $ENV{BOOST_ROOT} STREQUAL "")
>    set(BOOST_ROOT $ENV{BOOST_ROOT})
>  endif()
>
> So, it should work with an ENV var, too. But the way this is phrased,
> it would have to have forward slashes "/" and no spaces in it for it
> to work.
>

I launched cmake-gui from a Visual Studio 2008 32 bit command prompt
with the BOOST_ROOT environment variable set in that command prompt.

X:\Other\Libraries\boost_1_45_0>set BOOST_ROOT
BOOST_ROOT="X:/32bit/VC.90/Libraries/boost-1.45.0"

Is there a way to have cmake-gui show its environment variables?

John


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


Re: [CMake] Expected boost path structure.

2011-02-17 Thread John Drescher
On Thu, Feb 17, 2011 at 11:25 AM, John Drescher  wrote:
> On Thu, Feb 17, 2011 at 11:05 AM, David Cole  wrote:
>> Are you escaping the "\" characters, like this?
>> set(BOOST_ROOT "X:\\32bit\\VC ...")
>>
>> Or using the CMake convention "/" as a path separator character?
>> set(BOOST_ROOT "X:/32bit/VC ...")
>> (this is the one you should be doing...)
>>
> I see. I set an BOOST_ROOT as an environment variable instead of a
> CMake variable. It works when I set BOOST_ROOT as a CMake variable.
>

Hmm. That should have worked since the FindBoost.cmake evaluates the
environment variable BOOST_ROOT or BOOSTROOT

 # If BOOST_ROOT was defined in the environment, use it.
  if (NOT BOOST_ROOT AND NOT $ENV{BOOST_ROOT} STREQUAL "")
set(BOOST_ROOT $ENV{BOOST_ROOT})
  endif()

  # If BOOSTROOT was defined in the environment, use it.
  if (NOT BOOST_ROOT AND NOT $ENV{BOOSTROOT} STREQUAL "")
set(BOOST_ROOT $ENV{BOOSTROOT})
  endif()

I will try to figure this one out..
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] Expected boost path structure.

2011-02-17 Thread John Drescher
On Thu, Feb 17, 2011 at 11:05 AM, David Cole  wrote:
> Are you escaping the "\" characters, like this?
> set(BOOST_ROOT "X:\\32bit\\VC ...")
>
> Or using the CMake convention "/" as a path separator character?
> set(BOOST_ROOT "X:/32bit/VC ...")
> (this is the one you should be doing...)
>
I see. I set an BOOST_ROOT as an environment variable instead of a
CMake variable. It works when I set BOOST_ROOT as a CMake variable.

> What version of CMake?
>
2.8.4

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


[CMake] Expected boost path structure.

2011-02-17 Thread John Drescher
I am trying to get FIND_PACKAGE(BOOST REQUIRED) to work on windows.
After building boost-1.45.0 on windows with the following command

bjam --build-dir="X:\32Bit\VC.90\build\Libraries\boost-1.45.0"
toolset=msvc-9.0 --prefix="X:\32bit\VC.90\Libraries\boost-1.45.0"
--build-type=complete install

and installing I have the following structure for the installed boost.

X:\32bit\VC.90\Libraries\boost-1.45.0\include\boost-1_45\boost
X:\32bit\VC.90\Libraries\boost-1.45.0\lib

I tried to set BOOST_ROOT to X:\32bit\VC.90\Libraries\boost-1.45.0 but
CMake does not find boost with that root.

What is the expected path layout so that setting BOOST_ROOT will find
boost-1.45.0 ?



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


Re: [CMake] inconsistent line endings in Visual Studio 2010

2011-02-17 Thread John Drescher
On Thu, Feb 17, 2011 at 8:39 AM, John Drescher  wrote:
>> VS 2010 always breaks my build complaining about inconsistent line
>> endings in a generated file. I need to open and re-save the file in VS
>> to be able to continue. My code is about:
>>
>> TRY_RUN(.. RUN_OUTPUT_VARIABLE RUN_OUTPUT)
>> FILE(WRITE ${CMAKE_BINARY_DIR}/foo.h "${RUN_OUTPUT}")
>>
>> The program being run just prints several lines using
>> printf("\n"). I am not aware this should generate UNIX endings
>> only. Interestingly, VS once said it is MAC-generated.
>>
>> Is there a way I can solve or walk around this problem without
>> breaking the compilation on linux instead?
>>
>
> One suggestion is to use a SCM (like subversion) that will translate
> the line endings for you depending in the OS you are using.
>
Sorry. I spoke too soon. Erase that Idea. You are generating the file in CMake.

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] inconsistent line endings in Visual Studio 2010

2011-02-17 Thread John Drescher
> VS 2010 always breaks my build complaining about inconsistent line
> endings in a generated file. I need to open and re-save the file in VS
> to be able to continue. My code is about:
>
> TRY_RUN(.. RUN_OUTPUT_VARIABLE RUN_OUTPUT)
> FILE(WRITE ${CMAKE_BINARY_DIR}/foo.h "${RUN_OUTPUT}")
>
> The program being run just prints several lines using
> printf("\n"). I am not aware this should generate UNIX endings
> only. Interestingly, VS once said it is MAC-generated.
>
> Is there a way I can solve or walk around this problem without
> breaking the compilation on linux instead?
>

One suggestion is to use a SCM (like subversion) that will translate
the line endings for you depending in the OS you are using.

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] Gyp VS CMake

2011-02-17 Thread John Drescher
> But we are going off topic. The main point in my post was to trigger
> discussion about how we could improve CMake, so that Gyp's
> developers/users could use it.
>

I think one of their main points was to generate standalone projects
that do not require CMake to build.

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] Naive (stupid?) question

2011-02-17 Thread John Drescher
>    apologies for the stupid question. I have a large project and at times a 
> change triggers unexpected consequences, i.e. very large recompilations, 
> rebuild of the cmake makefiles and so on. Is there a way in cmake to 
> understand why things happens? I mean which chain of dependencies causes a 
> given action to be taken? It would be for me very interesting to understand 
> something more about the dependencies in my project, to be able to reduce 
> them. Thanks and best regards,
>
Are you generating header files in CMake? If so these change on every
invocation of CMake? And is a lot of your project dependent on these
header files?

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] multiple directories in one variable

2011-02-11 Thread John Drescher
> it is what I want.
> But how?
>
> How can I "put all the directories in EXTERNAL_PRODUCT_INCLUDES" from cmake 
> command line?
>

I do not know. Sorry. I did not see that you were trying to add these
via the command line. I never use that mode of cmake.

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


<    1   2   3   4   5   6   >