[CMake] ExternalProject_Add always try to connect to SVN server

2014-09-13 Thread Anton Deguet
Hello,

I'm wondering if I'm doing something wrong using ExternalProject_Add for a 
subversion repository.  I would expect the following behavior:

- First run, see if local copy of code has been checked out.  If not 'svn 
checkout'.  Fails if not connected to internet.
- Consecutive runs:
  - if svn local revision different from SVN_REVISION, do a `svn update` to 
revision specified in ExternalProject_Add
  - if svn local revision same as requested, do nothing

I'm having some issues with the last case, i.e. the code is checked out and 
'svn info' tells me I have the desired revision but somehow the build process 
is still trying to reach the svn server.   Since I'm working off the grid, my 
build fails.

Questions:
- Did I do something wrong or set an options somewhere that forces CMake to 
check the SVN server systematically?
- Is there an option or command I can set to build when not connected to 
internet?

Sincerely,

Anton


CMake version:  2.8.12.2 on Ubuntu 14.04
Code:
  include (ExternalProject)
  set (cisstJSON_PREFIX cisstJSONExternal)
  set (CISST_JSON_SVN_REPOSITORY 
http://svn.code.sf.net/p/jsoncpp/code/trunk/jsoncpp)
  set (CISST_JSON_SVN_REVISION 276)
  ExternalProject_Add (cisstJSONExternal
   PREFIX ${cisstJSON_PREFIX}
   SVN_REPOSITORY ${CISST_JSON_SVN_REPOSITORY}
   SVN_REVISION   -r ${CISST_JSON_SVN_REVISION}
   CMAKE_CACHE_ARGS 
-DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES}

-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}

-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
-DOPTION_BUILD_EXAMPLES:BOOL=OFF
-DJSONCPP_WITH_TESTS:BOOL=OFF

-DJSONCPP_WITH_POST_BUILD_UNITTEST:BOOL=OFF

-DCMAKE_INSTALL_PREFIX:FILEPATH=${cisst_BINARY_DIR}/cisstJSON
   INSTALL_DIR ${cisst_BINARY_DIR}/cisstJSON
   TIMEOUT 3
   )


-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


[CMake] setting executable runtime command line argument

2012-10-01 Thread Anton Deguet
Hello,

I am wondering if there is a target property for executable to set a command 
line argument.  I did a bit of googling but I might have missed it.

Something like:

add_executable (myProgram main.cpp)
set_target_properties (myProgram COMMAND_LINE_ARGUMENTS --verbose --run)

This would set the command line options for debugging for most supported IDE 
(Visual Studio, XCode, ...).

Sincerely,

Anton




--

Powered by www.kitware.com

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

Please keep messages on-topic and check 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] Second post: find_package with config file always set xyz_FOUND to true?

2011-09-19 Thread Anton Deguet
Hello,

I haven't heard anything following my previous post.  Is there any chance 
someone could provide some guidance?

Sincerely,

Anton

On Aug 29, 2011, at 6:02 PM, Anton Deguet wrote:

 Hello,
 
 I am trying to use the following syntax:
 find_package (xyz REQUIRED xyz1 xyz2) using a config file, i.e. NOT 
 Findxyz.cmake.
 
 I have a file named xyz-config.cmake that contains some code to check if the 
 required components are available or not (based on how xyz was compiled).  
 Ideally I would like the find_package command to set xyz_FOUND to false if:
 - xyz-config.cmake file is not found (that's working by default)
 OR
 - xyz-config.cmake file is found BUT one or more component is missing
 
 In my xyz-config.cmake, I tried:
 - set (xyz_FOUND FALSE)  # overall package not found as required
 - set (xyz2_FOUND FALSE)  # component not found, hoping find_package would 
 compare this to the list xyz_FIND_COMPONENTS
 
 But in all cases, it seems that find_package resets xyz_FOUND to 1 as long as 
 the file xyz-config.cmake is found.  Is there a way to set xyz_FOUND to 0 
 within xyz-config.cmake?
 
 Anton
 
 

___
Powered by www.kitware.com

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

Please keep messages on-topic and check 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] Second post: find_package with config file always set xyz_FOUND to true?

2011-09-19 Thread Anton Deguet
Hi Michael,

Sorry, I mistakenly trashed your previous answer, thank you for both replies.

It looks like I am not the first one to raise that question.  If I understand 
well, the primary issue is to agree on the semantic of:

find_package (xyz COMPONENTS c1 c2)
if (xyz_FOUND) …

xyz_FOUND can mean:
- xyz has been found and since you asked for components c1 and c2, please check 
the variables xyz_c1_FOUND and xyz_c2_FOUND to see if these components are 
available
- xyz has been found along with c1 and c2

I would personally prefer the second approach as it makes it easy to test if 
everything has been found as required.  Maybe there is yet another variable to 
indicate that all components have been found, say xyz_FOUND_AS_REQUIRED.  That 
would allow users to write simpler code:

if (xyz_FOUND AND xyz_c1_FOUND AND xyz_c2_FOUND)

would become:

if (xyz_FOUND_AS_REQUIRED)

Ultimately I will stick to the recommended approach.


The second aspect of the issue (and this is what I initially encountered) is 
the different behavior of find_package for either a module find or a config 
file.  I wrote a CMake file/scripts that sets xyz_FOUND and used it for both 
cases, i.e. installed it as either Findxyz.cmake or xyz-config.cmake.  It was a 
bit disconcerting to have my xyz_FOUND variable overwritten in one case and not 
the other.  I understand that this is strongly tied to the defined/accepted 
meaning of xyz_FOUND and I was apparently mis-using it.  But ... maybe … the 
find_package could be slightly modified:
- send a warning to the user (developer message) if the variable xyz_FOUND is 
modified/set by the file xyz-config.cmake
- more subtle and might have implications I don't foresee, if after loading the 
file xyz-config.cmake find_package realizes that xyz_FOUND has been set, let it 
as is.  That would allow me to keep using xyz_FOUND incorrectly :-)

Again, thank you for your answer.

Anton


On Sep 19, 2011, at 2:21 PM, Michael Hertling wrote:

 On 09/19/2011 07:09 PM, Anton Deguet wrote:
 Hello,
 
 I haven't heard anything following my previous post.  Is there any chance 
 someone could provide some guidance?
 
 Sincerely,
 
 Anton
 
 On Aug 29, 2011, at 6:02 PM, Anton Deguet wrote:
 
 Hello,
 
 I am trying to use the following syntax:
 find_package (xyz REQUIRED xyz1 xyz2) using a config file, i.e. NOT 
 Findxyz.cmake.
 
 I have a file named xyz-config.cmake that contains some code to check if 
 the required components are available or not (based on how xyz was 
 compiled).  Ideally I would like the find_package command to set xyz_FOUND 
 to false if:
 - xyz-config.cmake file is not found (that's working by default)
 OR
 - xyz-config.cmake file is found BUT one or more component is missing
 
 In my xyz-config.cmake, I tried:
 - set (xyz_FOUND FALSE)  # overall package not found as required
 - set (xyz2_FOUND FALSE)  # component not found, hoping find_package would 
 compare this to the list xyz_FIND_COMPONENTS
 
 But in all cases, it seems that find_package resets xyz_FOUND to 1 as long 
 as the file xyz-config.cmake is found.  Is there a way to set xyz_FOUND to 
 0 within xyz-config.cmake?
 
 Anton
 
 Second try: http://www.mail-archive.com/cmake@cmake.org/msg37840.html
 
 Regards,
 
 Michael
 ___
 Powered by www.kitware.com
 
 Visit other Kitware open-source projects at 
 http://www.kitware.com/opensource/opensource.html
 
 Please keep messages on-topic and check the CMake FAQ at: 
 http://www.cmake.org/Wiki/CMake_FAQ
 
 Follow this link to subscribe/unsubscribe:
 http://www.cmake.org/mailman/listinfo/cmake

___
Powered by www.kitware.com

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

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

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


[CMake] find_package with config file always set xyz_FOUND to true?

2011-08-29 Thread Anton Deguet
Hello,

I am trying to use the following syntax:
find_package (xyz REQUIRED xyz1 xyz2) using a config file, i.e. NOT 
Findxyz.cmake.

I have a file named xyz-config.cmake that contains some code to check if the 
required components are available or not (based on how xyz was compiled).  
Ideally I would like the find_package command to set xyz_FOUND to false if:
- xyz-config.cmake file is not found (that's working by default)
OR
- xyz-config.cmake file is found BUT one or more component is missing

In my xyz-config.cmake, I tried:
- set (xyz_FOUND FALSE)  # overall package not found as required
- set (xyz2_FOUND FALSE)  # component not found, hoping find_package would 
compare this to the list xyz_FIND_COMPONENTS

But in all cases, it seems that find_package resets xyz_FOUND to 1 as long as 
the file xyz-config.cmake is found.  Is there a way to set xyz_FOUND to 0 
within xyz-config.cmake?

Anton


___
Powered by www.kitware.com

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

Please keep messages on-topic and check 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] option, configure_file and ON/OFF

2010-11-23 Thread Anton Deguet
Hello,

I am trying to use a UI option to set a value used in configure_file and 
ideally obtain a file that doesn't use ON/OFF.   Here is a CMake sample:
  option (MYLIB_HAS_WHATEVER Use whatever library OFF)

In my config.h.in I have:
  #define ON 1
  #define OFF 0
  #define MYLIB_HAS_WHATEVER ${MYLIB_HAS_WHATEVER}

Then in my code I can use:
  #if MYLIB_HAS_WHATEVER
  
  #endif

It worked so far but there is an issue if we end up using other libraries which 
also define ON and/or OFF.  There seems to be no way to tell CMake to use 1/0 
instead of ON/OFF during the configure_file.  My solution has been to modify my 
CMake to do the following:
  option (MYLIB_HAS_WHATEVER Use whatever library OFF)
  if (MYLIB_HAS_WHATEVER)
set(MYLIB_CONFIG_HAS_WHATEVER 1)

  else (MYLIB_HAS_WHATEVER)
set(MYLIB_CONFIG_HAS_WHATEVER 0)

  endif (MYLIB_HAS_WHATEVER)

and in the config.h.in do:
  #define MYLIB_HAS_WHATEVER ${MYLIB_CONFIG_HAS_WHATEVER}

Is there a better way?

Anton

---
Anton Deguet, Research Engineer, ERC-CISST/LCSR, Johns Hopkins University
e-mail: anton.deg...@jhu.edu, iChat: anton.deg...@mac.com
phone: 410-790-0456
JHU, LCSR, Hackerman Hall 137b, 3400 North Charles Street, Baltimore, MD 21218, 
USA




___
Powered by www.kitware.com

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

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

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


[CMake] How to figure out when a feature was added

2010-02-17 Thread Anton Deguet
Hello,

I am trying to find all release notes for CMake.   I am currently using the if 
(...  VERSION_NEWER ...) and I know that it has not always been available and 
would like to avoid downloading all past versions of CMake to figure out when 
it was added to have the correct CMAKE_MINIMUM_REQUIRED(VERSION 2.6.x).  Is 
there an online list of feature/date of introduction or a way to access all 
release notes?

Anton


---
Anton Deguet, Research Engineer, ERC-CISST/LCSR, Johns Hopkins University
e-mail: anton.deg...@jhu.edu, iChat: anton.deg...@mac.com
office phone: 410-516-5261, cell phone: 410-790-0456
JHU, LCSR, CSEB 137b, 3400 North Charles Street, Baltimore, MD 21218, USA




___
Powered by www.kitware.com

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

Please keep messages on-topic and check 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] Tips to create a UseXYZ.cmake

2010-01-28 Thread Anton Deguet
Hello,

Besides digging in the existing UseVTK, UseITK, UseOpenIGTLing, ... is there a 
short description of the philosophy and basic commands to  use?   Any pointer 
is welcome.  This would be for a project with multiple external dependencies, 
i.e. libxml, openCV, Python, numpy, ...

Thanks,

Anton


---
Anton Deguet, Research Engineer, ERC-CISST/LCSR, Johns Hopkins University
e-mail: anton.deg...@jhu.edu, iChat: anton.deg...@mac.com
office phone: 410-516-5261, cell phone: 410-790-0456
JHU, LCSR, CSEB 137b, 3400 North Charles Street, Baltimore, MD 21218, USA




___
Powered by www.kitware.com

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

Please keep messages on-topic and check 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] Removing an option created with OPTION?

2007-09-07 Thread Anton Deguet

Hello,

I have a build designed to show new options based on the user's  
choice.  E.g. when the user decides to compile the examples, a long  
list of possible examples to compile appears with an ON/OFF choice.   
Now when the user decides to not compile the examples, the list of  
options created with the cmake command OPTION still appears.   That  
make sense as this variables are still in the cache.  Is there any  
way to remove these options automatically and un-clutter the cmake  
UI (using ccmake or cmakesetup)?


Thanks,

Anton


---
Anton Deguet, Research Engineer, ERC-CISST, Johns Hopkins University
[EMAIL PROTECTED], Office: 410-516-5261, Cell: 410-790-0456
iChat only: [EMAIL PROTECTED]



___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Add a .obj file to a library

2007-03-13 Thread Anton Deguet
I tried a couple more things.   Since the paths were compounded I  
assumed this was because I could only add files defined with a  
relative path (wrt the source directory).   So I tried to convert the  
absolute path into a relative path using:


FILE(RELATIVE_PATH
  FILE_IN_RELATIVE_PATH
  ${CMAKE_CURRENT_SOURCE_DIR}
  ${FILE_IN_ABSOLUTE_PATH})

This works only if the source directory and the directory containing  
the .obj file are on the same drive.  In my case, the obj file in on  
C: while my source directory is on N:   and I don't know if one can  
define a relative path between two drives on Windows.


I there a way to tag a source file as defined with absolute path?

Anton


On Mar 9, 2007, at 12:15 PM, Anton Deguet wrote:


Hello,

I am trying to add a pre-compiled object in a library.  I am  
generating a solution for  Microsoft Visual Studio .net 2003  
using CMake 2.4.5.   I used FIND_FILE to locate the .obj file and  
then simply add it to the list of source files for my library.   I  
found a couple of reference on the web related to this problem so I  
was hopeful.


It doesn't work as is because CMake prepends the current source  
path to my file name (which already contains a full path).   So I  
get a message stating that C:/current-source-path/C:/path-to-my- 
obj/file.obj can not be found.   Is there an easy way to tell  
CMake to not prepend the current source path?


Also, all examples found on the web referred to .o files but not  
.obj files.  I am pretty sure that CMake can handle this  
difference but I just wanted verify.


Thanks,

Anton



---
Anton Deguet, Research Engineer, ERC-CISST, Johns Hopkins University
[EMAIL PROTECTED], 410-516-5261
iChat only: [EMAIL PROTECTED]



___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

[CMake] Add a .obj file to a library

2007-03-09 Thread Anton Deguet

Hello,

I am trying to add a pre-compiled object in a library.  I am  
generating a solution for  Microsoft Visual Studio .net 2003 using  
CMake 2.4.5.   I used FIND_FILE to locate the .obj file and then  
simply add it to the list of source files for my library.   I found a  
couple of reference on the web related to this problem so I was hopeful.


It doesn't work as is because CMake prepends the current source path  
to my file name (which already contains a full path).   So I get a  
message stating that C:/current-source-path/C:/path-to-my-obj/ 
file.obj can not be found.   Is there an easy way to tell CMake to  
not prepend the current source path?


Also, all examples found on the web referred to .o files but not  
.obj files.  I am pretty sure that CMake can handle this difference  
but I just wanted verify.


Thanks,

Anton


---
Anton Deguet, Research Engineer, ERC-CISST, Johns Hopkins University
[EMAIL PROTECTED], 410-516-5261



___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] FindCppUnit

2006-10-05 Thread Anton Deguet
I have the following which works on Unix systems but requires manual
input on Windows:

#
# Find the CppUnit includes and library
#
# This module defines
# CPPUNIT_INCLUDE_DIR, where to find tiff.h, etc.
# CPPUNIT_LIBRARIES, the libraries to link against to use CppUnit.
# CPPUNIT_FOUND, If false, do not try to use CppUnit.

# also defined, but not for general use are
# CPPUNIT_LIBRARY, where to find the CppUnit library.
# CPPUNIT_DEBUG_LIBRARY, where to find the CppUnit library in debug
mode.

FIND_PATH(CPPUNIT_INCLUDE_DIR cppunit/TestCase.h
  /usr/local/include
  /usr/include
)

# With Win32, important to have both
IF(WIN32)
  FIND_LIBRARY(CPPUNIT_LIBRARY cppunit
   ${CPPUNIT_INCLUDE_DIR}/../lib
   /usr/local/lib
   /usr/lib)
  FIND_LIBRARY(CPPUNIT_DEBUG_LIBRARY cppunitd
   ${CPPUNIT_INCLUDE_DIR}/../lib
   /usr/local/lib
   /usr/lib)
ELSE(WIN32)
  # On unix system, debug and release have the same name
  FIND_LIBRARY(CPPUNIT_LIBRARY cppunit
   ${CPPUNIT_INCLUDE_DIR}/../lib
   /usr/local/lib
   /usr/lib)
  FIND_LIBRARY(CPPUNIT_DEBUG_LIBRARY cppunit
   ${CPPUNIT_INCLUDE_DIR}/../lib
   /usr/local/lib
   /usr/lib)
ENDIF(WIN32)

IF(CPPUNIT_INCLUDE_DIR)
  IF(CPPUNIT_LIBRARY)
SET(CPPUNIT_FOUND YES)
SET(CPPUNIT_LIBRARIES ${CPPUNIT_LIBRARY} ${CMAKE_DL_LIBS})
SET(CPPUNIT_DEBUG_LIBRARIES ${CPPUNIT_DEBUG_LIBRARY}
${CMAKE_DL_LIBS})
  ENDIF(CPPUNIT_LIBRARY)
ENDIF(CPPUNIT_INCLUDE_DIR)





On Wed, 2006-10-04 at 13:28 -0700, Kedzierski, Artur CIV
NAVSURFWARCENDIV CORONA wrote:
   With CppUnit being popular for unit testing, does
 anybody have a FindCppUnit.cmake that would locate it?
 
 --
 Artur Kedzierski
 ___
 CMake mailing list
 CMake@cmake.org
 http://www.cmake.org/mailman/listinfo/cmake
-- 
Anton Deguet [EMAIL PROTECTED]
ERC CISST Johns Hopkins University
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] How to read a registry key?

2006-09-07 Thread Anton Deguet
I looks like this has something to do with the nature of the key/value.
For values listed as REG_SZ (within regedit.exe), CMake can retrieve the
content but for values stored as REG_EXPAND_SZ I systematically get
/registry.  I don't know much about the Windows registry but I did a
quick survey of different computers/users in the lab and the user path
can be either one which makes it difficult to implement a robust
solution.  Am I the first one to run into this issue?

Anton


On Thu, 2006-09-07 at 12:13 -0400, Anton Deguet wrote:
 Bill,
 
 I had some success with the key expansion but I haven't been able to do
 what I need.  Basically, I would like to get the un-expanded content of
 the user path, i.e. not the expanded path (user and system) which can be
 found using $ENV{PATH}.
 
 I tried the following code, i.e. adding two variables, one using the
 other:
 
 SET(CISST_PATH ${EXECUTABLE_OUTPUT_PATH} ${LIBRARY_OUTPUT_PATH})
 SET(CISST_PATH_REG_KEY HKEY_CURRENT_USER\\Environment;CISST_PATH)
 EXEC_PROGRAM(${CMAKE_COMMAND}
  ARGS -E write_regv \${CISST_PATH_REG_KEY}\
 \${CISST_PATH}\)
 
 SET(OTHER_PATH_REG_KEY HKEY_CURRENT_USER\\Environment;OTHER_PATH)
 SET(OTHER_PATH c:/prg;%CISST_PATH%)
 EXEC_PROGRAM(${CMAKE_COMMAND}
  ARGS -E write_regv \${OTHER_PATH_REG_KEY}\
 \${OTHER_PATH}\)
 
 GET_FILENAME_COMPONENT(TMP [HKEY_CURRENT_USER\
 \Environment;OTHER_PATH]/dummy.dum PATH)
 
 MESSAGE(${TMP})
 
 At that point, everything looks great and I can check the results with
 reg.exe, the expansion works ...
 
 Now, if I try to retrieve the user path using
 GET_FILENAME_COMPONENT(TMP [HKEY_CURRENT_USER\
 \Environment;PATH]/dummy.dum PATH)
 
 TMP is set to /registry ...  Any explanation or better solution to
 just retrieve the value as a string?
 
 
 On Wed, 2006-09-06 at 20:55 -0400, William A. Hoffman wrote:
  At 05:36 PM 9/6/2006, Anton Deguet wrote:
  Hello,
  
  I have found that using EXEC_PROGRAM with ${CMAKE_COMMAND} -E I can
  write/remove a key in the Windows registry but I haven't figured out how
  to read a key.  Is there a simple solution for that?  
  
  Sure, but it seems not to be documented
  Several commands including GET_FILENAME_COMPONENT will expand things
  like this:
  
  [HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development 
  Kit\\2.0;JavaHome]/bin
  
  You can use this to read registry values.  I will add some docs in
  the morning.
  
  -Bill
  
  ___
  CMake mailing list
  CMake@cmake.org
  http://www.cmake.org/mailman/listinfo/cmake
-- 
Anton Deguet [EMAIL PROTECTED]
ERC CISST Johns Hopkins University
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] How to read a registry key?

2006-09-06 Thread Anton Deguet
Hello,

I have found that using EXEC_PROGRAM with ${CMAKE_COMMAND} -E I can
write/remove a key in the Windows registry but I haven't figured out how
to read a key.  Is there a simple solution for that?  

Anton

-- 
Anton Deguet [EMAIL PROTECTED]
ERC CISST Johns Hopkins University
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] CTest and devenv command line issues

2006-08-08 Thread Anton Deguet
Brad,

Thank you for your reply.   I finally had a chance to try it and I must
admit that I only have a partial success to report.  The main issue I
have is that I am using a custom command (post build) to generate the
list of test cases used by CTest.  So, what happens is that within the
IDE/devenv, I need to have the paths set for my Dlls and Python
libraries.

My partial solution so far is to compile using devenv with /useenv and
then use a CTest script for the submission.  This seems to work:

@rem Go to the build directory
c:
cd C:\users\anton\dart-build\msvc7.1-dynamic-IDE\build
@rem Set the env. variables.
call cisstvsvars.bat
call cisstvars.bat Release 
@rem Clean and build
devenv /useenv /clean Release /project ALL_BUILD
devenv /useenv /build Release /project ALL_BUILD
C:\Program Files\CMake 2.4\bin\ctest.exe -C Release -S script.cmake

This solution is only partial because ctest will not handle the
compilation and therefore will not report any compiler error to Dart.

Without the ctest script I could not submit.  With it I can now submit
but I still can't compile, i.e. it looks like the PATH I set using
SET(CTEST_ENVIRONMENT ...) is not passed properly to devenv ...  Any
thoughts?

Anton


On Tue, 2006-07-25 at 16:00 -0400, Brad King wrote:
 Anton Deguet wrote:
  Hello,
  
  I am trying to setup a couple of nightly builds on a single Windows box.
  Since the build requires DLLs (to test our __declspec and Python
  wrappers), I have been trying to use the MSVC devenv command line
  with /useenv to set the DLL and Python search paths per build.  I have
  something almost working but I am stuck whenever I try to submit to
  Dart.  Here is what works (in a small batch script):
  
  @rem Go to the build directory
  c:
  cd C:\users\anton\dart-build\msvc7.1-dynamic-IDE\build
  
  @rem Set the env. variables.
  call cisstvsvars.bat
  call cisstvars.bat Release
  
  @rem Clean and build
  devenv /useenv /clean Release /project ALL_BUILD
  devenv /useenv /build Release /project ALL_BUILD
  devenv /useenv /build Release /project RUN_TESTS
  
  At that point, my test programs can find the DLLs and run successfully
  but, as expected, nothing gets submitted to my Dart2 dashboard. 
  
  The following two won't work:
  devenv /useenv /build Release /project Nightly
  C:\Program Files\CMake 2.4\bin\ctest.exe -C Release -D Nightly
  
  The error message is that the DLLs are not found.  I looks like at one
  point my environment variables have been dropped.
  
  Any clue?  I am using CMake 2.4.2.
 
 This doesn't work because building the Nightly target just runs another
 ctest that constructs its own devenv command line to drive the build and
 doesn't add the /useenv option.
 
 CTest is designed to drive dashboard submissions using ctest -S
 scripts.  See here for an example:
 
 http://www.cmake.org/Testing/Sites/dash4.kitware/Win32-bcc5.8/20060725-1514-Experimental/Notes.html
 
 You can set environment variables in the script:
 
 SET(ENV{VAR1} value1)
 SET(ENV{VAR2} value2)
 
 -Brad
-- 
Anton Deguet [EMAIL PROTECTED]
ERC CISST Johns Hopkins University
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] CTest and devenv command line issues

2006-07-25 Thread Anton Deguet
Hello,

I am trying to setup a couple of nightly builds on a single Windows box.
Since the build requires DLLs (to test our __declspec and Python
wrappers), I have been trying to use the MSVC devenv command line
with /useenv to set the DLL and Python search paths per build.  I have
something almost working but I am stuck whenever I try to submit to
Dart.  Here is what works (in a small batch script):

@rem Go to the build directory
c:
cd C:\users\anton\dart-build\msvc7.1-dynamic-IDE\build

@rem Set the env. variables.
call cisstvsvars.bat
call cisstvars.bat Release

@rem Clean and build
devenv /useenv /clean Release /project ALL_BUILD
devenv /useenv /build Release /project ALL_BUILD
devenv /useenv /build Release /project RUN_TESTS

At that point, my test programs can find the DLLs and run successfully
but, as expected, nothing gets submitted to my Dart2 dashboard. 

The following two won't work:
devenv /useenv /build Release /project Nightly
C:\Program Files\CMake 2.4\bin\ctest.exe -C Release -D Nightly

The error message is that the DLLs are not found.  I looks like at one
point my environment variables have been dropped.

Any clue?  I am using CMake 2.4.2.


Anton


-- 
Anton Deguet [EMAIL PROTECTED]
ERC CISST Johns Hopkins University
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Fwd: CMAKE + SWIG + more wrapped languages

2006-07-24 Thread ANTON DEGUET
Daniel,

I figured out a solution which is more a trick than anything else.  Basically, 
I created an empty .i file as a stub for each language.  For example, you have 
Module.i and you could add ModulePython.i which contains:
%include Module.i.  I then use CMake with these stubs.

This works but I then run into a long known issue with the CMake SWIG macro, 
i.e. the dependencies don't handle files included by SWIG using the %include.  
I believe there is a ticket opened for this issue.

Anton


- Original Message -
From: Daniel Tihelka [EMAIL PROTECTED]
Date: Monday, July 24, 2006 4:47 am
Subject: [CMake] Fwd: CMAKE + SWIG + more wrapped languages

 
 Hallo everybody.
 
 May I ask you for a help with SWIG module in CMake? I need to 
 create more
 wrapping libraries from one set of .i SWIG files. To use SWIG from 
 CMake is
 really trivial for one wrapped language, but I need to create more 
 wrappersin one step, as illustrated below:
 
 I have directory structure like this:
 
 wrap
  |
  +-- Module.i
  +-- *.i  (other SWIG interface files included by Module.i)
  |
  +-- python
  +--  perl
  +-- java
 
 The wrap/CMakeLists.txt looks simple:
 
   SUBDIRS(python perl java)
 
 
 And for example wrap/python/CMakeLists.txt looks like (the 
 CMakeLists will
 look similarly for perl and java packages):
 
   # Find and include required packages
   FIND_PACKAGE( SWIG REQUIRED )
   FIND_PACKAGE( PythonLibs REQUIRED )
   INCLUDE( ${SWIG_USE_FILE} )
 
   # Set include python path
   INCLUDE_DIRECTORIES( ${PYTHON_INCLUDE_PATH}  )
 
   # Generated file is C++, tell it to SWIG
   SET_SOURCE_FILES_PROPERTIES( Module.i PROPERTIES CPLUSPLUS   ON )
 
   # ! Tell to SWIG that .i files are one directory up !
   SET_SOURCE_FILES_PROPERTIES( Module.i PROPERTIES SWIG_FLAGS -I../)
 
   # Create wrapper
   SWIG_ADD_MODULE(   module python Module.i )
   SWIG_LINK_LIBRARIES( module python2.4 )
 
   # Copy the generated files as post-build step
   ADD_CUSTOM_COMMAND( TARGET ${SWIG_MODULE_module_REAL_NAME}
POST_BUILD
COMMAND   ${CMAKE_COMMAND}
ARGS -E copy 
 ${CMAKE_CURRENT_BINARY_DIR}/*.py${CMAKE_CURRENT_SOURCE_DIR} )
   #
   ADD_CUSTOM_COMMAND( TARGET${SWIG_MODULE_module_REAL_NAME}
POST_BUILD
COMMAND   ${CMAKE_COMMAND}
ARGS -E copy 
 ${CMAKE_CURRENT_BINARY_DIR}/*.so${CMAKE_CURRENT_SOURCE_DIR} )
 
 
 
 
 However, when the build process is started, it finishes by error:
 
   make[5]: Entering directory `/home//build//wrap/python'
   make[5]: *** No rule to make target 
 `/home//wrap/python/Module.i', needed by 
 `/home//build//wrap/python/Module_wrap.c'.  Stop.
 
 
 When I looked at .../build/python/Makefile, there is target:
 
   /home//build//wrap/python/Module_wrap.c: 
 /home//wrap/python/Module.i   @echo Building Swig
 source /home//build/wrap/python/Module_wrap.c...
   /usr/bin/swig -python -I/usr/include/python2.4 -o
 /home//build//wrap/python/Module_wrap.c 
 /home//wrap/python/Module.i
 However, there is no -I../ switch specified by
 SET_SOURCE_FILES_PROPERTIES( Module.i PROPERTIES SWIG_FLAGS -
 I../). Moreover, there is absolute path to the Module.i which 
 is, however, wrong.
 When I tries to call SWIG directly, but only with Module.i it was 
 OK - the
 -I switch seems to ensure the right path.
 
 I have also tried to set relative paths during CMake 
 configuration, but it
 leaded to other errors during the build.
 
 Could someone give me a hint how to solve this problem? Did I 
 choose the
 right approach, or should it be solved in different way? Or how to 
 instruct CMake not to use the whole path to .i file (neither 
 absolute, nor relative)?
 Any help will really be appreciated.
 
 Thank you very much,
 Dan
 
 ___
 CMake mailing list
 CMake@cmake.org
 http://www.cmake.org/mailman/listinfo/cmake
 
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake