aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/cmake.d/03-macros.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/cmake.d/03-macros.cmake')
-rw-r--r--cmake/cmake.d/03-macros.cmake32
1 files changed, 12 insertions, 20 deletions
diff --git a/cmake/cmake.d/03-macros.cmake b/cmake/cmake.d/03-macros.cmake
index efe3128..6dd9d0a 100644
--- a/cmake/cmake.d/03-macros.cmake
+++ b/cmake/cmake.d/03-macros.cmake
@@ -124,15 +124,6 @@ macro(PROJECT_TARGET_ADD TARGET_NAME)
set(TARGET_NAME ${TARGET_NAME})
endmacro(PROJECT_TARGET_ADD)
-macro(PROJECT_HAS_TESTS)
- foreach(T ${PROJECT_TARGETS})
- get_target_property(TL ${T} "LABELS")
- if(TL AND "${TL}" MATCHES "^TEST-")
- set(HAS_TESTS TRUE)
- endif()
- endforeach()
-endmacro()
-
macro(PROJECT_PKGDEP_ADD PKG_NAME)
set_property(GLOBAL APPEND PROPERTY PROJECT_PKG_DEPS ${PKG_NAME})
endmacro(PROJECT_PKGDEP_ADD)
@@ -308,13 +299,15 @@ macro(project_targets_populate)
set(PACKAGE_TEST_HTTPDIR ${PROJECT_PKG_TEST_DIR}/${HTTPDIR})
set(PACKAGE_TEST_DATADIR ${PROJECT_PKG_TEST_DIR}/${DATADIR})
- if(NOT ${CMAKE_BUILD_TYPE} STREQUAL "RELEASE")
- add_custom_target(populate
+ if(${CMAKE_BUILD_TYPE} STREQUAL "TEST")
+ add_custom_command(OUTPUT ${PACKAGE_BINDIR} ${PACKAGE_ETCDIR} ${PACKAGE_LIBDIR} ${PACKAGE_HTTPDIR} ${PACKAGE_DATADIR} ${PACKAGE_TEST_BINDIR} ${PACKAGE_TEST_ETCDIR} ${PACKAGE_TEST_LIBDIR} ${PACKAGE_TEST_HTTPDIR} ${PACKAGE_TEST_DATADIR}
COMMAND mkdir -p ${PACKAGE_BINDIR} ${PACKAGE_ETCDIR} ${PACKAGE_LIBDIR} ${PACKAGE_HTTPDIR} ${PACKAGE_DATADIR}
COMMAND mkdir -p ${PACKAGE_TEST_BINDIR} ${PACKAGE_TEST_ETCDIR} ${PACKAGE_TEST_LIBDIR} ${PACKAGE_TEST_HTTPDIR} ${PACKAGE_TEST_DATADIR})
+ add_custom_target(populate DEPENDS ${PACKAGE_BINDIR} ${PACKAGE_ETCDIR} ${PACKAGE_LIBDIR} ${PACKAGE_HTTPDIR} ${PACKAGE_DATADIR} ${PACKAGE_TEST_BINDIR} ${PACKAGE_TEST_ETCDIR} ${PACKAGE_TEST_LIBDIR} ${PACKAGE_TEST_HTTPDIR} ${PACKAGE_TEST_DATADIR})
else()
- add_custom_target(populate
+ add_custom_command(OUTPUT ${PACKAGE_BINDIR} ${PACKAGE_ETCDIR} ${PACKAGE_LIBDIR} ${PACKAGE_HTTPDIR} ${PACKAGE_DATADIR}
COMMAND mkdir -p ${PACKAGE_BINDIR} ${PACKAGE_ETCDIR} ${PACKAGE_LIBDIR} ${PACKAGE_HTTPDIR} ${PACKAGE_DATADIR})
+ add_custom_target(populate DEPENDS ${PACKAGE_BINDIR} ${PACKAGE_ETCDIR} ${PACKAGE_LIBDIR} ${PACKAGE_HTTPDIR} ${PACKAGE_DATADIR})
endif()
# Dirty trick to define a default INSTALL command for app-templates handled
@@ -363,7 +356,7 @@ macro(project_targets_populate)
set(S ".ctlso")
endif()
generate_one_populate_target(${P}${OUT}${S} "${PACKAGE_LIBDIR}/plugins")
- elseif(NOT ${CMAKE_BUILD_TYPE} STREQUAL "RELEASE" AND ${T} STREQUAL "TEST-PLUGIN")
+ elseif(${CMAKE_BUILD_TYPE} STREQUAL "TEST" AND ${T} STREQUAL "TEST-PLUGIN")
if(NOT S)
set(S ".ctlso")
endif()
@@ -396,7 +389,7 @@ macro(project_targets_populate)
else()
generate_one_populate_target(${P}${OUT}${S} ${PACKAGE_BINDIR})
endif()
- elseif(NOT ${CMAKE_BUILD_TYPE} STREQUAL "RELEASE" AND ${T} STREQUAL "TEST-EXECUTABLE")
+ elseif(${CMAKE_BUILD_TYPE} STREQUAL "TEST" AND ${T} STREQUAL "TEST-EXECUTABLE")
if(NOT S)
set(S "")
endif()
@@ -408,15 +401,15 @@ macro(project_targets_populate)
endif()
elseif(${T} STREQUAL "HTDOCS")
generate_one_populate_target(${P}${OUT} ${PACKAGE_HTTPDIR})
- elseif(NOT ${CMAKE_BUILD_TYPE} STREQUAL "RELEASE" AND ${T} STREQUAL "TEST-HTDOCS")
+ elseif(${CMAKE_BUILD_TYPE} STREQUAL "TEST" AND ${T} STREQUAL "TEST-HTDOCS")
generate_one_populate_target(${P}${OUT} ${PACKAGE_HTTPDIR})
elseif(${T} STREQUAL "DATA" )
generate_one_populate_target(${TARGET} ${PACKAGE_DATADIR})
- elseif(NOT ${CMAKE_BUILD_TYPE} STREQUAL "RELEASE" AND ${T} STREQUAL "TEST-DATA")
+ elseif(${CMAKE_BUILD_TYPE} STREQUAL "TEST" AND ${T} STREQUAL "TEST-DATA")
generate_one_populate_target(${TARGET} ${PACKAGE_TEST_DATADIR})
elseif(${T} STREQUAL "BINDING-CONFIG" )
generate_one_populate_target(${TARGET} ${PACKAGE_ETCDIR})
- elseif(NOT ${CMAKE_BUILD_TYPE} STREQUAL "RELEASE" AND ${T} STREQUAL "TEST-CONFIG")
+ elseif(${CMAKE_BUILD_TYPE} STREQUAL "TEST" AND ${T} STREQUAL "TEST-CONFIG")
generate_one_populate_target(${TARGET} ${PACKAGE_TEST_ETCDIR})
endif()
elseif(${CMAKE_BUILD_TYPE} MATCHES "[Dd][Ee][Bb][Uu][Gg]")
@@ -515,7 +508,7 @@ macro(wgt_package_build)
COMMAND cp ${CMAKE_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}//test-widget/launcher.sh.in ${PROJECT_PKG_TEST_DIR}/bin/launcher
)
- if(NOT ${CMAKE_BUILD_TYPE} STREQUAL "RELEASE")
+ if(${CMAKE_BUILD_TYPE} STREQUAL "TEST")
string(TOLOWER "${PROJECT_NAME}-${CMAKE_BUILD_TYPE}" WGT_NAME)
add_custom_target(packaging_wgt DEPENDS ${PROJECT_PKG_BUILD_DIR}/config.xml ${PROJECT_PKG_TEST_DIR}/test-config.xml ${PROJECT_PKG_TEST_DIR}/bin/launcher)
else()
@@ -553,8 +546,7 @@ macro(wgt_package_build)
COMMAND ${packCMDTest}
)
- PROJECT_HAS_TESTS()
- if(NOT ${CMAKE_BUILD_TYPE} STREQUAL "RELEASE" AND HAS_TESTS)
+ if(${CMAKE_BUILD_TYPE} STREQUAL "TEST")
add_custom_target(widget DEPENDS ${WGT_NAME}.wgt ${WGT_NAME}-test.wgt)
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "${CMAKE_CURRENT_BINARY_DIR}/${WGT_NAME}-test.wgt")
else()