Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Better cmake integration.

Updated both cmake scripts so that they include eachother and better integrate
with how cmake expects them to.

Still missing documentation and the finding quality is nowhere near where it
should be, but it's at least somewhat better than it used to be.

But, working on it. I guess.
  • Loading branch information...
commit 99f0019aa37915d5b67e034fa3688d590244ba51 1 parent 50f9f4a
Gašper Ažman authored November 05, 2012
3  build_tools/cmake/CxxTest.cmake
... ...
@@ -1,4 +1,5 @@
1  
-include(FindCxxTest.cmake)
  1
+
  2
+include("${CMAKE_CURRENT_LIST_DIR}/FindCxxTest.cmake")
2 3
 
3 4
 function(cxx_test target source)
4 5
     string(REGEX REPLACE "hpp$" "cpp" CPP_FILE_NAME ${source})
28  build_tools/cmake/FindCxxTest.cmake
... ...
@@ -1,10 +1,36 @@
  1
+IF (DEFINED FIND_CXXTEST_CMAKE_INCLUDED)
  2
+    RETURN()
  3
+ENDIF (DEFINED FIND_CXXTEST_CMAKE_INCLUDED)
  4
+SET(FIND_CXXTEST_CMAKE_INCLUDED true)
  5
+
1 6
 FIND_PROGRAM(CXXTESTGEN
2 7
     NAMES cxxtestgen
3  
-    PATHS ./cxxtest/bin/
  8
+    PATHS "${CXXTEST_PATH}/bin"
  9
+          "${PROJECT_SOURCE_DIR}/cxxtest/bin"
  10
+          "${PROJECT_SOURCE_DIR}/lib/cxxtest/bin"
  11
+          "${PROJECT_BINARY_DIR}/cxxtest/bin"
  12
+          "${PROJECT_BINARY_DIR}/lib/cxxtest/bin"
4 13
           /usr/bin
5 14
           /bin
6 15
           )
7 16
 
  17
+FIND_PATH(CXXTEST_INCLUDES
  18
+    NAMES "cxxtest/TestSuite.h"
  19
+    PATHS "${CXXTEST_PATH}"
  20
+          "${PROJECT_SOURCE_DIR}/cxxtest/"
  21
+          "${PROJECT_SOURCE_DIR}/lib/cxxtest/"
  22
+          )
  23
+
8 24
 IF(NOT CXXTESTGEN)
9 25
     MESSAGE(FATAL_ERROR "Unable to find 'cxxtestgen'")
  26
+    SET(CXXTEST_FOUND false)
  27
+ELSEIF(NOT CXXTEST_INCLUDES)
  28
+    SET(CXXTEST_FOUND false)
  29
+ELSE(NOT CXXTESTGEN)
  30
+    SET(CXXTEST_FOUND true)
  31
+    SET(CXXTEST_ROOT ${CXXTEST_INCLUDES})
10 32
 ENDIF(NOT CXXTESTGEN)
  33
+
  34
+SET(CXXTEST_CMAKE_MODULES_PATH "${CMAKE_CURRENT_LIST_DIR}")
  35
+INCLUDE("${CXXTEST_CMAKE_MODULES_PATH}/CxxTest.cmake")
  36
+

0 notes on commit 99f0019

Please sign in to comment.
Something went wrong with that request. Please try again.