[CMake] Using KWSys to execute a detached process (Linux)

2011-05-11 Thread Daniel Blezek
Hi,

  I¹ve been fruitlessly trying to use KWSys to execute a detached process in
Linux.  Perhaps it is not surprising that this fails, because the detach
code does not seem to be tested.  Does anyone have an experience or
suggestions?  Here¹s a snippit of my code:

  itksysProcess_SetCommand ( process, StringCommandLine );
  itksysProcess_SetOption ( process, itksysProcess_Option_Detach, 1 );
  itksysProcess_Execute ( process );
  std::cout << "Execute" << std::endl;


Strangely enough, it works correctly in the debugger, but not straight from
the command line.

Thanks,
-dan


-- 
Daniel Blezek, PhD
Medical Imaging Informatics Innovation Center

P 127 or (77) 8 8886
T 507 538 8886
E blezek.dan...@mayo.edu

Mayo Clinic
200 First St. S.W.
Harwick SL-44
Rochester, MN 55905
mayoclinic.org
"It is more complicated than you think." -- RFC 1925

___
Powered by www.kitware.com

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

Please keep messages on-topic and check 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] SWIG, Java and CMake

2011-06-14 Thread Daniel Blezek
We are using SWIG in the SimpleITK project (
https://github.com/SimpleITK/SimpleITK for the interested ) to generate Java
wrappings for our library.  The problem I¹m having is how to educate CMake
about Java.  SWIG generates a known-only-at-compile-time set of Java code.
CMake prefers to know in advance what source code needs to be compiled.

So far, our Java support has been cobbled together and is rather fragile,
and I¹m trying to make it more robust.  I pulled in the UseJava.cmake code
from the CMake repo (it¹s not in a release yet), but the add_jar command
likes to have a list of .java files.

Any suggestions about how to have CMake handle generated files like this?

Thanks,
-dan
-- 
Daniel Blezek, PhD
Medical Imaging Informatics Innovation Center

P 127 or (77) 8 8886
T 507 538 8886
E blezek.dan...@mayo.edu

Mayo Clinic
200 First St. S.W.
Harwick SL-44
Rochester, MN 55905
mayoclinic.org
"It is more complicated than you think." -- RFC 1925

___
Powered by www.kitware.com

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

Please keep messages on-topic and check 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 advice for unit test structure

2009-04-02 Thread Daniel Blezek
Hi Robert,

  I don¹t have any suggestions about the compile time unit tests, but we¹ve
been using the Google testing framework for the last 6 months and have been
very happy with it.  I wrote up some details related to ITK here:

http://www.itk.org/Wiki/Proposals:Increasing_ITK_Code_Coverage#Google_Test

You can have multiple tests embedded in one executable, which is what the
gtest framework does.

Best regards,
-dan 


On 4/2/09 3:00 PM, "Robert Dailey"  wrote:

> Hi,
> 
> Currently we have a directory called "test" under each project we have. Each
> source file (CPP) results in 1 unit test project being created. So if we have
> a project named "foobar", it would be structured like this on the filesystem:
> 
> foobar/test/test1.cpp
> foobar/test/test2.cpp
> foobar/test/test3.cpp
> 
> And the generated visual studio projects (when created via CMake) would be:
> 
> foobar
> foobar_test1
> foobar_test2
> foobar_test3
> 
> Obviously this creates a lot of clutter in the solution explorer window in
> Visual Studio. Is there a more recommended practice for structuring unit tests
> in CMake? Personal advice is also welcome. One approach I'd like to take is
> where we only have two projects:
> 
> foobar
> foobar_test
> 
> And inside foobar_test, all of the sources under the /test/ directory would be
> included, so a single project compiles all unit tests.
> 
> foobar_test
>   test1.cpp
>   test2.cpp
>   test3.cpp
> 
> However, the reason why I'm currently not doing this is because of
> compile-time unit testing. Basically, some unit tests are designed to be
> successful if they fail to compile. For example, perhaps certain template
> parameters do not meet the requirements of a specific C++ concept, and thus
> rightfully fail. This unit test would be considered successful because we want
> to make sure that ONLY types matching this specific concept are accepted by
> the compiler.
> 
> If we include these source files in the same project, then it interrupts the
> whole compilation process. They have to be separate in order to work properly.
> 
> 
> ___
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake

-- 
Daniel Blezek, PhD
Medical Imaging Informatics Innovation Center

P 127 or (77) 8 8886
T 507 538 8886
E blezek.dan...@mayo.edu

Mayo Clinic
200 First St. S.W.
Harwick SL-44
Rochester, MN 55905
mayoclinic.org


___
Powered by www.kitware.com

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

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

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

[CMake] Nightly only tests

2009-04-17 Thread Daniel Blezek
Hi all,

  Before I expend too many brain cells on a Friday, I thought I¹d ask the
list.

  We are approaching 100 test in our project.  I want our developers to run
tests before they check in, but some of the tests can take upwards of a
minute to run.  Is there some way to mark a test as part of the Nightly
tests only, and skip it for developer builds?

  I know I could do this through a CMake option, but perhaps there is a
cleaner solution.

Thanks,
-dan

-- 
Daniel Blezek, PhD
Medical Imaging Informatics Innovation Center

P 127 or (77) 8 8886
T 507 538 8886
E blezek.dan...@mayo.edu

Mayo Clinic
200 First St. S.W.
Harwick SL-44
Rochester, MN 55905
mayoclinic.org


___
Powered by www.kitware.com

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

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

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

Re: [CMake] Nightly only tests

2009-04-17 Thread Daniel Blezek
Alex,

  Sure, that will do the trick, but that requires developers to remember the
-E. ;->

I suppose an example would help...

add_test ( ForNightly BUILDTYPES "Nightly"
${CMAKE_BINARY_DIR}/bin/LongRunning --iterations 1000 )

add_test ( ForExperimental BUILDTYPES "Experimental Continuous"
${CMAKE_BINARY_DIR}/bin/ShortRunning --iterations 10 )

add_test ( ForContinuous BUILDTYPES "Continuous"
${CMAKE_BINARY_DIR}/bin/MediumRunning --iterations 1000 )

A naked "ctest" would run only Experimental tests.  This could potentially
be made more flexible by adding "tags" to tests.

"ctest -tag Continuous" would run any tests with a "Continuous" tag.

Something like this would also be helpful for ITK, as it has 1200 tests and
takes several minutes to run.

Cheers,
-dan


On 4/17/09 2:03 PM, "Alexander Neundorf"  wrote:

> On Friday 17 April 2009, Daniel Blezek wrote:
>> Hi all,
>> 
>>   Before I expend too many brain cells on a Friday, I thought I¹d ask the
>> list.
>> 
>>   We are approaching 100 test in our project.  I want our developers to run
>> tests before they check in, but some of the tests can take upwards of a
>> minute to run.  Is there some way to mark a test as part of the Nightly
>> tests only, and skip it for developer builds?
>> 
>>   I know I could do this through a CMake option, but perhaps there is a
>> cleaner solution.
> Does "ctest -E " help, i.e. can these tests easily be
> summarized by their name with a regexp ?
> 
> Alex

-- 
Daniel Blezek, PhD
Medical Imaging Informatics Innovation Center

P 127 or (77) 8 8886
T 507 538 8886
E blezek.dan...@mayo.edu

Mayo Clinic
200 First St. S.W.
Harwick SL-44
Rochester, MN 55905
mayoclinic.org


___
Powered by www.kitware.com

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

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

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


Re: [CMake] Nightly only tests

2009-04-17 Thread Daniel Blezek
David,

  Ok, I¹ll do the CMake option, in the end this might be the best way to go.

Thanks for the help/suggestions,
-dan


On 4/17/09 3:33 PM, "David Cole"  wrote:

> I think you're thinking of "LABELS"...
>  
> See CVS CMake documentation for the LABELS property:
> cmake --help-property LABELS
> It would basically be like -E though. The default is to run everything. Label
> based running or name based running with -E or -R must be specified
> explicitly.
>  
> Dan, it's probably best to implement in terms of a CMake option. That way, you
> could have it OFF by default and exclude the commonly excluded tests. People
> who want the complete test suite would then have to turn ON the options
> explicitly.
>  
>  
> HTH,
> David
> 
>  
> On Fri, Apr 17, 2009 at 1:18 PM, Alexander Neundorf 
> wrote:
>> On Friday 17 April 2009, Daniel Blezek wrote:
>>> > Alex,
>>> >
>>> >   Sure, that will do the trick, but that requires developers to remember
>>> > the -E. ;->
>>> >
>>> > I suppose an example would help...
>>> >
>>> > add_test ( ForNightly BUILDTYPES "Nightly"
>>> > ${CMAKE_BINARY_DIR}/bin/LongRunning --iterations 1000 )
>>> >
>>> > add_test ( ForExperimental BUILDTYPES "Experimental Continuous"
>>> > ${CMAKE_BINARY_DIR}/bin/ShortRunning --iterations 10 )
>>> >
>>> > add_test ( ForContinuous BUILDTYPES "Continuous"
>>> > ${CMAKE_BINARY_DIR}/bin/MediumRunning --iterations 1000 )
>>> >
>>> > A naked "ctest" would run only Experimental tests.  This could potentially
>>> > be made more flexible by adding "tags" to tests.
>> 
>> Maybe something like this was added lately to cmake cvs and tests, there were
>> some commits which dealt with tests and something like tags or flags or
>> something...
>> 
>> Alex
>> _______
>> Powered by www.kitware.com <http://www.kitware.com/>
>> 
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>> 
>> Please keep messages on-topic and check the CMake FAQ at:
>> http://www.cmake.org/Wiki/CMake_FAQ
>> 
>> Follow this link to subscribe/unsubscribe:
>> http://www.cmake.org/mailman/listinfo/cmake
> 
> 

-- 
Daniel Blezek, PhD
Medical Imaging Informatics Innovation Center

P 127 or (77) 8 8886
T 507 538 8886
E blezek.dan...@mayo.edu

Mayo Clinic
200 First St. S.W.
Harwick SL-44
Rochester, MN 55905
mayoclinic.org


___
Powered by www.kitware.com

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

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

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

[CMake] CPack - skipping licensing screen

2009-04-24 Thread Daniel Blezek
Hi,

  I¹m not sure if there is a CPack-specific mailing list, direct me if I¹m
wrong.

  I find the empty license screen a little annoying in the NSIS installer
for windows.  This occurs when you don¹t specify a license file for your
installer.  CPack generates one for you, but a better behavior would be to
skip that step of the install entirely.

  Is this an easy fix?

Thanks,
-dan

-- 
Daniel Blezek, PhD
Medical Imaging Informatics Innovation Center

P 127 or (77) 8 8886
T 507 538 8886
E blezek.dan...@mayo.edu

Mayo Clinic
200 First St. S.W.
Harwick SL-44
Rochester, MN 55905
mayoclinic.org


___
Powered by www.kitware.com

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

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

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

Re: [CMake] CPack - skipping licensing screen

2009-04-24 Thread Daniel Blezek
Hi Bill, James,

  Easier than I expected.  If CPACK_RESOURCE_FILE_LICENSE is not defined,
set CPACK_RESOURCE_FILE_LICENSE_PROVIDED to 0, add a !if macro to the NSIS
installer script and happiness ensues.

  Here's the patch, the change worked in my installed version of CMake, but
I didn't run the tests.

-dan

Index: Modules/CPack.cmake
===
RCS file: /cvsroot/CMake/CMake/Modules/CPack.cmake,v
retrieving revision 1.43
diff -u -r1.43 CPack.cmake
--- Modules/CPack.cmake 5 Mar 2009 15:08:03 -   1.43
+++ Modules/CPack.cmake 24 Apr 2009 20:21:50 -
@@ -641,8 +641,15 @@
 
 cpack_set_if_not_set(CPACK_PACKAGE_DESCRIPTION_FILE
   "${CMAKE_ROOT}/Templates/CPack.GenericDescription.txt")
-cpack_set_if_not_set(CPACK_RESOURCE_FILE_LICENSE
-  "${CMAKE_ROOT}/Templates/CPack.GenericLicense.txt")
+
+if ( NOT DEFINED CPACK_RESOURCE_FILE_LICENSE )
+  set(CPACK_RESOURCE_FILE_LICENSE
+"${CMAKE_ROOT}/Templates/CPack.GenericLicense.txt")
+  set(CPACK_RESOURCE_FILE_LICENSE_PROVIDED "0")
+else ( NOT DEFINED CPACK_RESOURCE_FILE_LICENSE )
+  set(CPACK_RESOURCE_FILE_LICENSE_PROVIDED "1")
+endif ( NOT DEFINED CPACK_RESOURCE_FILE_LICENSE )
+
 cpack_set_if_not_set(CPACK_RESOURCE_FILE_README
   "${CMAKE_ROOT}/Templates/CPack.GenericDescription.txt")
 cpack_set_if_not_set(CPACK_RESOURCE_FILE_WELCOME
Index: Modules/NSIS.template.in
===
RCS file: /cvsroot/CMake/CMake/Modules/NSIS.template.in,v
retrieving revision 1.36
diff -u -r1.36 NSIS.template.in
--- Modules/NSIS.template.in7 Apr 2009 19:31:51 -   1.36
+++ Modules/NSIS.template.in24 Apr 2009 20:21:50 -
@@ -516,7 +516,9 @@
 ;Pages
   !insertmacro MUI_PAGE_WELCOME
 
-  !insertmacro MUI_PAGE_LICENSE "@CPACK_RESOURCE_FILE_LICENSE@"
+  !if @CPACK_RESOURCE_FILE_LICENSE_PROVIDED@
+!insertmacro MUI_PAGE_LICENSE "@CPACK_RESOURCE_FILE_LICENSE@"
+  !endif
   Page custom InstallOptionsPage
   !insertmacro MUI_PAGE_DIRECTORY
   


  


On 4/24/09 11:39 AM, "Bill Hoffman"  wrote:

> James Bigler wrote:
>> On Fri, Apr 24, 2009 at 7:07 AM, Daniel Blezek 
>> wrote:
>>> Hi,
>>> 
>>>   I¹m not sure if there is a CPack-specific mailing list, direct me if I¹m
>>> wrong.
>>> 
>>>   I find the empty license screen a little annoying in the NSIS installer
>>> for windows.  This occurs when you don¹t specify a license file for your
>>> installer.  CPack generates one for you, but a better behavior would be to
>>> skip that step of the install entirely.
>>> 
>>>   Is this an easy fix?
>>> 
>>> Thanks,
>>> -dan
>> 
>> Depends on your definition of easy.  The NSIS installer is script
>> based.  The script that is used to generate the installer is found in
>> the Modules/NSIS.template.in file.  In that file you will see a pages
>> section:
>> 
>> ;
>> ;Pages
>>   !insertmacro MUI_PAGE_WELCOME
>> 
>>   !insertmacro MUI_PAGE_LICENSE "@CPACK_RESOURCE_FILE_LICENSE@"
>>   Page custom InstallOptionsPage
>>   !insertmacro MUI_PAGE_DIRECTORY
>> 
>>   ;Start Menu Folder Page Configuration
>> ...
>> 
>> See the insertmacro MUI_PAGE_LICENSE line?  That's the one that
>> inserts the license dialog in your installer.  You can see the
>> documentation for these pages here:
>> http://nsis.sourceforge.net/Docs/Modern%20UI/Readme.html
>> 
>> Unfortunately, I don't see an option to deactivate a MUI page after
>> you inserted it.  There could be one (I'm only just learning NSIS
>> script).
>> 
>> You have a some of options at this point that increase in complexity
>> and time to solution.
>> 
>> 1. Edit your installed copy of NSIS.template.in to exclude that page.
>> Easiest to do, but least maintainable or portable.
>> 2. Copy NSIS.template.in and somehow get CMake/CPack to use that
>> version instead of the installed version.  You have to maintain your
>> own copy, but it should be portable.
> 
> All you have to do is use CMAKE_MODULE_PATH to change to a different
> NSIS.template.in file.
> 
> 
>> 3. Submit a patch to CMake that makes that page optional (say for
>> example if you don't specify a license file).  Everyone gets to
>> benefit, but you have to put in the effort and wait for a release or
>> use a nightly.
> That would be good as well.
> 
> -Bill
> ___
> Powered by www.kitware.com
> 
> Visit other Kitware o

Re: [CMake] Coverage information overestimated? Globbing for *.gcno instead of *.gcda?

2009-04-27 Thread Daniel Blezek
Hi Bill,

  I bumped into this problem as well.  We had several classes that were
compiled, but no methods in them were run.  CTest ignored them and we didn't
have any coverage information on our dashboard.  I would second this
recommendation to accumulate coverage based on what is compiled.  As far as
I'm concerned code that is not executed is totally broken, but there is no
way to have CTest/CDash tell us.

-dan


On 4/27/09 10:01 AM, "Bill Hoffman"  wrote:

> Tom Vercauteren wrote:
>>>> I just saw that when ctest is used to generate coverage information,
>>>> it looks for (gc)da files in the build directory - cf.
>>>> cmCTestCoverageHandler::FindGCovFiles in cmCTestCoverageHandler.cxx.
>>>> 
>>>> If I understand it correctly, when everything is setup correctly for a
>>>> coverage build:
>>>>  - gcc generates (gc)no files at compile time
>>>>  - (gc)da files are generated at run time - i.e. when the unit tests are
>>>> run
>>>> 
>>>> So, it seems to me that for each (gc)da file we are sure that a (gc)no
>>>> file exists but not the other way round.
>>>> 
>>>> Since ctest is looking for (gc)da files, it seems to me that it will
>>>> lead to over-estimating the coverage information. Indeed, some code
>>>> can be compiled but never executed by the unit tests.
>>>> 
>>> I don't think this is a problem.   Do you have an example that shows the
>>> problem?  If the code is not run, it does not produce any coverage
>>> information in any file for ctest to find???
>> 
>> The reason I am looking at this is because I would like to get a
>> global coverage percentage that reflects the coverage of my project as
>> a whole as opposed to only the subset that has some unit tests.
>> 
>> So, it would be interesting for me to show on a cdash-dashboard this
>> compiled but untested code (at least not automatically by ctest). One
>> way to do that might be to use gcno files instead of gcda files in
>> ctest.
>> 
>> The coverage information that I would get form it is that when a gcno
>> file exists but has no gcda counterpart, there is no coverage at all.
>> Right now, this is silently discarded.
>> 
>> Tom
>> 
>> P.S.: Thanks for the lightning fast answer!
>> 
> CTest does that for you.  As you run tests ctest will accumulate the
> test code that is actually run.  I am not sure I understand the coverage
> information you are looking for?  What does compile time coverage mean?
> 
> 
> -Bill
> ___
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake

-- 
Daniel Blezek, PhD
Medical Imaging Informatics Innovation Center

P 127 or (77) 8 8886
T 507 538 8886
E blezek.dan...@mayo.edu

Mayo Clinic
200 First St. S.W.
Harwick SL-44
Rochester, MN 55905
mayoclinic.org


___
Powered by www.kitware.com

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

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

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


[CMake] Double builds required in XCode w/CMake when changing UI code in QtDesigner

2009-04-29 Thread Daniel Blezek
Sorry if this has been discussed before, but I couldn¹t find anything in
Google.

When building with XCode and Qt, I have to build twice when I change my .ui
files in QtDesigner.  Apparently the build order is wrong?  The first build
re-generates the ui_*.h files, but doesn¹t trigger the dependencies.  The
second build does the right thing.

Something I can live with (my fingers are now trained to hit Command-B
twice), but perhaps there is an easy fix?

In my CMakeLists.txt file, this is the order of Qt-related operations:

set ( SumatraSource
  ...
)

set ( SumatraHeaders
... )
qt4_wrap_cpp ( SumatraMOCSource ${SumatraHeaders} )

set ( SumatraUIS
... )

qt4_wrap_ui ( SumatraUISHeaders ${SumatraUIS} )

qt4_add_resources ( SumatraResources Resources.qrc )

add_executable ( Sumatra ... )

Perhaps this is the wrong order?

Thanks,
-dan

-- 
Daniel Blezek, PhD
Medical Imaging Informatics Innovation Center

P 127 or (77) 8 8886
T 507 538 8886
E blezek.dan...@mayo.edu

Mayo Clinic
200 First St. S.W.
Harwick SL-44
Rochester, MN 55905
mayoclinic.org


___
Powered by www.kitware.com

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

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

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

Re: [CMake] Double builds required in XCode w/CMake when changing UI code in QtDesigner

2009-04-29 Thread Daniel Blezek
Hi Mike,

  Here is my actual add_executable call.

add_executable ( Sumatra ${GUI_TYPE} ${SumatraSource} ${SumatraUISHeaders}
${SumatraMOCSource} ${SumatraResources} )

I may try swizzling the order around,
Thanks,
-dan


On 4/29/09 3:17 PM, "Michael Jackson"  wrote:

> You might try the following:
> 
> 
> add_executable ( Sumatra  ${SumatrSources} ${SumatraUISHeaders} )
> 
> and see what happens.
> 
> 
> Here is a snippet from one of my own projects:
> 
> 
> # -- Run MOC and UIC on the necessary files
> QT4_ADD_RESOURCES( Generated_RC_SRCS ${ModelEditor_RCS} )
> 
> # this will run uic on .ui files:
> QT4_WRAP_UI( Generated_UI_HDRS ${ModelEditor_UIS} )
> 
> # and finally this will run moc:
> QT4_WRAP_CPP( Generated_MOC_SRCS ${ModelEditor_MOC_HDRS} )
> 
> #-- Put the generated files into their own group for IDEs
> MXA_GENERATED_PROPERTIES(ModelEditor/Generated
>  "${Generated_UI_HDRS}"
>  "${Generated_MOC_SRCS}")
> 
> # -- Finally set the Project Sources to include all the sources
> SET (${PROJECT_NAME}_PROJECT_SRCS
>  ${ModelEditor_SRCS}
>  ${ModelEditor_MOC_HDRS}
>  ${Generated_RC_SRCS}
>  ${Generated_UI_HDRS}
>  ${Generated_MOC_SRCS}
> )
> ADD_EXECUTABLE( ${ModelEditor_EXE_NAME} ${GUI_TYPE} ${$
> {PROJECT_NAME}_PROJECT_SRCS} )
> 
> _
> Mike Jackson  mike.jack...@bluequartz.net
> BlueQuartz Software    www.bluequartz.net
> Principal Software Engineer  Dayton, Ohio
> 
> 
> 
> On Apr 29, 2009, at 3:56 PM, Daniel Blezek wrote:
> 
>> Sorry if this has been discussed before, but I couldn¹t find
>> anything in Google.
>> 
>> When building with XCode and Qt, I have to build twice when I change
>> my .ui files in QtDesigner.  Apparently the build order is wrong?
>> The first build re-generates the ui_*.h files, but doesn¹t trigger
>> the dependencies.  The second build does the right thing.
>> 
>> Something I can live with (my fingers are now trained to hit Command-
>> B twice), but perhaps there is an easy fix?
>> 
>> In my CMakeLists.txt file, this is the order of Qt-related operations:
>> 
>> set ( SumatraSource
>>   ...
>> )
>> 
>> set ( SumatraHeaders
>> ... )
>> qt4_wrap_cpp ( SumatraMOCSource ${SumatraHeaders} )
>> 
>> set ( SumatraUIS
>> ... )
>> 
>> qt4_wrap_ui ( SumatraUISHeaders ${SumatraUIS} )
>> 
>> qt4_add_resources ( SumatraResources Resources.qrc )
>> 
>> add_executable ( Sumatra ... )
>> 
>> Perhaps this is the wrong order?
>> 
>> Thanks,
>> -dan
>> 
>> -- 
>> Daniel Blezek, PhD
>> Medical Imaging Informatics Innovation Center
>> 
>> P 127 or (77) 8 8886
>> T 507 538 8886
>> E blezek.dan...@mayo.edu
>> 
>> Mayo Clinic
>> 200 First St. S.W.
>> Harwick SL-44
>> Rochester, MN 55905
>> mayoclinic.org
>> 
>> ___
>> Powered by www.kitware.com
>> 
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>> 
>> Please keep messages on-topic and check the CMake FAQ at:
>> http://www.cmake.org/Wiki/CMake_FAQ
>> 
>> Follow this link to subscribe/unsubscribe:
>> http://www.cmake.org/mailman/listinfo/cmake
> 

-- 
Daniel Blezek, PhD
Medical Imaging Informatics Innovation Center

P 127 or (77) 8 8886
T 507 538 8886
E blezek.dan...@mayo.edu

Mayo Clinic
200 First St. S.W.
Harwick SL-44
Rochester, MN 55905
mayoclinic.org


___
Powered by www.kitware.com

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

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

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


Re: [CMake] Double builds required in XCode w/CMake when changing UI code in QtDesigner

2009-04-30 Thread Daniel Blezek
Added a Qt note.


On 4/30/09 9:48 AM, "Tobias Rudolph"  wrote:

> Seems like a duplicate of this one:
> http://public.kitware.com/Bug/view.php?id=8833
> 
> 
> cheers,
> Tobias
> 
> 
> On 30 Apr 2009, at 16:40, Daniel Blezek wrote:
> 
>> Thanks Bill,
>> 
>>  Here's the zip.
>> 
>> mkdir QtBug-xcode/
>> cd QtBug-xcode/
>> cmake -G Xcode ../QtBug
>> open QtBug.xcodeproj/
>> 
>> Build with Command-B
>> Modify HelloWorld.ui in QtDesigner
>> Bulid with Command-B (runs script)
>> Build with Command-B (builds HelloWorld.cxx)
>> 
>> Thanks,
>> -dan
>> 
>> 
>> 
>> On 4/29/09 6:53 PM, "Bill Hoffman"  wrote:
>> 
>>> Daniel Blezek wrote:
>>>> Hi Mike,
>>>> 
>>>>  Here is my actual add_executable call.
>>>> 
>>>> add_executable ( Sumatra ${GUI_TYPE} ${SumatraSource} $
>>>> {SumatraUISHeaders}
>>>> ${SumatraMOCSource} ${SumatraResources} )
>>>> 
>>>> I may try swizzling the order around,
>>>> Thanks,
>>>> -dan
>>>> 
>>> 
>>> Sounds like a bug.  If you could create a very small test case and
>>> create a bug, I will take a look at it.
>>> 
>>> -Bill
>> 
>> -- 
>> Daniel Blezek, PhD
>> Medical Imaging Informatics Innovation Center
>> 
>> P 127 or (77) 8 8886
>> T 507 538 8886
>> E blezek.dan...@mayo.edu
>> 
>> Mayo Clinic
>> 200 First St. S.W.
>> Harwick SL-44
>> Rochester, MN 55905
>> mayoclinic.org
>> 
>> 
>> ___
>> Powered by www.kitware.com
>> 
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>> 
>> Please keep messages on-topic and check the CMake FAQ at:
>> http://www.cmake.org/Wiki/CMake_FAQ
>> 
>> Follow this link to subscribe/unsubscribe:
>> http://www.cmake.org/mailman/listinfo/cmake
> 

-- 
Daniel Blezek, PhD
Medical Imaging Informatics Innovation Center

P 127 or (77) 8 8886
T 507 538 8886
E blezek.dan...@mayo.edu

Mayo Clinic
200 First St. S.W.
Harwick SL-44
Rochester, MN 55905
mayoclinic.org


___
Powered by www.kitware.com

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

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

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


[CMake] ctest -j N behavior

2009-06-08 Thread Daniel Blezek
Hi all,

  Our valgrind checks consume a lot of time, so I was looking into running
them in parallel on our 8 core test box.  If I run

ctest ­T MemCheck

All is well.  However, if I run:

ctest ­T MemCheck ­j 2

CTest runs the tests, but without valgrind.  I¹m just guessing that ctest
isn¹t able to do more than run tests in parallel?  If there is some way to
do this, please let me know.

Best regards,
-dan


-- 
Daniel Blezek, PhD
Medical Imaging Informatics Innovation Center

P 127 or (77) 8 8886
T 507 538 8886
E blezek.dan...@mayo.edu

Mayo Clinic
200 First St. S.W.
Harwick SL-44
Rochester, MN 55905
mayoclinic.org


___
Powered by www.kitware.com

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

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

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

Re: [CMake] Generator for Xcode 3.0+?

2009-06-19 Thread Daniel Blezek
Hi,

  For some of our code, I need to have an environment variable set, and for
a while I had OpenMP support turned on in Xcode.  CMake doesn't support
these things directly, so I wrote a short AppleScript.  Use it FWIW.

#! /bin/sh

TABWIDTH=`osascript << ENDOFSCRIPT
tell application "Xcode"
tell project "Sumatra"
-- set foo to get value of build setting "GCC_VERSION" of every
build configuration
-- display value of foo
set value of build setting "GCC_VERSION" of every build
configuration to "4.2"
set value of build setting "ENABLE_OPENMP_SUPPORT" of every build
configuration to "YES"
tell executable "Sumatra"
make new environment variable with properties
{name:"DCMDICTPATH", value:"/opt/local/lib/dicom.dic", active:true}
--set myEnv to environment variable
--set myEnv's value to "Foo"
--name of myEnv
-- add environment variable "DCMDICTPATH"
end tell
end tell
-- set the environment variable "DCMDICTPATH" to
"/opt/local/lib/dicom.dic" of executable "Sumatra"
end tell
`

# echo -n "%%%{PBXSelection}%%%"
# expand -t ${TABWIDTH} <&0
# echo -n "%%%{PBXSelection}%%%"





On 6/18/09 6:42 PM, "Doug Gregor"  wrote:

> On Thu, Jun 18, 2009 at 3:04 PM, E. Wing wrote:
>> On 6/18/09, Michael Jackson  wrote:
>>> What is the difference and what does a project that is Xcode 3.0+
>>> compatible gain you? In other words, what are we missing by NOT having
>>> a "true" Xcode 3.0+ compatible project?
>>> 
>> 
>> Since CMake does a very good job with dependency relationships, one
>> minor thing that would be nice is to enable "Build independent targets
>> in parallel" by default. For projects with lots and lots of tiny
>> targets with few dependencies (e.g. OpenSceneGraph), this can speed up
>> builds by several magnitudes.
> 
> That's exactly the option that triggered my question :)
> 
>   - Doug
> ___
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake

-- 
Daniel Blezek, PhD
Medical Imaging Informatics Innovation Center

P 127 or (77) 8 8886
T 507 538 8886
E blezek.dan...@mayo.edu

Mayo Clinic
200 First St. S.W.
Harwick SL-44
Rochester, MN 55905
mayoclinic.org


___
Powered by www.kitware.com

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

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

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


Re: [CMake] Ctest and CxxTest

2009-09-21 Thread Daniel Blezek
We tackled this using a "hack-ish" CMake command for Google Tests that found
all our tests in the source code, and generated CTest commands for them.
You could do a similar thing on a test suite.  Details are here:

http://www.itk.org/Wiki/Proposals:Increasing_ITK_Code_Coverage#Google_Test

-dan


On 9/20/09 10:40 AM, "Wojciech Migda"  wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> 
> 
> Philip Lowman pisze:
>> You could split up your testcases into multiple CxxTest classes.
>> 
>> You could check to see if the cxxtest code generator supports
>> preprocessor statements in generating test runners.  Then you could
>> group your tests by #ifdef / #endif...?  Alternatively if it's not
>> supported you may be able to modify the code generator to output
>> multiple runners depending on the tests you want to run, e.g.
>> cxxtestgen.pl --enable-test foo
>> 
>> I think splitting things up probably would be the easiest approach.
>> 
>> 
>> On Sun, Sep 20, 2009 at 10:01 AM, Wojciech Migda
>>  wrote:
>> 
>> Hi all,
>> 
>> I was wondering about an improvement for the way CxxTest unit tests
>>  are coupled with CTest. Right now when CTest submits results to
>> CDash the tests are counted by binaries executed. In my unit tests
>> each binary corresponds to an entire suite (approx. 150 testcases
>> grouped within single CxxTest class). I'd see it very useful to
>> have CTest operate with CxxTest based unit tests on a testcase
>> level. Has anyone stumbled upon similar problem and got ideas /
>> solutions ?
>> 
>> Thanks for assistance,
>> 
>> -Wojciech
>> 
> Indeed, splitting is the easiest approach, albeit it adds additional
> effort - when a new test is added to a suite CMakeLists.txt has to be
> updated accordingly.
> 
> If my idea how CTest works when it uploads results to CDash is correct
> then it only looks at the return code of the executed binary and
> captures its output. What if there was an option for CTest to work in
> a multiple-testcases mode where the output returned by the executed
> binary would be formatted in a way so as CTest would be able to parse
> it and process into CDash xml files with information on all tests
> executed. Just a thought, I have no idea how complicated that would
> turn out to be.
> 
> I also thought about the binary itself being able to run single
> testcases on the basis of command line arguments, but that would
> require parallel information being stored in CMakeLists.txt, which
> again add effort.
> 
> I'll see if I have more ideas.
> 
> Thanks,
> 
> - -Wojtek
> 
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v2.0.7 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> 
> iD8DBQFKtkz70iFl+nAyImcRAsPSAJ4yMjKSb96NZ02awttzwwu/nHZRhgCfQ2KZ
> VEM63SdgrUUA4OIXGApKJd8=
> =4utB
> -END PGP SIGNATURE-
> 
> 
> --
> Bezplatne konto i limit do 100 tys. Otwierasz?
> http://link.interia.pl/f2342
> 
> _______
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake

-- 
Daniel Blezek, PhD
Medical Imaging Informatics Innovation Center

P 127 or (77) 8 8886
T 507 538 8886
E blezek.dan...@mayo.edu

Mayo Clinic
200 First St. S.W.
Harwick SL-44
Rochester, MN 55905
mayoclinic.org


___
Powered by www.kitware.com

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

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

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


Re: [CMake] CTest - C Unit Testing Framework

2009-10-06 Thread Daniel Blezek
I'd second the GoogleTest framework.  However, it is strictly C++ code.
CMake has recently integrated support for automatic detection of GoogleTest
(and CTest?) tests by parsing your test code.

-dan


On 10/6/09 10:45 AM, "Tyler Roscoe"  wrote:

> On Tue, Oct 06, 2009 at 09:42:23AM -0600, Dixon, Shane wrote:
>> I'm using CMake for all of my building.  Currently I'm just working on
>> Windows XP, but I'd like to leave things open for Linux builds in the
>> near future.  Any suggestions on the best testing framework for a C
>> project that will be cross-platform compatible and I can use it with
>> Windows and Linux?  I'd like something that works well with CTest.
>> (i.e. a command-line interface is probably ideal).
> 
> We use googletest and it works well. Not sure if it has C support (we're
> primarily a C++ shop).
> 
> tyler
> ___
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake

-- 
Daniel Blezek, PhD
Medical Imaging Informatics Innovation Center

P 127 or (77) 8 8886
T 507 538 8886
E blezek.dan...@mayo.edu

Mayo Clinic
200 First St. S.W.
Harwick SL-44
Rochester, MN 55905
mayoclinic.org


___
Powered by www.kitware.com

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

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

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


[CMake] Module FindOpenMP fails on Intel compiler

2009-11-23 Thread Daniel Blezek
Hi all,

  The FindOpenMP has some broken logic.  For the Intel compiler, the
­fopenmp is accepted because ICC is based off of the GCC source code.
However, this flag just causes a warning.  The order of checking flags
should have the Intel flag (-openmp) listed before the GCC flag (-fopenmp).

  If this could be fixed, it would be greatly appreciated.  I do build a
CMake nightly using the Intel compiler, so this could be tested...

Thanks,
-dan

-- 
Daniel Blezek, PhD
Medical Imaging Informatics Innovation Center

P 127 or (77) 8 8886
T 507 538 8886
E blezek.dan...@mayo.edu

Mayo Clinic
200 First St. S.W.
Harwick SL-44
Rochester, MN 55905
mayoclinic.org


___
Powered by www.kitware.com

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

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

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

[CMake] configure_file without continuous re-build

2010-01-12 Thread Daniel Blezek
We have a large-ish system.  Deep within an included utility class, I have
this code:

CONFIGURE_FILE(${DCMTK_SOURCE_DIR}/osconfig.h.in
   ${DCMTK_BINARY_DIR}/include/dcmtk/config/osconfig.h)

However, every time I touch a CMake file, ³osconfig.h² is regenerated,
causing nearly the entire library to re-build because of dependancies.  Is
this a good/proper/recommended way to guard against regeneration of the
file?

# NB: you would need to delete the configured osconfig.h to re-generate.
if ( NOT EXISTS ${DCMTK_BINARY_DIR}/include/dcmtk/config/osconfig.h)
message ( STATUS "Reconfigure" )
CONFIGURE_FILE(${DCMTK_SOURCE_DIR}/osconfig.h.in
   ${DCMTK_BINARY_DIR}/include/dcmtk/config/osconfig.h)
endif()


Or is there some little known, little documented CMake feature that I don¹t
know about?

Thanks,
-dan

-- 
Daniel Blezek, PhD
Medical Imaging Informatics Innovation Center

P 127 or (77) 8 8886
T 507 538 8886
E blezek.dan...@mayo.edu

Mayo Clinic
200 First St. S.W.
Harwick SL-44
Rochester, MN 55905
mayoclinic.org


___
Powered by www.kitware.com

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

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

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

Re: [CMake] configure_file without continuous re-build

2010-01-12 Thread Daniel Blezek
Hi Mike,

  Sorry, I guess I wasn't quite clear.  The re-builds occur when I touch any
CMakeLists.txt file in the entire project.  Since we're under active
development, new source files are being added fairly frequently.  I didn't
want re-builds to trigger each time a developer adds a new class.

  I believe that configure_file() is re-run whenever CMake does a
"Generate", not only when the .in file is modified.  On a normal build this
isn't an issue, but is a problem for us.

  Putting the "NOT EXISTS" guard seems to solve the problem, but is a little
ugly.

Cheers,
-dan


On 1/12/10 3:00 PM, "Michael Jackson"  wrote:

> you shouldn't have to do that. There are multitudes of projects that
> do exactly what you are doing and don't have continuous rebuilds. Now,
> having said that I am _assuming_ that osconfig.h.in is NOT being
> changed, generated, updated or in any way changed? osconfig.h.in being
> changed would cause "configure_file()" to re-run which will regenerate
> the osconfig.h file.
> 
>Early in the HDF5/CMake port we were doing exactly that which
> caused HDF5 to be rebuilt just about completely because the "H5conf.h"
> file was always being generated at cmake time.
> 
> _
> Mike Jackson  mike.jack...@bluequartz.net
> BlueQuartz Softwarewww.bluequartz.net
> Principal Software Engineer      Dayton, Ohio
> 
> On Jan 12, 2010, at 3:51 PM, Tyler Roscoe wrote:
> 
>> On Tue, Jan 12, 2010 at 02:09:36PM -0600, Daniel Blezek wrote:
>>> CONFIGURE_FILE(${DCMTK_SOURCE_DIR}/osconfig.h.in
>>>   ${DCMTK_BINARY_DIR}/include/dcmtk/config/osconfig.h)
>>> 
>>> However, every time I touch a CMake file, ³osconfig.h² is
>>> regenerated,
>>> causing nearly the entire library to re-build because of
>>> dependancies.  Is
>>> this a good/proper/recommended way to guard against regeneration of
>>> the
>>> file?
>> 
>> You could configure_file() to a temporary location, then
>> 'cmake -E copy_if_different' from the temp location to the real
>> location. This way, the real osconfig.h is only updated (and the
>> dependent parts of the build are re-compiled) if something has
>> changed.
>> 
>> tyler
>> ___
>> Powered by www.kitware.com
>> 
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>> 
>> Please keep messages on-topic and check the CMake FAQ at:
>> http://www.cmake.org/Wiki/CMake_FAQ
>> 
>> Follow this link to subscribe/unsubscribe:
>> http://www.cmake.org/mailman/listinfo/cmake
> 
> _______
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake

-- 
Daniel Blezek, PhD
Medical Imaging Informatics Innovation Center

P 127 or (77) 8 8886
T 507 538 8886
E blezek.dan...@mayo.edu

Mayo Clinic
200 First St. S.W.
Harwick SL-44
Rochester, MN 55905
mayoclinic.org


___
Powered by www.kitware.com

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

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

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


Re: [CMake] configure_file without continuous re-build

2010-01-12 Thread Daniel Blezek
Hmmm,  I'll dig a little deeper to see what's hapening.

Thanks,
-dan


On 1/12/10 4:25 PM, "Bill Hoffman"  wrote:

> Daniel Blezek wrote:
>> Hi Mike,
>> 
>>   Sorry, I guess I wasn't quite clear.  The re-builds occur when I touch any
>> CMakeLists.txt file in the entire project.  Since we're under active
>> development, new source files are being added fairly frequently.  I didn't
>> want re-builds to trigger each time a developer adds a new class.
>> 
>>   I believe that configure_file() is re-run whenever CMake does a
>> "Generate", not only when the .in file is modified.  On a normal build this
>> isn't an issue, but is a problem for us.
>> 
>>   Putting the "NOT EXISTS" guard seems to solve the problem, but is a little
>> ugly.
>> 
> configure_file will only write the file if it changes.   You must be
> changing the file each time cmake is run, which is bad
> 
> -Bill

-- 
Daniel Blezek, PhD
Medical Imaging Informatics Innovation Center

P 127 or (77) 8 8886
T 507 538 8886
E blezek.dan...@mayo.edu

Mayo Clinic
200 First St. S.W.
Harwick SL-44
Rochester, MN 55905
mayoclinic.org


___
Powered by www.kitware.com

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

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

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


Re: [CMake] git too difficult CMake switching to sccs

2010-04-01 Thread Daniel Blezek
Hmmm, SCCS seems a bit unusable, especially for noobs.  Based on this post
http://www.newt.com/scm/rcs-sccs, I suggest we move to RCS.

One question: what is this thing called a "3.5 inch floppy"?

Happy 4/1/10


On 4/1/10 6:18 AM, "Bill Hoffman"  wrote:

> After trying git for a while, the CMake developers have decided that git
>   is way too complicated, and allows too many edits to take place
> simultaneously.   So, we have decided to use sccs instead.  With sccs,
> only one developer at a time can change a file, this avoids conflicting
> edits to being made to the source tree, and should increase the
> stability of CMake.  Since there are no network protocols supported by
> sccs, we will have to use a single SAMBA share to host the repository.
> Since we can not export this share outside Kitware, only developers
> located in the Clifton Park office of Kitware will be able to checkout a
> file for edit.  If external developers need to change a file, they will
> have to email one of the CMake developers and ask them to check it out
> locally at Kitware.  Once the CMake dev gets a lock on the file, we will
> email that version to the outside contributor.  After changes are made,
> the file should be emailed back to Kitware, or sent on a 3.5 inch floppy
> disk to:
> 
> CMake SCCS revisions at Kitware
> 28 Corporate Drive
> Clifton Park, NY 12065
> 
> The change will happen today and today only.
> 
> -Bill
> 
> 

-- 
Daniel Blezek, PhD
Medical Imaging Informatics Innovation Center

P 127 or (77) 8 8886
T 507 538 8886
E blezek.dan...@mayo.edu

Mayo Clinic
200 First St. S.W.
Harwick SL-44
Rochester, MN 55905
mayoclinic.org


___
Powered by www.kitware.com

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

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

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


[CMake] OpenMP differences between command line and Xcode

2010-06-08 Thread Daniel Blezek
Hi,

  We¹ve just started building our OpenMP based code using Xcode on Mac OS X
10.6.  When we build using Makefiles with OpenMP turned on (through the
FindOpenMP.cmake module), all goes well.  Under Xcode, however, we are not
linking to the OpenMP libraries.  I tracked this down to a difference in the
final link line.

Under Makefiles we have:

Linking CXX executable ../bin/NoOp

/usr/bin/c++  -fopenmp


Under Xcode, the ­fopenmp flag is missing.  I suspected that the Makefiles
are using OpenMP_CXX_FLAGS ³under the hood², but the same code is not being
used by the Xcode generator.  Can anyone help out with this issue?

Cheers,
-dan

P.S.  The simple workaround is to set
CMAKE_EXE_LINKER_FLAGS:STRING=-fopenmp
in CMakeCache.txt


-- 
Daniel Blezek, PhD
Medical Imaging Informatics Innovation Center

P 127 or (77) 8 8886
T 507 538 8886
E blezek.dan...@mayo.edu

Mayo Clinic
200 First St. S.W.
Harwick SL-44
Rochester, MN 55905
mayoclinic.org


___
Powered by www.kitware.com

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

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

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

[CMake] Converting a OpenCL program into a C++ header?

2010-06-15 Thread Daniel Blezek
Hi,

  We would like to convert an OpenCL program written in a separate file to a
C++ header (essentially a long string).

For example, if my OpenCL program is in the file Square.cl

__kernel square(   
   __global float* input,
   __global float* output,
   const unsigned int count)
{  
   int i = get_global_id(0);
   if(i < count)   
   output[i] = input[i] * input[i];
}  

I¹d like to turn it into something like this in Square.h:

const char *KernelSource = "\n" \
"__kernel square(   \n"
\
"   __global float* input,  \n"
\
"   __global float* output, \n"
\
"   const unsigned int count)   \n"
\
"{  \n"
\
"   int i = get_global_id(0);   \n"
\
"   if(i < count)   \n"
\
"   output[i] = input[i] * input[i];\n"
\
"}  \n"
\
"\n";

So that my OpenCL code can be directly compiled into my executable.  This is
also useful for OpenGL shaders.

The question: is this something that CMake could do?  If so, any examples
where to begin looking?

Thanks,
-dan
-- 
Daniel Blezek, PhD
Medical Imaging Informatics Innovation Center

P 127 or (77) 8 8886
T 507 538 8886
E blezek.dan...@mayo.edu

Mayo Clinic
200 First St. S.W.
Harwick SL-44
Rochester, MN 55905
mayoclinic.org


___
Powered by www.kitware.com

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

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

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

Re: [CMake] Converting a OpenCL program into a C++ header?

2010-06-15 Thread Daniel Blezek
Hi Stefan,

  Yes, I¹ve done this sort of thing with Lua (which is built as part of our
code), but I¹d prefer to do this with CMake to avoid the extra headache of
maintaining my code.  I suspect it¹s just a few lines (but knowing the right
few lines is the key).

Thanks,
-dan


On 6/15/10 4:33 PM, "Stefan Buschmann"  wrote:

> Am 15.06.2010 23:13, schrieb Daniel Blezek:
>>  Converting a OpenCL program into a C++ header? Hi,
>>  
>>   We would like to convert an OpenCL program written in a separate file to a
>> C++ header (essentially a long string).
>>  
>> For example, if my OpenCL program is in the file Square.cl
>>  
>> __kernel square(
>>__global float* input,
>>__global float* output,
>>const unsigned int count)
>> {   
>>int i = get_global_id(0);
>>if(i < count)
>>output[i] = input[i] * input[i];
>> }   
>>  
>> I¹d like to turn it into something like this in Square.h:
>>  
>> const char *KernelSource = "\n" \
>> "__kernel square(   \n" \
>> "   __global float* input,  \n" \
>> "   __global float* output, \n" \
>> "   const unsigned int count)   \n" \
>> "{  \n" \
>> "   int i = get_global_id(0);   \n" \
>> "   if(i < count)   \n" \
>> "   output[i] = input[i] * input[i];\n" \
>> "}  \n" \
>> "\n";
>>  
>> So that my OpenCL code can be directly compiled into my executable.  This is
>> also useful for OpenGL shaders.
>>  
>> The question: is this something that CMake could do?  If so, any examples
>> where to begin looking?
>>  
> You could write a little application that reads in the source file and
> generates the header file just as in your example. Then you could use CMake to
> execute that application e.g. using add_custom_command() before building your
> executables that include the generated header files. You could even build the
> tool itself as a dependency first.
> 
> Hope that helps...
> 
> Stefan
> 
> 
> 
> ___
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake

-- 
Daniel Blezek, PhD
Medical Imaging Informatics Innovation Center

P 127 or (77) 8 8886
T 507 538 8886
E blezek.dan...@mayo.edu

Mayo Clinic
200 First St. S.W.
Harwick SL-44
Rochester, MN 55905
mayoclinic.org


___
Powered by www.kitware.com

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

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

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

Re: [CMake] Building a Version Header

2010-07-08 Thread Daniel Blezek
One alternative is to use git itself.  There is a "git smudge" option that
can do much of what you are asking.  However, I've never done this sort of
thing.

http://progit.org/book/ch7-2.html

Just $0.02,
-dan


On 7/8/10 3:31 PM, "Tyler Roscoe"  wrote:

> On Wed, Jul 07, 2010 at 10:43:15PM -0400, John Drescher wrote:
>> On Wed, Jul 7, 2010 at 9:44 PM, Clark Gaebel  wrote:
>>> I would like to generate file that looks something like this:
>>> 
>>>    // version.h
>>>    #define VERSION "v0.1-345-ga77ede8"
>> 
>> You want to do that with configure_file
> 
> The upside of this approach is that it's simple. The downside is that it
> is only run (and thus your version header is only updated) whenever
> CMake runs. It's possible for the source code to change without
> triggering a re-run of CMake.
> 
> Consequently, we use a custom command to call a python script at build
> time. The script writes out the header with the up-to-date version info.
> 
> tyler
> ___
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake

-- 
Daniel Blezek, PhD
Medical Imaging Informatics Innovation Center

P 127 or (77) 8 8886
T 507 538 8886
E blezek.dan...@mayo.edu

Mayo Clinic
200 First St. S.W.
Harwick SL-44
Rochester, MN 55905
mayoclinic.org


___
Powered by www.kitware.com

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

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

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


Re: [CMake] Building a Version Header

2010-07-08 Thread Daniel Blezek
Sounds good.  Incidentally, we did something similar with Subversion, but I
never got it to work 100% of the time.  Glad it works well for you!

Cheers,
-dan


On 7/8/10 3:54 PM, "Clark Gaebel"  wrote:

> I don't want it run every commit, I want it run every build.
> 
> Right now, it seems to be re-updating every time I run "make", so it's
> all good.
> 
> Thanks for your suggestion anyways!
> 
> On 07/08/10 16:34, Daniel Blezek wrote:
>> One alternative is to use git itself.  There is a "git smudge" option that
>> can do much of what you are asking.  However, I've never done this sort of
>> thing.
>> 
>> http://progit.org/book/ch7-2.html
>> 
>> Just $0.02,
>> -dan
>> 
>> 
>> On 7/8/10 3:31 PM, "Tyler Roscoe"  wrote:
>> 
>>   
>>> On Wed, Jul 07, 2010 at 10:43:15PM -0400, John Drescher wrote:
>>> 
>>>> On Wed, Jul 7, 2010 at 9:44 PM, Clark Gaebel  wrote:
>>>>   
>>>>> I would like to generate file that looks something like this:
>>>>> 
>>>>>// version.h
>>>>>#define VERSION "v0.1-345-ga77ede8"
>>>>> 
>>>> You want to do that with configure_file
>>>>   
>>> The upside of this approach is that it's simple. The downside is that it
>>> is only run (and thus your version header is only updated) whenever
>>> CMake runs. It's possible for the source code to change without
>>> triggering a re-run of CMake.
>>> 
>>> Consequently, we use a custom command to call a python script at build
>>> time. The script writes out the header with the up-to-date version info.
>>> 
>>> tyler
>>> _______
>>> Powered by www.kitware.com
>>> 
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>> 
>>> Please keep messages on-topic and check the CMake FAQ at:
>>> http://www.cmake.org/Wiki/CMake_FAQ
>>> 
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.cmake.org/mailman/listinfo/cmake
>>> 
>>   

-- 
Daniel Blezek, PhD
Medical Imaging Informatics Innovation Center

P 127 or (77) 8 8886
T 507 538 8886
E blezek.dan...@mayo.edu

Mayo Clinic
200 First St. S.W.
Harwick SL-44
Rochester, MN 55905
mayoclinic.org


___
Powered by www.kitware.com

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

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

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


Re: [CMake] CTest examples

2010-07-12 Thread Daniel Blezek
Hi Bo,

  We put together a Wiki page comparing Boost Testing and Google Test in
ITK.  It has examples of how to write (ITK) tests in both frameworks and
CTest integration.

http://www.itk.org/Wiki/Proposals:Increasing_ITK_Code_Coverage

-dan


On 7/9/10 6:37 AM, "Bo Thorsen"  wrote:

> Hi people,
> 
> I have converted a set of applications to cmake and cpack, and now have
> my eyes set on ctest.
> 
> I'd like to hear if someone here has some good advice, or links to good
> advice, on how to structure tests. I'm searching for help on how to put
> different tests into what executables. On how to handle multiple tests
> on each classes, on how to best structure the test of the static
> libraries (all of those are part of the source tree) that are linked in
> to the application. And on how to test classes from the main application
> itself.
> 
> I have read the ctest FAQ, documentation etc. and still don't know
> anything that help me write the actual test code.
> 
>  From the looks of it, ctest only provides the framework to run a test,
> no help is given to write the code of the tests themselves, is this
> right? I have previously been using cppunit, and it looks like this will
> still be useful.
> 
> To sum it up, I'm looking for real life advice on what you guys have
> done with ctest. This information seem almost completely missing on the
> net, where all searches on ctest leads to useless presentation on ctest
> features.
> 
> Cheers,
> 
> Bo Thorsen.
> Monty Program AB.

-- 
Daniel Blezek, PhD
Medical Imaging Informatics Innovation Center

P 127 or (77) 8 8886
T 507 538 8886
E blezek.dan...@mayo.edu

Mayo Clinic
200 First St. S.W.
Harwick SL-44
Rochester, MN 55905
mayoclinic.org


___
Powered by www.kitware.com

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

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

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


Re: [CMake] different test cases

2010-07-16 Thread Daniel Blezek
We took a slightly different approach, which may be the same in spirit.

In CMake, we have a flag "RUN_LONG_TESTS".  This flag is used to add or
remove tests that the developer deemed "long".  The long tests are only run
on dashboard machines in our nightly builds.  The remaining short tests are
run by all developers and our continuous builds.  This way our developers
can run the tests in < 1 minutes while the entire test suite takes > 10
minutes.

Just $0.02,
-dan 


On 7/15/10 5:05 PM, "Tyler Roscoe"  wrote:

> On Thu, Jul 15, 2010 at 03:39:20PM -0500, "Jörg F. Unger" wrote:
>>  I'm using cmake to add a test environment to our project (with ctest).
>> Is there a possibility to generate to groups of test with different tags
>> in the makefile, so that after the generation of the makefiles the user
>> might say
>> 
>> make test or make extensiveTest?
> 
> CTest has a ton of flags for controlling which tests to run. We use -R a
> lot.
> 
> If you can come up with a nice way to run your test set (e.g. can you
> put the string "extensive" in any test you want to run as part of the
> "extensiveTest" set?), you could train your developers how to use CTest
> directly. You could also add a custom_target that runs something like
> "${CMAKE_CTEST_COMMAND} -R extensive", which gives you the build target
> you're looking for.
> 
> tyler
> ___
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake

-- 
Daniel Blezek, PhD
Medical Imaging Informatics Innovation Center

P 127 or (77) 8 8886
T 507 538 8886
E blezek.dan...@mayo.edu

Mayo Clinic
200 First St. S.W.
Harwick SL-44
Rochester, MN 55905
mayoclinic.org
³It is more complicated than you think.² -- RCF 1925

___
Powered by www.kitware.com

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

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

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