Re: [CMake] target_include_directories and system headers

2018-06-28 Thread Jim Lloyd
Thank you Nils, that is exactly the information I needed. Simply setting
`set(CMAKE_NO_SYSTEM_FROM_IMPORTED ON)` achieves the workaround I wanted.


On Wed, Jun 27, 2018 at 11:03 PM, Nils Gladitz 
wrote:

> On Thu, Jun 28, 2018 at 7:12 AM Jim Lloyd  wrote:
>
>> [...]
>> But if I make a trivial project that simply includes yaml-cpp as a
>> dependency, the generated compile commands use `-isystem` to include the
>> yaml-cpp headers.
>>
>> Is this a bug in CMake?
>>
>> Also, is there any way I may be able to work around this problem with
>> CMake 3.10? I would be happy to globally force the use of `-I` for all
>> include directories.
>>
>
> I think the question and a potential work around are covered by
> https://cmake.org/cmake/help/latest/manual/cmake-
> buildsystem.7.html#include-directories-and-usage-requirements
> Specifically the paragraph close to the end starting with "When the
> INTERFACE_INCLUDE_DIRECTORIES of an imported target...".
>
> Basically include directories inherited from imported targets are
> implicitly "SYSTEM" by default.
>
> Nils
>
-- 

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:
https://cmake.org/mailman/listinfo/cmake


[CMake] target_include_directories and system headers

2018-06-27 Thread Jim Lloyd
I am cross compiling to ARM using the g++ 7.2 compilers provided with the
Xilinx SDK.

This compiler was built using old assumptions about system headers being
pure C, such
that when compiled from a .cpp source, the header is wrapped in an `extern
"C" {}`. This causes true C++ headers to fail when compiling templates,
with 'error: template with C linkage'.

I have filed a bug against the ARM gcc compiler, but I would like to be
able to workaround the bug with CMake if possible. And as I read the
documentation, I am beginning to think that there may be a bug in CMake too.

As I read the documentation for target_include_directories, the `-isystem`
option for specifying an include directory is triggered by the SYSTEM
option, and therefore should not be used when SYSTEM is not specified. But
it seems to me that `-isystem` may be used even if SYSTEM is not specified.

For example, the yaml-cpp <https://github.com/jbeder/yaml-cpp> project
declares its include directories like this:

if (NOT CMAKE_VERSION VERSION_LESS 2.8.12)
target_include_directories(yaml-cpp
PUBLIC $
   $
PRIVATE $)
endif()

But if I make a trivial project that simply includes yaml-cpp as a
dependency, the generated compile commands use `-isystem` to include the
yaml-cpp headers.

Is this a bug in CMake?

Also, is there any way I may be able to work around this problem with CMake
3.10? I would be happy to globally force the use of `-I` for all include
directories.

Thanks,

Jim Lloyd
EtaGen Inc.
-- 

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:
https://cmake.org/mailman/listinfo/cmake


[CMake] CTest verbose output of failed tests

2016-10-20 Thread Lloyd
Hi,

We have integrated CMake and CTest and generates project in Visual Studio.
We run the tests from visual studio. When a test fails, it shows only the
message "test failed". CTest has a verbose option for knowing the details
about failed test. is it possible to integrate this verbose option in
visual studio so that I can know the details about the failed tests?

That is, how can I know the details about the failed tests from Visual
Studio?

Thanks,
  Lloyd
-- 

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] Visual C++ for Linux

2016-03-30 Thread Lloyd
Hi,

Microsoft announced Visual C++ for Linux. Would CMake support this?

https://blogs.msdn.microsoft.com/vcblog/2016/03/30/visual-c-for-linux-development/

Thanks,
  Lloyd
-- 

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] Check if a variable contains valid number

2016-03-29 Thread Lloyd
Hi,

How can I check if the user supplied value is a valid positive integer or
not?

I have tried the following, but it is not entering the if condition, what
might be wrong? Is there a better solution?

SET(MY_NUMBER "100" CACHE STRING " Please enter the number")
string(REGEX MATCH "^[1-9][0-9]*$" MY_NUMBER  ${MY_NUMBER})
if(MY_NUMBER)

   #This area is not getting executed, whats wrong here

endif()

Thanks,
  Lloyd
-- 

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] CPack Uninstalling locked files

2015-12-08 Thread Lloyd
Hi,

In CPack NSIS template I came across a variable CPACK_NSIS_DELETE_FILES.
When the NSIS script is generated, this variable is expanded to "nsis
delete commands" for all the cmake install commands.

The proble with this is, if the file is locked it will not be deleted. To
overcome this NSIS has a "REBOOTOK" flag  in the delete command. When the
system is reboot these locked files will be deleted.

eg.

Delete /REBOOTOK "$INSTDIR\uninst.exe"

Does CMake/CPack provide any mechanism for deleting locked files ?

Thanks,
  Lloyd
-- 

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

Re: [CMake] generator expression for set_target_properties

2015-12-03 Thread Lloyd
I mean the latter, changing the build type in ide

On Thu, Dec 3, 2015 at 1:15 PM, Attila Krasznahorkay <
attila.krasznahor...@gmail.com> wrote:

> Hi Lloyd,
>
> You mean like:
>
> if( ${CMAKE_BUILD_TYPE} STREQUAL "Release" )
>set_target_properties( myexec PROPERTIES WIN32_EXECUTABLE TRUE )
> endif()
>
> ?
>
> Or would you like the build configuration to change in this respect when
> you change the build type in the IDE? This latter may not be possible to
> do. But others may very well correct me.
>
> Cheers,
> Attila
>
> > On 03 Dec 2015, at 07:32, Lloyd <lloydkl.t...@gmail.com> wrote:
> >
> > Hi,
> >
> > We have a cmake file for Qt project. We want to hide the console from
> release build. For that we are using
> >
> > ADD_EXECUTABLE(myexec ${MYEXEC_SRC} )
> > SET_TARGET_PROPERTIES(myexec PROPERTIES WIN32_EXECUTABLE true)
> >
> > Is it possible for me to set this property only for the release build?
> >
> > I am using cmake 2.8, Windows 7, VS 2013
> >
> > Thanks,
> >   Lloyd
> > --
> >
> > 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
>
>
-- 

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] generator expression for set_target_properties

2015-12-02 Thread Lloyd
Hi,

We have a cmake file for Qt project. We want to hide the console from
release build. For that we are using

ADD_EXECUTABLE(myexec ${MYEXEC_SRC} )
SET_TARGET_PROPERTIES(myexec PROPERTIES WIN32_EXECUTABLE true)

Is it possible for me to set this property only for the release build?

I am using cmake 2.8, Windows 7, VS 2013

Thanks,
  Lloyd
-- 

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] CPack-NSIS Start menu item not created

2015-12-02 Thread Lloyd
Hi,

Hi I am using CMake for building and packing on Windows. I have a root
cmake file and the subfolders contains executable and other modules. I am
writing the packing code in the root cmake file and executable contained in
a subfolder.

My executable name is myexec, and I want to create start menu item and
desktop icon for this exe.

For this I have used

set(CPACK_PACKAGE_EXECUTABLES myexec;"My Exec" ${CPACK_PACKAGE_EXECUTABLES})

set(CPACK_CREATE_DESKTOP_LINKS "My Exec" ${CPACK_CREATE_DESKTOP_LINKS})

But it is not creating start menu item or the desktop shortcut. What could
be the reason?
I am using NSIS. I have a custom NSIS template. Is this the reason for it
not to work?

Thanks,
  Lloyd
-- 

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] Qt5, find ICU and ANGLE libraries

2015-02-10 Thread Lloyd
Hi,

I am using Qt 5.3 (Angle on Windows) with CMake 2.8.12. Qt 5.3 has
dependencies on ICU and ANGLE libs. I wish to copy these dlls to the build
directory. Is there any CMake variable that holds name of ICU and ANGLE
libs?

To copy other Qt libraries I am using the following sample code fragment-

GET_TARGET_PROPERTY(QT5_LIB_LOCATION Qt5::Core LOCATION_${BUILD_TYPE})
file(COPY ${QT5_LIB_LOCATION} DESTINATION
 {EXECUTABLE_OUTPUT_PATH}/${BUILD_TYPE})

Here BUILD_TYPE can be Debug or Release

If it is not possible to get the lib names, I wish to get the Qt bin dir
path. Is any variable holding this value? I could find Qt5_DIR, but not a
variable pointing to the bin directory.

Thanks,
  Lloyd
-- 

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

Re: [CMake] Cmake project

2014-12-15 Thread Lloyd
You can write the root cmake file in the samples directory then adding
project specific cmake file in the src directory.

You can also start by writing a single cmake file in the
src directory alone. Then move it to the samples directory, if the project
complexity increases

On Tue, Dec 16, 2014 at 10:45 AM, Deepak Garg deepak.g...@ingv.it wrote:

 I am a new bee in Cmake. I want to make a project with Cmake. The Project
 lay out is given below.

 deepak/
gales/
 directory_1_of_header_files/
 directory_2_of_header_files/
 directory_3_of_header_files/
 samples/
  src/
main.cpp
 top_header_files


 How should I start to construct CMakeLists.txt files? Any suggestion will
 be a great help. Thank you in advance

 Deepak

 --

 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

-- 

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] Run custom command only when dependency changes

2014-04-01 Thread Lloyd
Hi,

I am using visual studio. We are using visual studio message compiler
which compiles a .mc file and generate .rc and .h files as output. Our
project has a dependency on this .h file. What we want is to invoke
message compiler whenever the .mc file changes.

To achieve this I have used add_custom_command as given below

SET (MY_SRC Event_log.h other.cpp other1.cpp)

ADD_EXECUTABLE(MyExe ${MY_SRC }

add_custom_command(OUTPUT Event_log.h COMMAND mc Event_log.mc
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DEPENDS Event_log.mc)

Whenever I run the build command, this causes the mc to rerun each time
(even if the .mc file is not changed), and in effect recompiling a major
portion of my project.

May I know what am I doing wrong here?

Thanks,
  Lloyd
-- 

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://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Run custom command only when dependency changes

2014-04-01 Thread Lloyd
On Tue, Apr 1, 2014 at 12:55 PM, Nils Gladitz nilsglad...@gmail.com wrote:

 SET (MY_SRC Event_log.h other.cpp other1.cpp)

 ADD_EXECUTABLE(MyExe ${MY_SRC }

 add_custom_command(OUTPUT Event_log.h COMMAND mc Event_log.mc
 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DEPENDS Event_log.mc)

 Whenever I run the build command, this causes the mc to rerun each
 time (even if the .mc file is not changed), and in effect recompiling a
 major portion of my project.

 May I know what am I doing wrong here?


 The OUTPUT path is relative to the current binary directory.
 Since you set the WORKING_DIRECTORY to the current source directory (I
 assume this is where the output actually goes) the actual output path and
 the output you specified don't match up.

 This causes to command to rerun every time since the output as specified
 is never created.

 I would generate the output in the binary directory rather than the source
 directory if possible so that separate parallel build directories for the
 same source directory still work as intended.

 Nils



Thanks it solved the problem
-- 

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://www.cmake.org/mailman/listinfo/cmake

[CMake] custom nsis template- Install targets not working

2014-03-27 Thread Lloyd
Hi,

My CMake file contains the install comands like this

install(TARGETS MyExe RUNTIME DESTINATION .)

When I use the standard NSIS template, the installer is created with
MyExe. But our project needs a custom NSIS template so I have written
one, and it is generating an installer *without* MyExe.

So I made a comparison between my nsis template and the standard one.

The one big difference I found is the presence of

@CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS@
 @CPACK_NSIS_FULL_INSTALL@

after the SetOutPath $INSTDIR command. These above two variables seems to
be undocumented.

When the standard nsis template is processed, these lines are changed to

File /r ${INST_DIR}\*.*

I am struck at this point, how can I make my install targets command work?
Any hint or documentation would be greatly appreciated.

Thanks,
  Lloyd
-- 

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://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] custom nsis template- Install targets not working

2014-03-27 Thread Lloyd

 I am no NSIS expert so I can't imagine why 'File /r ${INST_DIR}\*.*'
 could possibly do ???



About the file command the NSIS documentation says this:
Adds file(s) to be extracted to the current output path ($OUTDIR).
If the /r switch is used, files and directories are added recursively.

That is, the File command copies the files (all files as it is *.*)
specified in the path ${INST_DIR}\*.* recursively to the current set output
directory of the NSIS. The value of the INST_DIR variable is the directory
which the user has selected at install time.





 So I guess that if your template does not contain such command you
 either need it


I tried adding @CPACK_NSIS_FULL_INSTALL@, and it generated File /r
${INST_DIR}\*.* but this causes NSIS an error. Now I am in the assumption
that CMake copies all the files hierarchically to some temp directory and
from that location it does the copy (this is only a wild guess).



 (and should use CPACK_NSIS_FULL_INSTALL in your template) or replace
 it with something more appropriate to you case.



What I don't understand is, what happens to the install targets commands
in the CMake file on windows platform
-- 

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://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] custom nsis template- Install targets not working

2014-03-27 Thread Lloyd
Solved the problem.

Further verification revealed that, when I build PACKAGE, it generates a
install_manifest.txt file in my build directory. It contains absolute
paths to copy of install files I mentioned using install targets command.
This temporary directory and its files are also created when we build the
PACKAGE target.

What caused all these problem is, I misread the INSTDIR in SetOutPath
command and INST_DIR in File command as the *same*

  SetOutPath $INSTDIR

  File /r ${INST_DIR}\*.*

tracing the INST_DIR value revealed that, it is defined in the template
as !define INST_DIR @CPACK_TEMPORARY_DIRECTORY@


Thanks a lot,
  Lloyd




On Thu, Mar 27, 2014 at 2:05 PM, Lloyd lloydkl.t...@gmail.com wrote:



 I am no NSIS expert so I can't imagine why 'File /r ${INST_DIR}\*.*'
 could possibly do ???



 About the file command the NSIS documentation says this:
 Adds file(s) to be extracted to the current output path ($OUTDIR).
 If the /r switch is used, files and directories are added recursively.

 That is, the File command copies the files (all files as it is *.*)
 specified in the path ${INST_DIR}\*.* recursively to the current set output
 directory of the NSIS. The value of the INST_DIR variable is the directory
 which the user has selected at install time.





 So I guess that if your template does not contain such command you
 either need it


 I tried adding @CPACK_NSIS_FULL_INSTALL@, and it generated File /r
 ${INST_DIR}\*.* but this causes NSIS an error. Now I am in the assumption
 that CMake copies all the files hierarchically to some temp directory and
 from that location it does the copy (this is only a wild guess).



 (and should use CPACK_NSIS_FULL_INSTALL in your template) or replace
 it with something more appropriate to you case.



 What I don't understand is, what happens to the install targets commands
 in the CMake file on windows platform


-- 

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://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] CPack error in visual studio 2010

2014-03-26 Thread Lloyd
The problem disappeared now. I suspect some application (may be the
antivirus or a virus) was keeping that file
(C:/Users/user1/Desktop/xyz/abc-1.0.0-win32.exe)
open.


On Tue, Mar 25, 2014 at 3:33 PM, Lloyd lloydkl.t...@gmail.com wrote:

 Hi,

 I am using CPack (CMake) with Visual Studio 2010. When I build Package,
 my NSIS based installer is getting created in the
 _CPack_Packages\win32\NSIS directory of the build directory. But the
 build process in Visual Studio throws an error like the following:

 Error 32 error : Problem copying the package:
 C:/Users/user1/Desktop/xyz/_CPack_Packages/win32/NSIS/abc-1.0.0-win32.exe
 to C:/Users/user1/Desktop/xyz/abc-1.0.0-win32.exe

 What could be the reason for a Problem copying the package error. As
 the installer creation is successful it is not generating NSISoutput.log
 file.


 Thanks,
   Lloyd

-- 

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://www.cmake.org/mailman/listinfo/cmake

[CMake] CPack error in visual studio 2010

2014-03-25 Thread Lloyd
Hi,

I am using CPack (CMake) with Visual Studio 2010. When I build Package,
my NSIS based installer is getting created in the
_CPack_Packages\win32\NSIS directory of the build directory. But the
build process in Visual Studio throws an error like the following:

Error 32 error : Problem copying the package:
C:/Users/user1/Desktop/xyz/_CPack_Packages/win32/NSIS/abc-1.0.0-win32.exe
to C:/Users/user1/Desktop/xyz/abc-1.0.0-win32.exe

What could be the reason for a Problem copying the package error. As the
installer creation is successful it is not generating NSISoutput.log file.


Thanks,
  Lloyd
-- 

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://www.cmake.org/mailman/listinfo/cmake

[CMake] CPack+ NSIS Template modificaiton

2014-03-20 Thread Lloyd
Hi,

We are using NSIS to install our application. It makes use of custom NSIS
plugin and MUI2 based custom interface. In order to accommodate this, I
thought of creating a new NSIS template for our project.

I have gone through the existing NSIS template (It uses MUI*1*). Is there
any document that help me to write the template?

The problem I face is, I am not able to identify the relationship between
the CPack variables (CPackConfig.cmake)  and the variables in
NSIS.template.in file. As an example,  CPackConfig.cmake file refers a
variable CPACK_NSIS_MUI_ICON but this variable is not present in the 
NSIS.template.in, instead there is a variable
@CPACK_NSIS_INSTALLER_MUI_ICON_CODE@ which controls the package's main
icon.

Anybody know this relationship works?

What is going on here, what is the right method to follow? I am reluctant
to use the existing NSIS template as it is bit complicated (from our point
of application) and also we want more functionality.

Thanks a lot,
   Lloyd
-- 

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://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Linking with boost

2014-03-18 Thread Lloyd
Thanks David, now it works, seems to be cache issue


On Fri, Mar 14, 2014 at 4:46 PM, David Cole dlrd...@aol.com wrote:

 If you start with a clean directory in each case, do you get the same
 results?

 (i.e. -- is the result of the first run cached, and re-used despite your
 change of variable value...?)


 HTH,
 David C.


-- 

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://www.cmake.org/mailman/listinfo/cmake

[CMake] Linking with boost

2014-03-13 Thread Lloyd
Hi,

Our project uses boost on Windows. Except thread library, all other library
need to be linked statically. To achieve this, what I did is this

ADD_DEFINITIONS(-D BOOST_THREAD_DYN_DLL)
set(Boost_USE_STATIC_LIBSON)
set(Boost_USE_MULTITHREADED  ON)
find_package( Boost COMPONENTS thread system date_time regex filesystem
chrono)

As per boost documentation, in windows the static boost libraries are
started with the name libboost*.lib and the import libraries of dlls
start with boost*.

If I turn ON or OFF  Boost_USE_STATIC_LIBS, the value returned by

GET_FILENAME_COMPONENT(BFILESYS ${Boost_FILESYSTEM_LIBRARY_RELEASE} NAME_WE)

is always  C:/Program
Files/boost_1_53_0/stage/lib/libboost_filesystem-vc100-mt-1_53.lib

I was expecting that, if the Boost_USE_STATIC_LIBS is ON, the output to be
*lib*boost_filesystem-vc100-mt-1_53.lib and if the  Boost_USE_STATIC_LIBS
is OFF, the output to be boost_filesystem-vc100-mt-1_53.lib.

Is anything going wrong here? Can anybody clarify this?

Thanks,
  Lloyd
-- 

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://www.cmake.org/mailman/listinfo/cmake

[CMake] Target Link Library

2014-03-12 Thread Lloyd
Hi,

My cross platform project has a main module and a custom library. The main
module depends on the custom library. Both these projects need to be built
with cmake. At present the option I find to set this is to using the
target_link_library(MyExe ${CMAKE_CURRENT_BINARY_DIR}/myLib.lib). But
this code makes my cmake file platform dependent, that is on windows I need
to use the MyLib.lib in CMake and on Linux I need to use MyLib.a ! Is
there a better alternative? (I went through the doc of find_library(), but
it doesn't seem to be suitable in this scenatio)

Thanks,
  Lloyd
-- 

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://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Target Link Library

2014-03-12 Thread Lloyd
Thank you very much for the simple and clean solution.

Thanks,
  Lloyd


On Wed, Mar 12, 2014 at 3:20 PM, Nils Gladitz nilsglad...@gmail.com wrote:

 On 12.03.2014 10:41, Nils Gladitz wrote:

 If you created the target with add_library(mylibrary ...)
 target_link_library(MyExe mylibrary) should work.


 Sorry, I didn't realize I copied your incorrectly named
 target_link_library() call ... the actual command should be
 target_link_libraries().

 Nils

-- 

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://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] custom NSIS installer

2013-05-07 Thread Lloyd
On Tue, May 7, 2013 at 4:22 AM, David Golub golu...@gmail.com wrote:

 Just put your NSIS.template.in in the root of your source tree along with
 CMakeLists.txt.  CMake will detect your file and use it instead of the one
 in the CMake installation.

 ** **

 David Golub



I would like to thank you all for the valuable information.

Thanks,
  Lloyd
--

Powered by www.kitware.com

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

Please keep messages on-topic and check 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] custom NSIS installer

2013-05-06 Thread Lloyd
I have read this - http://www.cmake.org/Wiki/CMake:CPackNSISAdvancedTips -
wiki article about executing custom nsis script.

It states that...

To start work on a custom NSIS script, simply create a file (or copy) into
your module path (e.g. CPACK_MODULE_PATH) called NSIS.template.in.

Checking the cmake documentation, there is no predefined variable named
CPACK_MODULE_PATH.

I could find a NSIS.template.in. in the cmake's (main cmake install
directory) modules directory. I believe cmake would not ask me to modify
this file, as each project's nsis template requirement would be different.

could you please let me know the correct location where I should create the
template file?

Thanks,
  Lloyd
--

Powered by www.kitware.com

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

Please keep messages on-topic and check 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 error in visual studio

2013-05-02 Thread Lloyd
Hi,

I am trying CPack in visual studio. When I build PACKAGE it throws me an
error like this:

  CMake Error at C:/BuildDir1/src/cmake_install.cmake:38 (message):
ABSOLUTE path INSTALL DESTINATION forbidden (by caller):

C:/BuildDir1/src/Debug/QtGuid4.dll;C:/BuildDir1/src/Debug/QtCored4.dll;C:/BuildDir1/src/Debug/reverse.dll
  Call Stack (most recent call first):
C:/BuildDir1/cmake_install.cmake:33 (INCLUDE)

I cannot interpret this error, can you please help me?

I have written packaging related code only in my main cmakelist file. Its
content is given below

#Packing related code
SET (GENERATE_PACKAGE false CACHE BOOL Do package generation?)
if(GENERATE_PACKAGE)
#INCLUDE(InstallRequiredSystemLibraries)
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY A Tutorial)
SET(CPACK_PACKAGE_VENDOR x)
SET(CPACK_PACKAGE_DESCRIPTION_FILE
${CMAKE_CURRENT_SOURCE_DIR}/Readme.txt)
SET(CPACK_RESOURCE_FILE_LICENSE
${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt)
SET(CPACK_PACKAGE_VERSION_MAJOR 1)
SET(CPACK_PACKAGE_VERSION_MINOR 0)
SET(CPACK_PACKAGE_VERSION_PATCH 0)
#SET(CPACK_PACKAGE_INSTALL_DIRECTORY Tutorial)
IF(WIN32 AND NOT UNIX)

set(CPACK_GENERATOR NSIS)
set(CPACK_MONOLITHIC_INSTALL 1)
#set(CPACK_RESOURCE_FILE_LICENSE ${ROOTDIR}/LICENSE)
#set(CPACK_RESOURCE_FILE_README ${ROOTDIR}/README)
set(CPACK_PACKAGE_EXECUTABLES Tutorial My CMake Tutorial)
include(CPack)

ENDIF(WIN32 AND NOT UNIX)
ENDIF(GENERATE_PACKAGE)

One of the install command present in my cmake file is also given below

INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/bin/Debug/Tutorial.exe
DESTINATION ${CPACK_PACKAGE_INSTALL_DIRECTORY} CONFIGURATIONS Debug)


Any guidance is much appreciated.

Thanks,
  Lloyd
--

Powered by www.kitware.com

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

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

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

Re: [CMake] default CONFIGURATIONS in cygwin

2013-05-02 Thread Lloyd
I have faced an issue with Debug and Release builds. Reading the Andreas'
reply made me to rethink and modify my cmake files. Reading the VTK
cmakefile, I have seen an entry like this in it

# Set a default build type if none was specified
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS Setting build type to 'Debug' as none was specified.)
set(CMAKE_BUILD_TYPE Debug CACHE STRING Choose the type of build.
FORCE)
#Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS Debug Release
MinSizeRel RelWithDebInfo)
endif()




On Thu, May 2, 2013 at 9:04 PM, Stephen Kelly steve...@gmail.com wrote:

 Lloyd wrote:

  Hi,
 
  I am studying to compile an application using CMake in Cygwin. I am
  installing a file using the install command based on the value of
  CONFIGURATIONS variable.
 
  May I know the default configuration (debug, release) in cygwin
 
  I get Debug folders in the build directory when I build the same project
  with visual studio, but in the cygwin build directory, no Debug or
 Release
  folders are created!

 I haven't tried, and I don't know anything about cygwin, but I'm reminded
 of

  http://public.kitware.com/Bug/view.php?id=12301

 Is it similar?

 Thanks,

 Steve.


 --

 Powered by www.kitware.com

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

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

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

--

Powered by www.kitware.com

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

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

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

Re: [CMake] coverage using gcov failed

2013-05-01 Thread Lloyd
On Thu, Apr 25, 2013 at 7:35 PM, Bill Hoffman bill.hoff...@kitware.comwrote:

 On 4/25/2013 9:52 AM, Bill Hoffman wrote:

 I see it now.

 Can you run:

 ctest -D Experimental -VV

 OK, never mind I know what is wrong...

 make ExperimentalCoverage just does the coverage part.
 make Experimental
 make ExpermentalCoverage should work.

 Or

 cd buildtree
 ctest -T all


 Available options are:
   ctest -T all
   ctest -T start
   ctest -T update
   ctest -T configure
   ctest -T build
   ctest -T test
   ctest -T coverage
   ctest -T memcheck
   ctest -T notes
   ctest -T submit



I have been debugging this issue. To make sure that I have a clean
environment I am testing the code on Ubuntu 12.4 32bit.  My system was
installed only with gcov, lcov was not installed. Now I have installed
lcov and also I have modified my main cmake file with the below given
code frahment. Instead of modifying CXX_FLAGS, added the profiling related
compiler arguments using the ADD_DEFINITIONS. In the first case
(modifying CXX_FLAGS) your suggestion make Experimental did not work. Now
(ADD_DEFINITIONS) make Experimental works without any problem. Can you
comment on why it was not working earlier?

#Code coverage related code

SET (DO_CODE_COVERAGE false CACHE BOOL Enable Code coverage?)

if(DO_CODE_COVERAGE)
ADD_DEFINITIONS(-fprofile-arcs -ftest-coverage)
LINK_LIBRARIES(gcov)
endif(DO_CODE_COVERAGE)

Thanks,
  Lloyd






 -Bill


 --

 Powered by www.kitware.com

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

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

 Follow this link to subscribe/unsubscribe:
 http://www.cmake.org/mailman/**listinfo/cmakehttp://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] solving dll dependency

2013-04-30 Thread Lloyd
Hi,

I am learning the right way to write cmake files. As part of this I have
downloaded the source code of vtk and cmake (to see its cmake files), and
built them using visual studio on Windows 7.

At present my main doubt is about the dlls. In cmake bin (the build output
directory) directory I could not find any third party libraries (dll) like
qt. But cmake gui has a dependency on qt (I have checked the linker
settings of the project). I am also able to run the cmake gui from the bin
directory.

How cmake effectively resolves the dll dependency? Usually in our projects,
we just copy the dlls to the executable directory.here what method is used
by cmake-gui ?

Thanks,
  Lloyd
--

Powered by www.kitware.com

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

Please keep messages on-topic and check 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] default CONFIGURATIONS in cygwin

2013-04-27 Thread Lloyd
Hi,

I am studying to compile an application using CMake in Cygwin. I am
installing a file using the install command based on the value of
CONFIGURATIONS variable.

May I know the default configuration (debug, release) in cygwin

I get Debug folders in the build directory when I build the same project
with visual studio, but in the cygwin build directory, no Debug or Release
folders are created!

Hoe can solve this?

Is there any option in make to specify the build?

I checked make help , did not see any option for this

Thanks,
  Lloyd
--

Powered by www.kitware.com

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

Please keep messages on-topic and check 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] Cygwin Boost find error

2013-04-25 Thread Lloyd
Hi,
I am building a project in both Windows 7 and Cygwin. I am using boost
libraries in the project and it works correctly in windows

FIND_PACKAGE(Boost REQUIRED COMPONENTS unit_test_framework)

When I try to configure in cygwin it returns error saying that could not
find boost. From Cygwin installer i have installed boost (both source as
well as the library version). Still cmake could not find it. I also tried
to locate the library, but could not find it. Can you please tell me the
default location of boost in cygwin? or is there a way to locate the
install paths of libraries?

I think it is not possible to use the Windows version of boost with cygwin
as I am using different compilers (Visual studio in windows and gcc in
cygwin).

Thanks,
  Lloyd
--

Powered by www.kitware.com

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

Please keep messages on-topic and check 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] Cygwin Boost find error

2013-04-25 Thread Lloyd
Thanks the link helped me to solved the problem. Sorry, I shall avoid
irrelevant posts in the future


On Thu, Apr 25, 2013 at 12:30 PM, marco atzeri marco.atz...@gmail.comwrote:

 On 4/25/2013 8:54 AM, Lloyd wrote:

 Hi,
 I am building a project in both Windows 7 and Cygwin. I am using boost
 libraries in the project and it works correctly in windows

 FIND_PACKAGE(Boost REQUIRED COMPONENTS unit_test_framework)

 When I try to configure in cygwin it returns error saying that could not
 find boost. From Cygwin installer i have installed boost (both source as
 well as the library version). Still cmake could not find it. I also
 tried to locate the library, but could not find it. Can you please tell
 me the default location of boost in cygwin? or is there a way to locate
 the install paths of libraries?


 this is more a question for cygwin help list,
 anyway the development headers and libraries location
 are reported here:

 http://cygwin.com/packages/**libboost-devel/libboost-devel-**1.50.0-1http://cygwin.com/packages/libboost-devel/libboost-devel-1.50.0-1



 I think it is not possible to use the Windows version of boost with
 cygwin as I am using different compilers (Visual studio in windows and
 gcc in cygwin).


 correct. gcc4 package for cygwin


 Thanks,
Lloyd




 --

 Powered by www.kitware.com

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

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

 Follow this link to subscribe/unsubscribe:
 http://www.cmake.org/mailman/**listinfo/cmakehttp://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] coverage using gcov failed

2013-04-25 Thread Lloyd
Hi,

I am trying cmake in cygwin for code coverage analysis using gcov. My
source code is arranged as follows

CMakeLists.txt  src  tests

./src:
CMakeLists.txt  lib  main.cpp

./src/lib:
reverse

./src/lib/reverse:
CMakeLists.txt  reverse.cpp  reverse.h

./tests:
CMakeLists.txt  test_rev.cpp  test_runner.cpp



My main make file is also given below

#Root cmake file
cmake_minimum_required (VERSION 2.6)
PROJECT (Tutorial)
SET (DO_TEST false CACHE BOOL Enable Testing?)
SET (DO_CODE_COVERAGE false CACHE BOOL Enable Code coverage?)

if(DO_CODE_COVERAGE)
MESSAGE (STATUS Code coverage is enabled)
SET(CMAKE_CXX_FLAGS=-g -O0 -Wall -W -Wshadow -Wunused-variable
-Wunused-parameter -Wunused-function -Wunused -Wno-system-headers
-Wno-deprecated -Woverloaded-virtual -Wwrite-strings -fprofile-arcs
-ftest-coverage)
SET(CMAKE_C_FLAGS=-g -O0 -Wall -W -fprofile-arcs -ftest-coverage)
SET(CMAKE_SHARED_LINKER_FLAGS=-fprofile-arcs -ftest-coverage)
SET(CMAKE_EXE_LINKER_FLAGS=-fprofile-arcs -ftest-coverage)
endif(DO_CODE_COVERAGE)

ADD_SUBDIRECTORY(src/lib/reverse)
ADD_SUBDIRECTORY(src)

#Testing related code
if(DO_TEST)
MESSAGE (STATUS Testing is enabled)
ADD_SUBDIRECTORY(tests)
#ENABLE_TESTING()
include( CTest )
ADD_TEST(NAME Test WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/src/Debug COMMAND
test_rev)
endif(DO_TEST)


And the major portion of the cmake file of test executable is also given
below.


#Cmake file of Tests
cmake_minimum_required (VERSION 2.6)

SET(TST_SRC test_rev.cpp test_runner.cpp)

FIND_PACKAGE(Boost REQUIRED COMPONENTS unit_test_framework)

INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}../../src/lib/reverse)
ADD_DEFINITIONS(-DBOOST_TEST_DYN_LINK)
ADD_EXECUTABLE(test_rev ${TST_SRC})
TARGET_LINK_LIBRARIES(test_rev ${Boost_LIBRARIES})
TARGET_LINK_LIBRARIES(test_rev Reverse)
if(DO_CODE_COVERAGE)
MESSAGE(Yes code coverage in test)
TARGET_LINK_LIBRARIES(test_rev gcov)
endif(DO_CODE_COVERAGE)

When I run, I get the following error

$ make ExperimentalCoverage
   Site: llvm
   Build name: CYGWIN-c++.exe
Performing coverage
 Cannot find any coverage files. Ignoring Coverage request.
Built target ExperimentalCoverage

Why is the coverage files are not created?

Thanks,
  Lloyd
--

Powered by www.kitware.com

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

Please keep messages on-topic and check 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] Copy dlls to release and debug folder

2013-04-19 Thread Lloyd
Thankyou Thomas, it works now... Another issue I was faced with the first
script is, it assumes that the dlls are in the lib folder of Qt (I think
you build qt from source). I have downloaded the prebuilt Qt library, in
that the dlls are in the bin folder. I modified the macro you have given,
as below...

MACRO(GetDLLs DEBUG_NAME RELEASE_NAME)

#Copy Debug dlls
LIST(APPEND ${DEBUG_NAME} ${QT_BINARY_DIR}/QtGuid4.dll)
...


On Thu, Apr 18, 2013 at 6:51 PM, Thomas Richard
thomas.rich...@imgtec.comwrote:

 Normally when you find the Qt4 package it selects some defaults libraries
 (and the QT_USE_FILE). But you have to specify some extra modules you may
 need before including the QT_USE_FILE. The QT_USE_FILE defines the
 dependencies and includes the folders you need.

 For example I have:

 find_package(Qt4 REQUIRED)

 # loads of crap about my libraries

 set (QT_USE_QTGUI TRUE)
 include(${QT_USE_FILE})

 set (SOURCES #with my sources)
 set (HEADERS # with my headers)
 set(HEADERS_MOC) # to define an empty variable
 QT4_WRAP_CPP(HEADERS_MOC ${HEADERS})

 add_executable(ParamGui ${SOURCES} ${HEADERS_MOC} ${HEADERS})
 set_source_files_properties(${HEADERS_MOC} PROPERTIES GENERATED TRUE)
 target_link_libraries(ParamGui ${QT_LIBRARIES})

 From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf
 Of Lloyd
 Sent: 18 April 2013 12:40
 To: Thomas Richard
 Cc: CMake ML
 Subject: Re: [CMake] Copy dlls to release and debug folder

 I assume that this is the recommended approach.

 I tried to use the script you have provided, the call GetQtDLLs(DEBUG_DLLS
 RELEASE_DLLS) is not populating any of the variables (DEBUG_DLLS or
 RELEASE_DLLS) with qt dll names. I am new to cmake, Am I missing something?


 Thanks,
   Lloyd

 On Thu, Apr 18, 2013 at 4:21 PM, Thomas Richard thomas.rich...@imgtec.com
 wrote:
 Hi Lloyd,

 Personally I copy the DLLs to the VS folder (so that the program can be
 run from visual studio) using the following script.
 It looks more complicated than it is.

 A macro is available to several of my projects to select which Qt module
 they use and create a list of dlls to copy.
 Then I simply choose where to copy the DLLs according to the generator.
 I also add them to the list of files to install.
 Finally the last line is to remove the command prompt opening.



 MACRO(GetQtDLLs DEBUG_NAME RELEASE_NAME)

 FOREACH(module QT3SUPPORT QTOPENGL QTASSISTANT QTDESIGNER QTMOTIF
 QTNSPLUGIN
QAXSERVER QAXCONTAINER QTDECLARATIVE QTSCRIPT QTSVG
 QTUITOOLS QTHELP
QTWEBKIT PHONON QTSCRIPTTOOLS QTMULTIMEDIA QTGUI QTTEST
 QTDBUS QTXML QTSQL
QTXMLPATTERNS QTNETWORK QTCORE)

 if (QT_USE_${module} OR QT_USE_${module}_DEPENDS)

 string(REPLACE .lib .dll QT_${module}_DLL
 ${QT_${module}_LIBRARY_DEBUG})
 set (${DEBUG_NAME} ${${DEBUG_NAME}} ${QT_${module}_DLL})

 string(REPLACE .lib .dll QT_${module}_DLL
 ${QT_${module}_LIBRARY_RELEASE})
 set (${RELEASE_NAME} ${${RELEASE_NAME}}
 ${QT_${module}_DLL})

 endif()

 ENDFOREACH(module)

 ENDMACRO()

 if (WIN32)
 GetQtDLLs(DEBUG_DLLS RELEASE_DLLS)

 if (${CMAKE_GENERATOR} MATCHES Visual Studio 11)
 # visual studio 12 expects the DLLs in the executable
 folder.
 # but not the resources!
 # can be changed into the environment property of the
 project to include the project's directory
 set (DLL_TO_DBG ${CMAKE_CURRENT_BINARY_DIR}/Debug)
 set (DLL_TO_RELEASE ${CMAKE_CURRENT_BINARY_DIR}/Release)
 else()
 # for other version of visual studio the DLLs are expected
 into the project folder
 set (DLL_TO_DBG ${CMAKE_CURRENT_BINARY_DIR})
 set (DLL_TO_RELEASE ${CMAKE_CURRENT_BINARY_DIR})
 endif()

 foreach(dll ${DEBUG_DLLS})
 file(COPY ${dll} DESTINATION ${DLL_TO_DBG})
 endforeach()

 foreach(dll ${RELEASE_DLLS})
 file(COPY ${dll} DESTINATION ${DLL_TO_RELEASE})
 endforeach()

 install(FILES ${RELEASE_DLLS} DESTINATION
 ${INSTALL_FELIXPARAMGUI_PATH} CONFIGURATIONS Release)

 #
 # this is disabled for debug only (so signal/slots connect
 failures are seen)!
 #
 # this property is used to remove the prompt window when running
 the GUI from the explorer on WIN32
 # doesn't have effect on linux
 #
 set_target_properties(FelixParamGui PROPERTIES WIN32_EXECUTABLE
 ${FELIXPARAMGUI_WIN32EXE})
 endif()

 From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf
 Of Lloyd
 Sent: 18 April 2013 11:33
 To: CMake ML
 Subject: [CMake] Copy dlls to release and debug folder

 Hi,

 I was successful in creating and building a project using CMake on Windows
 (Visual Studio). After the build when I try to run the application it
 throws an error asking for the dlls of Qt (I know

[CMake] Get path to release folder

2013-04-19 Thread Lloyd
Hi,

My project hierarchy is as shown below

Code  ;Root cmake file
Code/Src;Main Source code and the cmake file
Code/lib/reverse   ; Library source code and the cmake file

When I compile the project I get the outputs in these folder structure

BuildDir\src\Debug;Main executable
BuildDir\src\lib\reverse\Debug ; reverse.dll library directory

What is the right method to get the path to the library (reverse.dll)
directory? or can you please suggest a method to get this path in a
portable (crossplatform) way?

Thanks,
  Lloyd
--

Powered by www.kitware.com

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

Please keep messages on-topic and check 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] Error in running tests

2013-04-19 Thread Lloyd
Thanks again. Setting the WORKING_DIRECTORY worked for me...


On Mon, Apr 15, 2013 at 5:17 PM, Petr Kmoch petr.km...@gmail.com wrote:

 It's good the second signature works; I believe there's hardly ever use
 for using the first one, anyway.

 As for the DLLs, would it help if you set the WORKING_DIRECTORY parameter
 in add_test(), and/or set the PATH env. variable using the test's property
 ENVIRONMENT?

 On Unix systems, the path issues should be handled by RPATH/RUNPATH.

 Petr


 On Mon, Apr 15, 2013 at 10:58 AM, Lloyd lloydkl.t...@gmail.com wrote:




 On Mon, Apr 15, 2013 at 12:10 PM, Petr Kmoch petr.km...@gmail.comwrote:

 The errors VS spews out aren't really useful. However, if you go to
 ${CMAKE_BINARY_DIR}/Testing/Temporary, there are log files. LastTest.log
 should tell you a bit more.

 Can you also try/report on my second question? (2. Does it work if you
 use the enhanced signature of add_test? I mean 'add_test(NAME Test COMMAND
 test_rev)')


 Sorry, I missed the important point you suggested try. Yes, When I tried
 the 'add_test(NAME Test COMMAND test_rev)') format, it works.

 To make it work I had to manually copy the boost test library (dll) as
 well as the my libraries dll to the root of build folder. What is the
 approach used by professional developers? I tried looking at the cmake
 file of VTK, but it contains only MAKE_DIRECTORY and ADD_SUBDIRECTORY
 commands!

 Thanks
   Lloyd





  Petr


 On Mon, Apr 15, 2013 at 6:43 AM, Lloyd lloydkl.t...@gmail.com wrote:


 On Fri, Apr 12, 2013 at 5:00 PM, Lloyd lloydkl.t...@gmail.com wrote:

 of course... This is the source of my test cmake file

 #Cmake file of Tests
 cmake_minimum_required (VERSION 2.6)

 SET(TST_SRC test_rev.cpp test_runner.cpp)

 FIND_PACKAGE(Boost REQUIRED COMPONENTS unit_test_framework)

 INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}../../src/lib/reverse)
 ADD_DEFINITIONS(-DBOOST_TEST_DYN_LINK)
 ADD_EXECUTABLE(test_rev ${TST_SRC})
 TARGET_LINK_LIBRARIES(test_rev ${Boost_LIBRARIES})
 TARGET_LINK_LIBRARIES(test_rev Reverse)



 As a temporary solution to this I have copied the test executable and
 its dependent dlls to the root folder of the build directory. When I run
 RUN_TETS project in Visual Studio, it throws me some other error like


 -- Build started: Project: RUN_TESTS, Configuration: Debug Win32
 --
   Test project E:/CMakeDemo/BuildDir
   Start 1: Test
   1/1 Test #1: Test .***Failed0.16 sec

   0% tests passed, 1 tests failed out of 1

   Total Test time (real) =   2.42 sec

   The following tests FAILED:
 1 - Test (Failed)
   Errors while running CTest
 C:\Program
 Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error
 MSB3073: The command setlocal
 C:\Program
 Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error
 MSB3073: C:\Program Files\CMake 2.8\bin\ctest.exe
 --force-new-ctest-process -C Debug
 C:\Program
 Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error
 MSB3073: if %errorlevel% neq 0 goto :cmEnd
 C:\Program
 Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error
 MSB3073: :cmEnd
 C:\Program
 Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error
 MSB3073: endlocal  call :cmErrorLevel %errorlevel%  goto :cmDone
 C:\Program
 Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error
 MSB3073: :cmErrorLevel
 C:\Program
 Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error
 MSB3073: exit /b %1
 C:\Program
 Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error
 MSB3073: :cmDone
 C:\Program
 Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error
 MSB3073: if %errorlevel% neq 0 goto :VCEnd
 C:\Program
 Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error
 MSB3073: :VCEnd exited with code 8.
  Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped
 ==

 I cannot interpret these errors, can you please give some hint?

 Thanks,
   Lloyd






 On Fri, Apr 12, 2013 at 4:55 PM, Petr Kmoch petr.km...@gmail.comwrote:

 1. Can you post tests/CMakeLists.txt (or at least the parts relevant
 to creating test_rev)?

 2. Does it work if you use the enhanced signature of add_test? I mean
 'add_test(NAME Test COMMAND test_rev)'

 Petr


 On Fri, Apr 12, 2013 at 1:18 PM, Lloyd lloydkl.t...@gmail.comwrote:

 Yes I built the test and it is in

 E:\CMakeDemo\BuildDir\tests\Debug\test_rev.exe

 I don't know the right way to locate this test executable for cmake

 Thanks,
   Lloyd



 On Fri, Apr 12, 2013 at 4:42 PM, Petr Kmoch petr.km...@gmail.comwrote:

 Hi Lloyd.

 Do you actually have a target (executable) named test_rev? And
 have you built it before running RUN_TESTS? RUN_TEST (or its Makefile
 equivalent 'make test') doesn't automatically build the test 
 executables
 before running them.

 Petr

[CMake] Copy dlls to release and debug folder

2013-04-18 Thread Lloyd
Hi,

I was successful in creating and building a project using CMake on Windows
(Visual Studio). After the build when I try to run the application it
throws an error asking for the dlls of Qt (I know it is a common case in
Windows, usually we do copy the dlls to debug/release folder where the exe
resides). When I searched the mailing list, I have seen an advise to
use add_custom_command(TARGET
...). Is this the right approach? Wont it be executed after each build,
thus causing repeated dll copies?

Can you please suggest me the right way?

Thanks,
  Lloyd
--

Powered by www.kitware.com

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

Please keep messages on-topic and check 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] Copy dlls to release and debug folder

2013-04-18 Thread Lloyd
I assume that this is the recommended approach.

I tried to use the script you have provided, the call GetQtDLLs(DEBUG_DLLS
RELEASE_DLLS) is not populating any of the variables (DEBUG_DLLS or
RELEASE_DLLS) with qt dll names. I am new to cmake, Am I missing something?


Thanks,
  Lloyd


On Thu, Apr 18, 2013 at 4:21 PM, Thomas Richard
thomas.rich...@imgtec.comwrote:

 Hi Lloyd,

 Personally I copy the DLLs to the VS folder (so that the program can be
 run from visual studio) using the following script.
 It looks more complicated than it is.

 A macro is available to several of my projects to select which Qt module
 they use and create a list of dlls to copy.
 Then I simply choose where to copy the DLLs according to the generator.
 I also add them to the list of files to install.
 Finally the last line is to remove the command prompt opening.



 MACRO(GetQtDLLs DEBUG_NAME RELEASE_NAME)

 FOREACH(module QT3SUPPORT QTOPENGL QTASSISTANT QTDESIGNER QTMOTIF
 QTNSPLUGIN
QAXSERVER QAXCONTAINER QTDECLARATIVE QTSCRIPT QTSVG
 QTUITOOLS QTHELP
QTWEBKIT PHONON QTSCRIPTTOOLS QTMULTIMEDIA QTGUI QTTEST
 QTDBUS QTXML QTSQL
QTXMLPATTERNS QTNETWORK QTCORE)

 if (QT_USE_${module} OR QT_USE_${module}_DEPENDS)

 string(REPLACE .lib .dll QT_${module}_DLL
 ${QT_${module}_LIBRARY_DEBUG})
 set (${DEBUG_NAME} ${${DEBUG_NAME}} ${QT_${module}_DLL})

 string(REPLACE .lib .dll QT_${module}_DLL
 ${QT_${module}_LIBRARY_RELEASE})
 set (${RELEASE_NAME} ${${RELEASE_NAME}}
 ${QT_${module}_DLL})

 endif()

 ENDFOREACH(module)

 ENDMACRO()

 if (WIN32)
 GetQtDLLs(DEBUG_DLLS RELEASE_DLLS)

 if (${CMAKE_GENERATOR} MATCHES Visual Studio 11)
 # visual studio 12 expects the DLLs in the executable
 folder.
 # but not the resources!
 # can be changed into the environment property of the
 project to include the project's directory
 set (DLL_TO_DBG ${CMAKE_CURRENT_BINARY_DIR}/Debug)
 set (DLL_TO_RELEASE ${CMAKE_CURRENT_BINARY_DIR}/Release)
 else()
 # for other version of visual studio the DLLs are expected
 into the project folder
 set (DLL_TO_DBG ${CMAKE_CURRENT_BINARY_DIR})
 set (DLL_TO_RELEASE ${CMAKE_CURRENT_BINARY_DIR})
 endif()

 foreach(dll ${DEBUG_DLLS})
 file(COPY ${dll} DESTINATION ${DLL_TO_DBG})
 endforeach()

 foreach(dll ${RELEASE_DLLS})
 file(COPY ${dll} DESTINATION ${DLL_TO_RELEASE})
 endforeach()

 install(FILES ${RELEASE_DLLS} DESTINATION
 ${INSTALL_FELIXPARAMGUI_PATH} CONFIGURATIONS Release)

 #
 # this is disabled for debug only (so signal/slots connect
 failures are seen)!
 #
 # this property is used to remove the prompt window when running
 the GUI from the explorer on WIN32
 # doesn't have effect on linux
 #
 set_target_properties(FelixParamGui PROPERTIES WIN32_EXECUTABLE
 ${FELIXPARAMGUI_WIN32EXE})
 endif()

 From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf
 Of Lloyd
 Sent: 18 April 2013 11:33
 To: CMake ML
 Subject: [CMake] Copy dlls to release and debug folder

 Hi,

 I was successful in creating and building a project using CMake on Windows
 (Visual Studio). After the build when I try to run the application it
 throws an error asking for the dlls of Qt (I know it is a common case in
 Windows, usually we do copy the dlls to debug/release folder where the exe
 resides). When I searched the mailing list, I have seen an advise to use
 add_custom_command(TARGET ...). Is this the right approach? Wont it be
 executed after each build, thus causing repeated dll copies?

 Can you please suggest me the right way?

 Thanks,
   Lloyd


--

Powered by www.kitware.com

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

Please keep messages on-topic and check 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] Error in running tests

2013-04-15 Thread Lloyd
On Mon, Apr 15, 2013 at 12:10 PM, Petr Kmoch petr.km...@gmail.com wrote:

 The errors VS spews out aren't really useful. However, if you go to
 ${CMAKE_BINARY_DIR}/Testing/Temporary, there are log files. LastTest.log
 should tell you a bit more.

 Can you also try/report on my second question? (2. Does it work if you use
 the enhanced signature of add_test? I mean 'add_test(NAME Test COMMAND
 test_rev)')


Sorry, I missed the important point you suggested try. Yes, When I tried
the 'add_test(NAME Test COMMAND test_rev)') format, it works.

To make it work I had to manually copy the boost test library (dll) as well
as the my libraries dll to the root of build folder. What is the approach
used by professional developers? I tried looking at the cmake file of
VTK, but it contains only MAKE_DIRECTORY and ADD_SUBDIRECTORY commands!

Thanks
  Lloyd





 Petr


 On Mon, Apr 15, 2013 at 6:43 AM, Lloyd lloydkl.t...@gmail.com wrote:


 On Fri, Apr 12, 2013 at 5:00 PM, Lloyd lloydkl.t...@gmail.com wrote:

 of course... This is the source of my test cmake file

 #Cmake file of Tests
 cmake_minimum_required (VERSION 2.6)

 SET(TST_SRC test_rev.cpp test_runner.cpp)

 FIND_PACKAGE(Boost REQUIRED COMPONENTS unit_test_framework)

 INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}../../src/lib/reverse)
 ADD_DEFINITIONS(-DBOOST_TEST_DYN_LINK)
 ADD_EXECUTABLE(test_rev ${TST_SRC})
 TARGET_LINK_LIBRARIES(test_rev ${Boost_LIBRARIES})
 TARGET_LINK_LIBRARIES(test_rev Reverse)



 As a temporary solution to this I have copied the test executable and its
 dependent dlls to the root folder of the build directory. When I run
 RUN_TETS project in Visual Studio, it throws me some other error like


 -- Build started: Project: RUN_TESTS, Configuration: Debug Win32
 --
   Test project E:/CMakeDemo/BuildDir
   Start 1: Test
   1/1 Test #1: Test .***Failed0.16 sec

   0% tests passed, 1 tests failed out of 1

   Total Test time (real) =   2.42 sec

   The following tests FAILED:
 1 - Test (Failed)
   Errors while running CTest
 C:\Program
 Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error
 MSB3073: The command setlocal
 C:\Program
 Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error
 MSB3073: C:\Program Files\CMake 2.8\bin\ctest.exe
 --force-new-ctest-process -C Debug
 C:\Program
 Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error
 MSB3073: if %errorlevel% neq 0 goto :cmEnd
 C:\Program
 Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error
 MSB3073: :cmEnd
 C:\Program
 Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error
 MSB3073: endlocal  call :cmErrorLevel %errorlevel%  goto :cmDone
 C:\Program
 Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error
 MSB3073: :cmErrorLevel
 C:\Program
 Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error
 MSB3073: exit /b %1
 C:\Program
 Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error
 MSB3073: :cmDone
 C:\Program
 Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error
 MSB3073: if %errorlevel% neq 0 goto :VCEnd
 C:\Program
 Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error
 MSB3073: :VCEnd exited with code 8.
  Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==

 I cannot interpret these errors, can you please give some hint?

 Thanks,
   Lloyd






 On Fri, Apr 12, 2013 at 4:55 PM, Petr Kmoch petr.km...@gmail.comwrote:

 1. Can you post tests/CMakeLists.txt (or at least the parts relevant to
 creating test_rev)?

 2. Does it work if you use the enhanced signature of add_test? I mean
 'add_test(NAME Test COMMAND test_rev)'

 Petr


 On Fri, Apr 12, 2013 at 1:18 PM, Lloyd lloydkl.t...@gmail.com wrote:

 Yes I built the test and it is in

 E:\CMakeDemo\BuildDir\tests\Debug\test_rev.exe

 I don't know the right way to locate this test executable for cmake

 Thanks,
   Lloyd



 On Fri, Apr 12, 2013 at 4:42 PM, Petr Kmoch petr.km...@gmail.comwrote:

 Hi Lloyd.

 Do you actually have a target (executable) named test_rev? And have
 you built it before running RUN_TESTS? RUN_TEST (or its Makefile 
 equivalent
 'make test') doesn't automatically build the test executables before
 running them.

 Petr


 On Fri, Apr 12, 2013 at 1:08 PM, Lloyd lloydkl.t...@gmail.comwrote:

 Hi,

 I was successful in creating and compiling a simple project
 C++/Visual studio using cmake. I have also included one unit test 
 project.
 All these projects builds successfully. The test project source and main
 project source resides in the root directory of the project. When I try 
 to
 run RUN_TESTS it gives me an error

 Test project E:/CMakeDemo/BuildDir
 1  Start 1: Test
 1  Could not find executable test_rev
 1  Looked in the following places:
 1  Unable to find executable: test_rev
 1

Re: [CMake] Error in running tests

2013-04-14 Thread Lloyd
On Fri, Apr 12, 2013 at 5:00 PM, Lloyd lloydkl.t...@gmail.com wrote:

 of course... This is the source of my test cmake file

 #Cmake file of Tests
 cmake_minimum_required (VERSION 2.6)

 SET(TST_SRC test_rev.cpp test_runner.cpp)

 FIND_PACKAGE(Boost REQUIRED COMPONENTS unit_test_framework)

 INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}../../src/lib/reverse)
 ADD_DEFINITIONS(-DBOOST_TEST_DYN_LINK)
 ADD_EXECUTABLE(test_rev ${TST_SRC})
 TARGET_LINK_LIBRARIES(test_rev ${Boost_LIBRARIES})
 TARGET_LINK_LIBRARIES(test_rev Reverse)



As a temporary solution to this I have copied the test executable and its
dependent dlls to the root folder of the build directory. When I run
RUN_TETS project in Visual Studio, it throws me some other error like


-- Build started: Project: RUN_TESTS, Configuration: Debug Win32 --
  Test project E:/CMakeDemo/BuildDir
  Start 1: Test
  1/1 Test #1: Test .***Failed0.16 sec

  0% tests passed, 1 tests failed out of 1

  Total Test time (real) =   2.42 sec

  The following tests FAILED:
1 - Test (Failed)
  Errors while running CTest
C:\Program
Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error
MSB3073: The command setlocal
C:\Program
Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error
MSB3073: C:\Program Files\CMake 2.8\bin\ctest.exe
--force-new-ctest-process -C Debug
C:\Program
Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error
MSB3073: if %errorlevel% neq 0 goto :cmEnd
C:\Program
Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error
MSB3073: :cmEnd
C:\Program
Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error
MSB3073: endlocal  call :cmErrorLevel %errorlevel%  goto :cmDone
C:\Program
Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error
MSB3073: :cmErrorLevel
C:\Program
Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error
MSB3073: exit /b %1
C:\Program
Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error
MSB3073: :cmDone
C:\Program
Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error
MSB3073: if %errorlevel% neq 0 goto :VCEnd
C:\Program
Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error
MSB3073: :VCEnd exited with code 8.
 Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==

I cannot interpret these errors, can you please give some hint?

Thanks,
  Lloyd






 On Fri, Apr 12, 2013 at 4:55 PM, Petr Kmoch petr.km...@gmail.com wrote:

 1. Can you post tests/CMakeLists.txt (or at least the parts relevant to
 creating test_rev)?

 2. Does it work if you use the enhanced signature of add_test? I mean
 'add_test(NAME Test COMMAND test_rev)'

 Petr


 On Fri, Apr 12, 2013 at 1:18 PM, Lloyd lloydkl.t...@gmail.com wrote:

 Yes I built the test and it is in

 E:\CMakeDemo\BuildDir\tests\Debug\test_rev.exe

 I don't know the right way to locate this test executable for cmake

 Thanks,
   Lloyd



 On Fri, Apr 12, 2013 at 4:42 PM, Petr Kmoch petr.km...@gmail.comwrote:

 Hi Lloyd.

 Do you actually have a target (executable) named test_rev? And have
 you built it before running RUN_TESTS? RUN_TEST (or its Makefile equivalent
 'make test') doesn't automatically build the test executables before
 running them.

 Petr


 On Fri, Apr 12, 2013 at 1:08 PM, Lloyd lloydkl.t...@gmail.com wrote:

 Hi,

 I was successful in creating and compiling a simple project C++/Visual
 studio using cmake. I have also included one unit test project. All these
 projects builds successfully. The test project source and main project
 source resides in the root directory of the project. When I try to run
 RUN_TESTS it gives me an error

 Test project E:/CMakeDemo/BuildDir
 1  Start 1: Test
 1  Could not find executable test_rev
 1  Looked in the following places:
 1  Unable to find executable: test_rev
 1  test_rev
 1  test_rev.exe
 1  Debug/test_rev
 1  Debug/test_rev.exe
 1  Debug/test_rev
 1  Debug/test_rev.exe
 1  1/1 Test #1: Test .***Not Run   0.00
 sec

 I have added the tests in my main cmake file as shown below

 #Root cmake file
 cmake_minimum_required (VERSION 2.6)
 PROJECT (Tutorial)

 ADD_SUBDIRECTORY(src/lib/reverse)
 ADD_SUBDIRECTORY(src)
 #SUBDIRS(src/lib/reverse src)

 
 SET (DO_TEST false CACHE BOOL Enable Testing?)
 if(DO_TEST)
 MESSAGE (STATUS Testing is enabled)
 ENABLE_TESTING()
 ADD_SUBDIRECTORY(tests)


 ADD_TEST(Test test_rev)


 endif(DO_TEST)
 #


 What am i missing here?

 Thanks a lot,
   Lloyd



 --

 Powered by www.kitware.com

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

 Please keep messages on-topic and check the CMake FAQ at:
 http

Re: [CMake] TARGET_LINK_LIBRARIES got a link error

2013-04-13 Thread Lloyd
On Sat, Apr 13, 2013 at 1:04 AM, Alexander Neundorf a.neundorf-w...@gmx.net
 wrote:

 On Friday 12 April 2013, Lloyd wrote:
  Hi,
 
  I am new to Cmake and at present exploring its features for migrating our
  projects build system to use it.
 
  I have main source folder inside that another folder contains the source
  for our custom library.
 
  I understand that the problem is with my cmake file. Through that the
  generated project cannot locate the location of my library build
 location.
  What is the right way to solve this kind of problem?
 
  Thanks,
Lloyd
 
  As a sample I am including my Cmake code
 
  #Cmake file of library source code
  #Path- Myproject/src/lib/reverse
 
  cmake_minimum_required (VERSION 2.6)
 
  if(WIN32)
  SET (REV_SRC reverse.cpp reverse.h)
  else(WIN32)
  SET (REV_SRC reverse.cpp)
  endif(WIN32)
 
  ADD_DEFINITIONS(-DREVERSE_EXPORTS)

 Just some nitpicking: I'd recommend to start writing also the cmake files
 in
 good style, i.e. with proper indentation and consistent upper- or lower
 casing.
 Also, if there are no strong reasons against it, I'd recommend to require a
 higher version of cmake, at least 2.8.0, better 2.8.3 or newer. This will
 give
 you more features and bug fixes, braces in if()-conditions.
 Then this code would look like:

 cmake_minimum_required (VERSION 2.8)

 if(WIN32)
   set(REV_SRC reverse.cpp reverse.h)
 else()
   set (REV_SRC reverse.cpp)
 endif()

 add_definitions(-DREVERSE_EXPORTS)


 Alex


Thank you Alex, My system already had cmake 2.6, that is why I chose that.
And again thanks for your style guide.

Lloyd
--

Powered by www.kitware.com

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

Please keep messages on-topic and check 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] TARGET_LINK_LIBRARIES got a link error

2013-04-12 Thread Lloyd
Hi,

I am new to Cmake and at present exploring its features for migrating our
projects build system to use it.

I have main source folder inside that another folder contains the source
for our custom library.

I understand that the problem is with my cmake file. Through that the
generated project cannot locate the location of my library build location.
What is the right way to solve this kind of problem?

Thanks,
  Lloyd

As a sample I am including my Cmake code

#Cmake file of library source code
#Path- Myproject/src/lib/reverse

cmake_minimum_required (VERSION 2.6)

if(WIN32)
SET (REV_SRC reverse.cpp reverse.h)
else(WIN32)
SET (REV_SRC reverse.cpp)
endif(WIN32)

ADD_DEFINITIONS(-DREVERSE_EXPORTS)

ADD_LIBRARY(Reverse SHARED ${REV_SRC})



This is my CMake file inside the Src folder

#Cmake file of main source code
#Path- Myproject/src/
cmake_minimum_required (VERSION 2.6)

FIND_PACKAGE(Qt4 REQUIRED)
INCLUDE(${QT_USE_FILE})
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/lib/reverse)

ADD_SUBDIRECTORY(lib/reverse)

ADD_EXECUTABLE(Tutorial main.cpp)

TARGET_LINK_LIBRARIES(Tutorial ${QT_LIBRARIES})
#
#I understand that the problem is here, because it cant locate my library.
TARGET_LINK_LIBRARIES(Tutorial reverse)
#
--

Powered by www.kitware.com

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

Please keep messages on-topic and check 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] TARGET_LINK_LIBRARIES got a link error

2013-04-12 Thread Lloyd
On Fri, Apr 12, 2013 at 11:58 AM, Rolf Eike Beer e...@sf-mail.de wrote:

 Lloyd wrote:
  Hi,
 
  I am new to Cmake and at present exploring its features for migrating our
  projects build system to use it.
 
  I have main source folder inside that another folder contains the source
  for our custom library.
 
  I understand that the problem is with my cmake file. Through that the
  generated project cannot locate the location of my library build
 location.
  What is the right way to solve this kind of problem?
 
  Thanks,
Lloyd
 
  As a sample I am including my Cmake code
 
  #Cmake file of library source code
  #Path- Myproject/src/lib/reverse
 
  cmake_minimum_required (VERSION 2.6)
 
  if(WIN32)
  SET (REV_SRC reverse.cpp reverse.h)
  else(WIN32)
  SET (REV_SRC reverse.cpp)
  endif(WIN32)

 There is no reason for this. CMake knows that it does not have to compile
 header files, so it wont add compile rules for them e.g. in Makefiles. Just
 always add them to the project, this has some additional benefits for
 generated headers and the like.



You mean the if(WIN32) clause and the addition of reverse.h in SET
(REV_SRC reverse.cpp reverse.h)? Otherwise I think visual studio projects
wont add the header file to the solution's source file hierarchy.




  ADD_DEFINITIONS(-DREVERSE_EXPORTS)
 
  ADD_LIBRARY(Reverse SHARED ${REV_SRC})
 
 
 
  This is my CMake file inside the Src folder
 
  #Cmake file of main source code
  #Path- Myproject/src/
  cmake_minimum_required (VERSION 2.6)
 
  FIND_PACKAGE(Qt4 REQUIRED)
  INCLUDE(${QT_USE_FILE})
  INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/lib/reverse)
 
  ADD_SUBDIRECTORY(lib/reverse)
 
  ADD_EXECUTABLE(Tutorial main.cpp)
 
  TARGET_LINK_LIBRARIES(Tutorial ${QT_LIBRARIES})
  #
  #I understand that the problem is here, because it cant locate my
 library.
  TARGET_LINK_LIBRARIES(Tutorial reverse)
  #

 You just need to make sure that it goes into the lib folder first, before
 going into src. So the top level CMakeLists.txt should have

 add_subdirectory(lib)
 # or lib/reverse above, depending if you have something in lib/
 add_subdirectory(src)


I tried in the way you have mentioned, but the error persists (fatal error
LNK1104: cannot open file 'reverse.lib') . I have also removed the entry
for adding subdirectory (the lib/reverse)  in my src folder's cmake file (
ADD_SUBDIRECTORY(lib/reverse)). The following is my main cmake file

#Root cmake file
cmake_minimum_required (VERSION 2.6)
PROJECT (Tutorial)

ADD_SUBDIRECTORY(src/lib/reverse)
ADD_SUBDIRECTORY(src)

SET (DO_TEST false CACHE BOOL Enable Testing?)
if(DO_TEST)
ENABLE_TESTING()
ADD_SUBDIRECTORY(tests)
endif(DO_TEST)


Thank you very much,
  Lloyd



 Eike
 --

 --

 Powered by www.kitware.com

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

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

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

--

Powered by www.kitware.com

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

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

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

Re: [CMake] TARGET_LINK_LIBRARIES got a link error

2013-04-12 Thread Lloyd
Thanks Jc and Eike, it solved my problem


On Fri, Apr 12, 2013 at 12:31 PM, Jean-Christophe Fillion-Robin 
jchris.filli...@kitware.com wrote:

 Hi Lloyd,

 Seems you have a small typo, target name case should be consistent.

 Try to use:

TARGET_LINK_LIBRARIES(Tutorial Reverse)

 instead of

TARGET_LINK_LIBRARIES(Tutorial reverse)

 Hth
 Jc


 On Fri, Apr 12, 2013 at 2:48 AM, Lloyd lloydkl.t...@gmail.com wrote:




 On Fri, Apr 12, 2013 at 11:58 AM, Rolf Eike Beer e...@sf-mail.de wrote:

 Lloyd wrote:
  Hi,
 
  I am new to Cmake and at present exploring its features for migrating
 our
  projects build system to use it.
 
  I have main source folder inside that another folder contains the
 source
  for our custom library.
 
  I understand that the problem is with my cmake file. Through that the
  generated project cannot locate the location of my library build
 location.
  What is the right way to solve this kind of problem?
 
  Thanks,
Lloyd
 
  As a sample I am including my Cmake code
 
  #Cmake file of library source code
  #Path- Myproject/src/lib/reverse
 
  cmake_minimum_required (VERSION 2.6)
 
  if(WIN32)
  SET (REV_SRC reverse.cpp reverse.h)
  else(WIN32)
  SET (REV_SRC reverse.cpp)
  endif(WIN32)

 There is no reason for this. CMake knows that it does not have to compile
 header files, so it wont add compile rules for them e.g. in Makefiles.
 Just
 always add them to the project, this has some additional benefits for
 generated headers and the like.



 You mean the if(WIN32) clause and the addition of reverse.h in SET
 (REV_SRC reverse.cpp reverse.h)? Otherwise I think visual studio projects
 wont add the header file to the solution's source file hierarchy.




  ADD_DEFINITIONS(-DREVERSE_EXPORTS)
 
  ADD_LIBRARY(Reverse SHARED ${REV_SRC})
 
 
 
  This is my CMake file inside the Src folder
 
  #Cmake file of main source code
  #Path- Myproject/src/
  cmake_minimum_required (VERSION 2.6)
 
  FIND_PACKAGE(Qt4 REQUIRED)
  INCLUDE(${QT_USE_FILE})
  INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/lib/reverse)
 
  ADD_SUBDIRECTORY(lib/reverse)
 
  ADD_EXECUTABLE(Tutorial main.cpp)
 
  TARGET_LINK_LIBRARIES(Tutorial ${QT_LIBRARIES})
  #
  #I understand that the problem is here, because it cant locate my
 library.
  TARGET_LINK_LIBRARIES(Tutorial reverse)
  #

 You just need to make sure that it goes into the lib folder first, before
 going into src. So the top level CMakeLists.txt should have

 add_subdirectory(lib)
 # or lib/reverse above, depending if you have something in lib/
 add_subdirectory(src)


 I tried in the way you have mentioned, but the error persists (fatal
 error LNK1104: cannot open file 'reverse.lib') . I have also removed the
 entry for adding subdirectory (the lib/reverse)  in my src folder's cmake
 file ( ADD_SUBDIRECTORY(lib/reverse)). The following is my main cmake file

 #Root cmake file
 cmake_minimum_required (VERSION 2.6)
 PROJECT (Tutorial)

 ADD_SUBDIRECTORY(src/lib/reverse)
 ADD_SUBDIRECTORY(src)

 SET (DO_TEST false CACHE BOOL Enable Testing?)
 if(DO_TEST)
 ENABLE_TESTING()
 ADD_SUBDIRECTORY(tests)
 endif(DO_TEST)


 Thank you very much,
   Lloyd



 Eike
 --

 --

 Powered by www.kitware.com

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

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

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



 --

 Powered by www.kitware.com

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

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

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




 --
 +1 919 869 8849

--

Powered by www.kitware.com

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

Please keep messages on-topic and check 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] Error in running tests

2013-04-12 Thread Lloyd
Hi,

I was successful in creating and compiling a simple project C++/Visual
studio using cmake. I have also included one unit test project. All these
projects builds successfully. The test project source and main project
source resides in the root directory of the project. When I try to run
RUN_TESTS it gives me an error

Test project E:/CMakeDemo/BuildDir
1  Start 1: Test
1  Could not find executable test_rev
1  Looked in the following places:
1  Unable to find executable: test_rev
1  test_rev
1  test_rev.exe
1  Debug/test_rev
1  Debug/test_rev.exe
1  Debug/test_rev
1  Debug/test_rev.exe
1  1/1 Test #1: Test .***Not Run   0.00 sec

I have added the tests in my main cmake file as shown below

#Root cmake file
cmake_minimum_required (VERSION 2.6)
PROJECT (Tutorial)

ADD_SUBDIRECTORY(src/lib/reverse)
ADD_SUBDIRECTORY(src)
#SUBDIRS(src/lib/reverse src)


SET (DO_TEST false CACHE BOOL Enable Testing?)
if(DO_TEST)
MESSAGE (STATUS Testing is enabled)
ENABLE_TESTING()
ADD_SUBDIRECTORY(tests)


ADD_TEST(Test test_rev)


endif(DO_TEST)
#


What am i missing here?

Thanks a lot,
  Lloyd
--

Powered by www.kitware.com

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

Please keep messages on-topic and check 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] Error in running tests

2013-04-12 Thread Lloyd
Yes I built the test and it is in

E:\CMakeDemo\BuildDir\tests\Debug\test_rev.exe

I don't know the right way to locate this test executable for cmake

Thanks,
  Lloyd


On Fri, Apr 12, 2013 at 4:42 PM, Petr Kmoch petr.km...@gmail.com wrote:

 Hi Lloyd.

 Do you actually have a target (executable) named test_rev? And have you
 built it before running RUN_TESTS? RUN_TEST (or its Makefile equivalent
 'make test') doesn't automatically build the test executables before
 running them.

 Petr


 On Fri, Apr 12, 2013 at 1:08 PM, Lloyd lloydkl.t...@gmail.com wrote:

 Hi,

 I was successful in creating and compiling a simple project C++/Visual
 studio using cmake. I have also included one unit test project. All these
 projects builds successfully. The test project source and main project
 source resides in the root directory of the project. When I try to run
 RUN_TESTS it gives me an error

 Test project E:/CMakeDemo/BuildDir
 1  Start 1: Test
 1  Could not find executable test_rev
 1  Looked in the following places:
 1  Unable to find executable: test_rev
 1  test_rev
 1  test_rev.exe
 1  Debug/test_rev
 1  Debug/test_rev.exe
 1  Debug/test_rev
 1  Debug/test_rev.exe
 1  1/1 Test #1: Test .***Not Run   0.00 sec

 I have added the tests in my main cmake file as shown below

 #Root cmake file
 cmake_minimum_required (VERSION 2.6)
 PROJECT (Tutorial)

 ADD_SUBDIRECTORY(src/lib/reverse)
 ADD_SUBDIRECTORY(src)
 #SUBDIRS(src/lib/reverse src)

 
 SET (DO_TEST false CACHE BOOL Enable Testing?)
 if(DO_TEST)
 MESSAGE (STATUS Testing is enabled)
 ENABLE_TESTING()
 ADD_SUBDIRECTORY(tests)


 ADD_TEST(Test test_rev)


 endif(DO_TEST)
 #


 What am i missing here?

 Thanks a lot,
   Lloyd



 --

 Powered by www.kitware.com

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

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

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



--

Powered by www.kitware.com

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

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

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

Re: [CMake] Error in running tests

2013-04-12 Thread Lloyd
of course... This is the source of my test cmake file

#Cmake file of Tests
cmake_minimum_required (VERSION 2.6)

SET(TST_SRC test_rev.cpp test_runner.cpp)

FIND_PACKAGE(Boost REQUIRED COMPONENTS unit_test_framework)

INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}../../src/lib/reverse)
ADD_DEFINITIONS(-DBOOST_TEST_DYN_LINK)
ADD_EXECUTABLE(test_rev ${TST_SRC})
TARGET_LINK_LIBRARIES(test_rev ${Boost_LIBRARIES})
TARGET_LINK_LIBRARIES(test_rev Reverse)


On Fri, Apr 12, 2013 at 4:55 PM, Petr Kmoch petr.km...@gmail.com wrote:

 1. Can you post tests/CMakeLists.txt (or at least the parts relevant to
 creating test_rev)?

 2. Does it work if you use the enhanced signature of add_test? I mean
 'add_test(NAME Test COMMAND test_rev)'

 Petr


 On Fri, Apr 12, 2013 at 1:18 PM, Lloyd lloydkl.t...@gmail.com wrote:

 Yes I built the test and it is in

 E:\CMakeDemo\BuildDir\tests\Debug\test_rev.exe

 I don't know the right way to locate this test executable for cmake

 Thanks,
   Lloyd



 On Fri, Apr 12, 2013 at 4:42 PM, Petr Kmoch petr.km...@gmail.com wrote:

 Hi Lloyd.

 Do you actually have a target (executable) named test_rev? And have
 you built it before running RUN_TESTS? RUN_TEST (or its Makefile equivalent
 'make test') doesn't automatically build the test executables before
 running them.

 Petr


 On Fri, Apr 12, 2013 at 1:08 PM, Lloyd lloydkl.t...@gmail.com wrote:

 Hi,

 I was successful in creating and compiling a simple project C++/Visual
 studio using cmake. I have also included one unit test project. All these
 projects builds successfully. The test project source and main project
 source resides in the root directory of the project. When I try to run
 RUN_TESTS it gives me an error

 Test project E:/CMakeDemo/BuildDir
 1  Start 1: Test
 1  Could not find executable test_rev
 1  Looked in the following places:
 1  Unable to find executable: test_rev
 1  test_rev
 1  test_rev.exe
 1  Debug/test_rev
 1  Debug/test_rev.exe
 1  Debug/test_rev
 1  Debug/test_rev.exe
 1  1/1 Test #1: Test .***Not Run   0.00 sec

 I have added the tests in my main cmake file as shown below

 #Root cmake file
 cmake_minimum_required (VERSION 2.6)
 PROJECT (Tutorial)

 ADD_SUBDIRECTORY(src/lib/reverse)
 ADD_SUBDIRECTORY(src)
 #SUBDIRS(src/lib/reverse src)

 
 SET (DO_TEST false CACHE BOOL Enable Testing?)
 if(DO_TEST)
 MESSAGE (STATUS Testing is enabled)
 ENABLE_TESTING()
 ADD_SUBDIRECTORY(tests)


 ADD_TEST(Test test_rev)


 endif(DO_TEST)
 #


 What am i missing here?

 Thanks a lot,
   Lloyd



 --

 Powered by www.kitware.com

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

 Please keep messages on-topic and check 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] SET_SOURCE_FILES_PROPERTIES different properties for same file, same library

2010-05-12 Thread Bryn Lloyd

Hi,

I would like to cmakeify the UMFPACK/AMD libraries by Timothy Davis.

I need to compile the same source file, multiple times, with different 
flags/defines in order to link the resulting object files into one library.


something like this:

$(CC) -DDINT  -c umf_analyze.c -o umf_i_analyze.o
$(CC) -DDLONG -c umf_analyze.c -o umf_l_analyze.o

$(AR) libumfpack.a umf_i_analyze.o umf_l_analyze.o

$(RANLIB) libumfpack.a


I don't see how I can do this with CMake, unless I actually copy/rename 
the source files first, e.g.:

$(COPY) umf_analyze.c umf_i_analyze.c
$(COPY) umf_analyze.c umf_l_analyze.c

$(C) -DDINT  -c umf_i_analyze.c -o umf_i_analyze.o
$(C) -DDLONG -c umf_l_analyze.c -o umf_l_analyze.o


Thanks for any ideas,

Bryn
___
Powered by www.kitware.com

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

Please keep messages on-topic and check 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] CMAKE_CURRENT_SCRIPT_DIR?

2006-11-07 Thread Lloyd Hilaiel
Howdy all,

Did some searching but couldn't find a means to determine the current
directory in which the currently processed CMake file resides.

This is interesting for cases where the INCLUDE directive includes a 
cmake file that wishes to include others relative to itself.

Is there a means of determining this information?

-- 
[EMAIL PROTECTED] | best encourage ideas
 http://docs.yahoo.com/info/values/
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] What about...

2006-05-26 Thread Lloyd Hilaiel
Yo Thomas,

We use cmake to build a large project (10 or so different SDKs).

In our case, we too wanted a cmakebuild tool, so we wrote one.
It wraps the native build tools with a higher level of commands
build debug build release run tests package SDKs etc.

Some of the commands for this build tool are very specific to our
product and our problems others are perhaps generalizable.  I had 
never thought this was something that cmake would provide, as I as a 
developer usually use native build tools directly, while the consumers
of our software use the lightweight wrapper to build our stuff.

As an interim solution you could provide a similar tool for people
consuming KDE, and perhaps while writing the tool it would crystallize
a set of features that would go into a generic cmakebuild tool.

I'm still curious if there's enough there in the universal appeal bucket
to make a general tool out of it, and am not familiar with what
features/code cmake (ctest) already have built in to facilitate this.

I would be willing to contrast our cmakebuild tool with what you
come up with to try to identify the overlap and sketch out the
commands of such a general tool as an experiment...

best,
lloyd

/-- Around  6 PM on [05/26/06] ([EMAIL PROTECTED]) said -- 
On Friday 26 May 2006 17:55, you wrote:
 A 'configure' script generator that will just convert between the
  (good old) configure and the cmake foo.  Makes it actually possible
  to discover what features there are without consulting online
  documentation ;)

 I am not sure about what you want here.  
 Do you want something that will convert a configure script into cmake
 files? Do you want to convert cmake files into a configure script?
  What is the goal with this question?

I have helped a set of people on irc to get started with koffice compiling 
using cmake. They all had a lot of problems with the arcane variables 
like the CMAKE_INSTALL_PREFIX and most people find that D in front a bit 
weird a well.

So; instead of letting the user (not only a developer!!) type
 cmake ../../project -DCMAKE_INSTALL_PREFIX=$KDEDIR
there would be a command line tool (which I want to call configure, I 
don't care if its shell script or perl or whatever) and that tool would 
parse:
   ./configure --prefix=foo
and execute the cmake equivalent that I typed above.

Again; this is all focussed on making cmake more usable for the KDE 
community; but I guess a lot of cmake users will benefit from it as well.
You have to remember that there are a lot of end users downloading the 
sources and I can't in all honesty tell them its something better if they 
have to type the above cmake PREFIX thing instead of using the configure 
thing we had before.

Hope that explains it better :)
-- 
Thomas Zander



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

-- 
[EMAIL PROTECTED] | the of the organization appreciate within
 http://docs.yahoo.com/info/values/

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


Re: [CMake] a backwards compatible language simplification

2006-05-22 Thread Lloyd Hilaiel
/-- Around 10 PM on [05/18/06] ([EMAIL PROTECTED]) said -- 
That's nice already - changing 3 times the conditions in a if-else-endif 
construct was quite boring :-)

Do you plan to also remove the parenthesis in a future release ?

Gaetan

My patch also made any unparenthesized cmake macro/function call
FOO
equivalent to the same call without any arguments
FOO()

This required some changes to the parser/scanner.  I'd be happy to
regenerate it off cvs trunk, if there's interest...  I did run through
all of the tests, but did not think through all possible corner cases.
May be a devil somewhere down there in the details...
 
For now though I'm just grateful that a portion of the patch was
accepted :)

-- 
[EMAIL PROTECTED] | of best value the perspectives
 http://docs.yahoo.com/info/values/

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


Re: [CMake] cmake ruby bindings (or perl, or python, or ...)

2006-05-16 Thread Lloyd Hilaiel
To clarify, I'm not proposing the existing cmake language be
disbanded or thrown away.  I think cmake is a compelling and complete
piece of software as it is, and perhaps a majority of the (existing)
users would not be interested in writing build scripts in another
language.

All I'm suggesting is that if a library were built as part of the cmake
build that drew a nice line between language parsing and makefile
generation, then people like me who constantly want to hack stuff up 
and try stuff out would be able to do so at a level higher than cmake
and in a complimentary and cooperative way.  If the existing built-in cmake 
language parser used that interface it would maintain itself.

This is different than the Lua proposition, because I'm taking a more
conservative path... I don't know that picking a language and shoving
it into cmake is the right way to go. 

 A bunch of gratuitous compartmentalization is gonna slow them
 down... unless they were already planning on doing that kind of
 separation anyways.

Whether such a separation is gratuitous compartmentalization or is
correct architecture is not a question I know the answer to yet.
I'm sure the folks who wrote the stuff (and tirelessly maintain it)
do.  If the concensus is the former then I'll shut up and continue to
use (and advocate) cmake as it is.

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


Re: [CMake] cmake ruby bindings (or perl, or python, or ...)

2006-05-16 Thread Lloyd Hilaiel
   step 0.  use/advocate cmake for a year
   step 1.  read code, hack on code, get idea  
me  - step 2.  see if folks are interested/viable idea/makes sense
   step 3.  read code and make a concretish proposition
you - step 4.  get work done.

 Are you personally offering to do a good chunk of that work?

Yes I'm willing to contribute time, and I'm willing to have my patches
dropped on the floor if it doesn't turn out as pretty as I think it
will.

 But I am saying, that is likely a ton of work.  

CMake is well structured code already, it may be a short ton rather
than a metric ton.

-- 
[EMAIL PROTECTED] | irreverence all our above
 http://docs.yahoo.com/info/values/

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


[CMake] cmake ruby bindings (or perl, or python, or ...)

2006-05-15 Thread Lloyd Hilaiel
(probably off topic)

The more and more I work with cmake, the more it feels like there are two
(or more) distinct tools rolled into one...

the front end is a piece of software that interprets CMakeLists.txt files,
and drives a back end.  The back end is the stuff that actually generates
compiler specific project files (makefiles, whatever).

I'm wondering if anyone feels the same way?

Specifically I would be interested in using/writing a ruby front end for
writing my build files in.  This would give me powerful cross
platform constructs for interacting with the file system (FILE()),
list/set/hash manipulation, etc, and would give me a back end set of
calls to drive the build file generation.  The cost of course would be
(for me as a user) having to have both ruby and cmake installed.

The present front end seems like it will always be useful to keep
cmake a tight self contained piece of software...  My (very under
cooked) thoughts are that a code restructuring could take place that
would expose hooks into a generation engine that could then be exposed
to other languages (via SWIG, or manually, or whatever).  The existing
front end would use that code.  

Is anyone interested in this kinda thinking?  Is there any previous work
in this direction?

-- 
[EMAIL PROTECTED] | too seriously don't a
 http://docs.yahoo.com/info/values/

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


[CMake] FILE(RELATIVE_PATH) error output broken in 2.4.1

2006-05-10 Thread Lloyd Hilaiel
FILE(RELATIVE_PATH outvar sourcedir destfile)

expects both sourcdir and destfile to be absolute (full).  If either is
not absolute, an error message is emitted about sourcedir (where we should
be emitting an error a about sourcedir if it's relative, or destfile if
that's relative).

Patch attached for that trivial fix.  

I also wonder if the behavior should be changed so that 
FILE(RELATIVE_PATH foo /usr/local/share foo/bar) 
yields foo == /usr/local/share/foo/bar
rather than producing an error message.

-- 
[EMAIL PROTECTED] | yodel us by to come
 http://docs.yahoo.com/info/values/

diff -dur cmake-2.4.1.orig/Source/cmFileCommand.cxx 
cmake-2.4.1/Source/cmFileCommand.cxx
--- cmake-2.4.1.orig/Source/cmFileCommand.cxx   Sun Apr 30 09:06:34 2006
+++ cmake-2.4.1/Source/cmFileCommand.cxxWed May 10 12:43:53 2006
@@ -924,7 +924,7 @@
 }
   if(!cmSystemTools::FileIsFullPath(fileName.c_str()))
 {
-std::string errstring = RelativePath must be passed a full path to the 
directory:  + directoryName;
+std::string errstring = RelativePath must be passed a full path to the 
file:  + fileName;
 this-SetError(errstring.c_str());
 return false;
 }
Only in cmake-2.4.1/Source: cmFileCommand.cxx~
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

[CMake] a backwards compatible language simplification

2006-05-10 Thread Lloyd Hilaiel
Having spent all day hacking a massive project using cmake, I wonder...

could this

FOREACH (foo ${foolist})
  IF (${foo} STREQUAL bar) 
...
  ELSE (${foo} STREQUAL bar)   
...
  ENDIF (${foo} STREQUAL bar)   
ENDFOREACH (foo ${foolist})

change to this:

FOREACH (foo ${foolist})
  IF (${foo} STREQUAL bar) 
...
  ELSE 
...
  ENDIF
ENDFOREACH 

Temporarily supporting gunk after the ELSE/ENDIF/ENDFOREACH for migration?

-- 
[EMAIL PROTECTED] | quality foster don't
 http://docs.yahoo.com/info/values/
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake