[CMake] Cmake parsing issue on Win32 platform

Xavier Delannoy xavier.delannoy at netasq.com
Wed Apr 26 09:12:13 EDT 2006


Hi all, 

there's the same bug in INCLUDE_EXTERNAL_MSPROJECT (with cmake 2.3 KDE release)

regards,

On Tue, 25 Apr 2006 08:18:55 -0400
"William A. Hoffman" <billlist at nycap.rr.com> wrote:

> At 08:05 AM 4/25/2006, Xavier Delannoy wrote:
> >On Tue, 25 Apr 2006 07:28:22 -0400
> >Andy Cedilnik <andy.cedilnik at kitware.com> wrote:
> >
> >> Hi Xavier,
> >> 
> >> For some reason all paths in DartTestfile.txt are windows style. What do 
> >> your ADD_TEST commands look like?
> >> 
> >
> >here is my CMakeLists.txt where I use the ADD_TEST command : 
> >
> >
> >SET(EXECUTABLE_OUTPUT_PATH "$ENV{BUILDTESTDIR}")
> 
> You need to make sure that you convert this path to unix style.
> In CMake cvs or 2.4 (soon to be released) , you can do this:
> 
> FILE(TO_CMAKE_PATH "$ENV{BUILDTESTDIR}" EXECUTABLE_OUTPUT_PATH)
> 
> In older versions of cmake, you will have to use regex replace
> to change all of the \ to /.  
> STRING(REGEX REPLACE "\\\\" "/"  "$ENV{BUILDTESTDIR}" EXECUTABLE_OUTPUT_PATH)
> 
> However, all said, this is a bug, all paths coming into cmake commands
> should be converted.  I will fix the add_test command so that it does the conversion
> automatically in cvs CMake.   
> 
> One last note, I am not sure why you would use an environment variable here
> anyway.   It will only be evaluated at CMAke time, and if a user does
> not set it prior to running cmake, your output path will be empty.  Seems
> a cmake variable would be a better choice.
> 
> 
> ># force to enable test
> >ENABLE_TESTING()
> >#INCLUDE(Dart)
> >
> ># C tests
> >FOREACH(test
> >    test_section
> >    test_network
> >    test_str
> >    test_system
> >    )
> >  ADD_EXECUTABLE(${test} ${test}.c)
> >  TARGET_LINK_LIBRARIES(${test} ntest nbase_static)
> >ENDFOREACH(test)
> >
> ># -- Section Test -- #
> >ADD_TEST(libnbase.section_parseline ${EXECUTABLE_OUTPUT_PATH}/test_section 1)
> >ADD_TEST(libnbase.section_new ${EXECUTABLE_OUTPUT_PATH}/test_section 2)
> >ADD_TEST(libnbase.sec_remove_marked_elements ${EXECUTABLE_OUTPUT_PATH}/test_section 3)
> >ADD_TEST(libnbase.sec_load_from_context ${EXECUTABLE_OUTPUT_PATH}/test_section 4)    
> >ADD_TEST(libnbase.sec_get_names_from_context ${EXECUTABLE_OUTPUT_PATH}/test_section 5)
> >ADD_TEST(libnbase.sec_add_at_pos ${EXECUTABLE_OUTPUT_PATH}/test_section 6)
> >ADD_TEST(libnbase.section_deltoken ${EXECUTABLE_OUTPUT_PATH}/test_section 7)
> >ADD_TEST(libnbase.section_getstr ${EXECUTABLE_OUTPUT_PATH}/test_section 8)
> >ADD_TEST(libnbase.section_addstr ${EXECUTABLE_OUTPUT_PATH}/test_section 9)
> >ADD_TEST(libnbase.section_clear ${EXECUTABLE_OUTPUT_PATH}/test_section 10)
> >ADD_TEST(libnbase.section_write ${EXECUTABLE_OUTPUT_PATH}/test_section 11)
> >ADD_TEST(libnbase.writestrtosection ${EXECUTABLE_OUTPUT_PATH}/test_section 12)
> >ADD_TEST(libnbase.sec_loadall_from_context ${EXECUTABLE_OUTPUT_PATH}/test_section 13)
> >
> >
> >BUILDTESTDIR is defined in .bat file. this file looks like : 
> >
> >@set BUILDROOTDIR=%cd%
> >
> >@set BUILDDESTLIB=%BUILDROOTDIR%\tmp
> >@set BUILDTESTDIR=%BUILDROOTDIR%\tmp\test
> >@set BUILDDESTSRC=%BUILDROOTDIR%\tmp
> >
> >
> >best regards, 
> >
> >Xavier 
> >_______________________________________________
> >CMake mailing list
> >CMake at cmake.org
> >http://www.cmake.org/mailman/listinfo/cmake
> 
> 


-- 
Xavier Delannoy

R&D engineer
xavier.delannoy at netasq.com
http://www.netasq.com
Tél : +33 320 619 742
Fax : +33 320 619 639

-----------------------------------------------------------------------
This communication may contain information that is proprietary, 
privileged or confidential or otherwise legally exempt from disclosure.
The information contained in this e-mail is intended solely for the
addressee. Access to this e-mail by anyone else or any unauthorized
review, use, disclosure or distribution is unauthorized and prohibited.
If you are not the named addressee indicated in this message (or
responsible for delivery of the message to such person), you are not
authorized to read, print, retain, copy or disseminate this message
or any part of it. If you have received this message in error, please
notify the sender immediately by fax or e-mail and delete and destroy
all copies of the message. If you are the intended recipient but do not
wish to receive communications through this medium, please advise the
sender immediately. The views expressed in this e-mail are not 
necessarily the views of NetASQ. The company, its directors, officers
or employees make no representation or accept any liability for its
accuracy or completeness unless expressly stated to the contrary.
------------------------------------------------------------------------


More information about the CMake mailing list