aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBenoit Neil <suky0001@free.fr>2009-04-08 11:42:45 +0000
committerBenoit Neil <suky0001@free.fr>2009-04-08 11:42:45 +0000
commit25f626cc52561547034bc070b92b81606b9ba473 (patch)
treeb12a98e035876e8098877b207786a301a67db936 /tests
parentece891d6dbe4abd7912c7bc6fb0f1bc71e7b67e1 (diff)
Fixed compile defines in CMake scripts
Diffstat (limited to 'tests')
-rw-r--r--tests/libtest/CMakeLists.txt11
-rw-r--r--tests/server/CMakeLists.txt11
2 files changed, 12 insertions, 10 deletions
diff --git a/tests/libtest/CMakeLists.txt b/tests/libtest/CMakeLists.txt
index 247d63c3b..7b9f383b0 100644
--- a/tests/libtest/CMakeLists.txt
+++ b/tests/libtest/CMakeLists.txt
@@ -1,7 +1,7 @@
-MACRO(SETUP_TEST TEST_NAME) # ARGN are the files in the test
+FUNCTION(SETUP_TEST TEST_NAME) # ARGN are the files in the test
ADD_EXECUTABLE( ${TEST_NAME} ${ARGN} )
- STRING(TOUPPER TEST_NAME UPPER_TEST_NAME)
+ STRING(TOUPPER ${TEST_NAME} UPPER_TEST_NAME)
INCLUDE_DIRECTORIES(
${CURL_SOURCE_DIR}/lib # To be able to reach "setup_once.h"
@@ -12,8 +12,8 @@ MACRO(SETUP_TEST TEST_NAME) # ARGN are the files in the test
SETUP_CURL_DEPENDENCIES(${TEST_NAME})
TARGET_LINK_LIBRARIES( ${TEST_NAME} libcurl )
- ADD_DEFINITIONS( "-D${UPPER_TEST_NAME}" )
-
+ SET_TARGET_PROPERTIES(${TEST_NAME} PROPERTIES COMPILE_DEFINITIONS ${UPPER_TEST_NAME})
+
# Add the postfix to the executable since it is not added automatically as for modules and shared libraries
SET_TARGET_PROPERTIES(${TEST_NAME} PROPERTIES DEBUG_POSTFIX "${CMAKE_DEBUG_POSTFIX}")
@@ -21,10 +21,11 @@ MACRO(SETUP_TEST TEST_NAME) # ARGN are the files in the test
IF(NOT BUILD_RELEASE_DEBUG_DIRS)
# Ugly workaround to remove the "/debug" or "/release" in each output
SET_TARGET_PROPERTIES(${TEST_NAME} PROPERTIES PREFIX "../")
+ SET_TARGET_PROPERTIES(${TEST_NAME} PROPERTIES IMPORT_PREFIX "../")
ENDIF()
ENDIF()
-ENDMACRO()
+ENDFUNCTION()
TRANSFORM_MAKEFILE_INC("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
diff --git a/tests/server/CMakeLists.txt b/tests/server/CMakeLists.txt
index 2968a218b..c464a1f45 100644
--- a/tests/server/CMakeLists.txt
+++ b/tests/server/CMakeLists.txt
@@ -1,7 +1,7 @@
-MACRO(SETUP_EXECUTABLE TEST_NAME) # ARGN are the files in the test
+FUNCTION(SETUP_EXECUTABLE TEST_NAME) # ARGN are the files in the test
ADD_EXECUTABLE( ${TEST_NAME} ${ARGN} )
- STRING(TOUPPER TEST_NAME UPPER_TEST_NAME)
+ STRING(TOUPPER ${TEST_NAME} UPPER_TEST_NAME)
INCLUDE_DIRECTORIES(
${CURL_SOURCE_DIR}/lib # To be able to reach "setup_once.h"
@@ -12,8 +12,8 @@ MACRO(SETUP_EXECUTABLE TEST_NAME) # ARGN are the files in the test
SETUP_CURL_DEPENDENCIES(${TEST_NAME})
#TARGET_LINK_LIBRARIES( ${TEST_NAME} libcurl )
- ADD_DEFINITIONS( "-D${UPPER_TEST_NAME}" )
-
+ #SET_TARGET_PROPERTIES(${TEST_NAME} PROPERTIES COMPILE_DEFINITIONS ${UPPER_TEST_NAME})
+
# Add the postfix to the executable since it is not added automatically as for modules and shared libraries
SET_TARGET_PROPERTIES(${TEST_NAME} PROPERTIES DEBUG_POSTFIX "${CMAKE_DEBUG_POSTFIX}")
@@ -21,10 +21,11 @@ MACRO(SETUP_EXECUTABLE TEST_NAME) # ARGN are the files in the test
IF(NOT BUILD_RELEASE_DEBUG_DIRS)
# Ugly workaround to remove the "/debug" or "/release" in each output
SET_TARGET_PROPERTIES(${TEST_NAME} PROPERTIES PREFIX "../")
+ SET_TARGET_PROPERTIES(${TEST_NAME} PROPERTIES IMPORT_PREFIX "../")
ENDIF()
ENDIF()
-ENDMACRO()
+ENDFUNCTION()
TRANSFORM_MAKEFILE_INC("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")