[Cmake-commits] [cmake-commits] lowman committed FindCxxTest.cmake 1.2 1.3

cmake-commits at cmake.org cmake-commits at cmake.org
Mon Feb 9 23:05:40 EST 2009


Update of /cvsroot/CMake/CMake/Modules
In directory public:/mounts/ram/cvs-serv22801

Modified Files:
	FindCxxTest.cmake 
Log Message:
STYLE: Clarified example to illustrate need to call target_link_libraries() in response to Issue #8485.  Changed CMake commands to lowercase.  Added licensing info to copyright


Index: FindCxxTest.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/FindCxxTest.cmake,v
retrieving revision 1.2
retrieving revision 1.3
diff -C 2 -d -r1.2 -r1.3
*** FindCxxTest.cmake	8 Jan 2009 09:47:40 -0000	1.2
--- FindCxxTest.cmake	10 Feb 2009 04:05:38 -0000	1.3
***************
*** 21,25 ****
  #       The python-based test generator.
  #
! # MACROS for use by CMake users:
  #
  #    CXXTEST_ADD_TEST(<test_name> <gen_source_file> <input_files_to_testgen...>)
--- 21,25 ----
  #       The python-based test generator.
  #
! # MACROS for optional use by CMake users:
  #
  #    CXXTEST_ADD_TEST(<test_name> <gen_source_file> <input_files_to_testgen...>)
***************
*** 34,44 ****
  #       Example Usage:
  #
! #           FIND_PACKAGE(CxxTest)
! #           INCLUDE_DIRECTORIES(${CXXTEST_INCLUDE_DIR})
  #
! #           ENABLE_TESTING()
! #           CXXTEST_ADD_TEST(unittest_foo foo_test.cc ${CMAKE_CURRENT_SOURCE_DIR}/foo_test.h)
  #
! #              This will:
  #              1. Invoke the testgen executable to autogenerate foo_test.cc in the
  #                 binary tree from "foo_test.h" in the current source directory.
--- 34,48 ----
  #       Example Usage:
  #
! #           find_package(CxxTest)
! #           if(CXXTEST_FOUND)
! #               include_directories(${CXXTEST_INCLUDE_DIR})
! #               enable_testing()
  #
! #               CXXTEST_ADD_TEST(unittest_foo foo_test.cc
! #                                 ${CMAKE_CURRENT_SOURCE_DIR}/foo_test.h)
! #               target_link_libraries(unittest_foo foo) # as needed
! #           endif()
  #
! #              This will (if CxxTest is found):
  #              1. Invoke the testgen executable to autogenerate foo_test.cc in the
  #                 binary tree from "foo_test.h" in the current source directory.
***************
*** 61,85 ****
  #
  #
! # FindCxxTest.cmake
! # Copyright (c) 2008
! #     Philip Lowman <philip at yhbt.com>
! #
  # Version 1.0 (1/8/08)
  #     Fixed CXXTEST_INCLUDE_DIRS so it will work properly
  #     Eliminated superfluous CXXTEST_FOUND assignment
  #     Cleaned up and added more documentation
  
  #=============================================================
  # CXXTEST_ADD_TEST (public macro)
  #=============================================================
! MACRO(CXXTEST_ADD_TEST _cxxtest_testname _cxxtest_outfname)
!     SET(_cxxtest_real_outfname ${CMAKE_CURRENT_BINARY_DIR}/${_cxxtest_outfname})
!     IF(CXXTEST_USE_PYTHON)
!         SET(_cxxtest_executable ${CXXTEST_PYTHON_TESTGEN_EXECUTABLE})
!     ELSE()
!         SET(_cxxtest_executable ${CXXTEST_PERL_TESTGEN_EXECUTABLE})
!     ENDIF()
  
!     ADD_CUSTOM_COMMAND(
          OUTPUT  ${_cxxtest_real_outfname}
          DEPENDS ${ARGN}
--- 65,97 ----
  #
  #
! # Version 1.1 (2/9/08)
! #     Clarified example to illustrate need to call target_link_libraries()
! #     Changed commands to lowercase
! #     Added licensing info
  # Version 1.0 (1/8/08)
  #     Fixed CXXTEST_INCLUDE_DIRS so it will work properly
  #     Eliminated superfluous CXXTEST_FOUND assignment
  #     Cleaned up and added more documentation
+ #
+ # FindCxxTest.cmake
+ # Copyright (c) 2008-2009
+ #     Philip Lowman <philip at yhbt.com>
+ #
+ #  Redistribution AND use is allowed according to the terms of the New
+ #  BSD license.
+ #  For details see the accompanying COPYING-CMAKE-SCRIPTS file.
  
  #=============================================================
  # CXXTEST_ADD_TEST (public macro)
  #=============================================================
! macro(CXXTEST_ADD_TEST _cxxtest_testname _cxxtest_outfname)
!     set(_cxxtest_real_outfname ${CMAKE_CURRENT_BINARY_DIR}/${_cxxtest_outfname})
!     if(CXXTEST_USE_PYTHON)
!         set(_cxxtest_executable ${CXXTEST_PYTHON_TESTGEN_EXECUTABLE})
!     else()
!         set(_cxxtest_executable ${CXXTEST_PERL_TESTGEN_EXECUTABLE})
!     endif()
  
!     add_custom_command(
          OUTPUT  ${_cxxtest_real_outfname}
          DEPENDS ${ARGN}
***************
*** 88,103 ****
      )
  
!     SET_SOURCE_FILES_PROPERTIES(${_cxxtest_real_outfname} PROPERTIES GENERATED true)
!     ADD_EXECUTABLE(${_cxxtest_testname} ${_cxxtest_real_outfname})
  
!     IF(CMAKE_RUNTIME_OUTPUT_DIRECTORY)
!         ADD_TEST(${_cxxtest_testname} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_cxxtest_testname})
!     ELSEIF(EXECUTABLE_OUTPUT_PATH)
!         ADD_TEST(${_cxxtest_testname} ${EXECUTABLE_OUTPUT_PATH}/${_cxxtest_testname})
!     ELSE()
!         ADD_TEST(${_cxxtest_testname} ${CMAKE_CURRENT_BINARY_DIR}/${_cxxtest_testname})
!     ENDIF()
  
! ENDMACRO(CXXTEST_ADD_TEST)
  
  #=============================================================
--- 100,115 ----
      )
  
!     set_source_files_properties(${_cxxtest_real_outfname} PROPERTIES GENERATED true)
!     add_executable(${_cxxtest_testname} ${_cxxtest_real_outfname})
  
!     if(CMAKE_RUNTIME_OUTPUT_DIRECTORY)
!         add_test(${_cxxtest_testname} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_cxxtest_testname})
!     elseif(EXECUTABLE_OUTPUT_PATH)
!         add_test(${_cxxtest_testname} ${EXECUTABLE_OUTPUT_PATH}/${_cxxtest_testname})
!     else()
!         add_test(${_cxxtest_testname} ${CMAKE_CURRENT_BINARY_DIR}/${_cxxtest_testname})
!     endif()
  
! endmacro(CXXTEST_ADD_TEST)
  
  #=============================================================
***************
*** 105,113 ****
  #=============================================================
  
! FIND_PATH(CXXTEST_INCLUDE_DIR cxxtest/TestSuite.h)
! FIND_PROGRAM(CXXTEST_PERL_TESTGEN_EXECUTABLE cxxtestgen.pl)
! FIND_PROGRAM(CXXTEST_PYTHON_TESTGEN_EXECUTABLE cxxtestgen.py)
  
! INCLUDE(FindPackageHandleStandardArgs)
  FIND_PACKAGE_HANDLE_STANDARD_ARGS(CxxTest DEFAULT_MSG CXXTEST_INCLUDE_DIR)
! SET(CXXTEST_INCLUDE_DIRS ${CXXTEST_INCLUDE_DIR})
--- 117,126 ----
  #=============================================================
  
! find_path(CXXTEST_INCLUDE_DIR cxxtest/TestSuite.h)
! find_program(CXXTEST_PERL_TESTGEN_EXECUTABLE cxxtestgen.pl)
! find_program(CXXTEST_PYTHON_TESTGEN_EXECUTABLE cxxtestgen.py)
  
! include(FindPackageHandleStandardArgs)
  FIND_PACKAGE_HANDLE_STANDARD_ARGS(CxxTest DEFAULT_MSG CXXTEST_INCLUDE_DIR)
! 
! set(CXXTEST_INCLUDE_DIRS ${CXXTEST_INCLUDE_DIR})



More information about the Cmake-commits mailing list