1 1.1 christos # if we are built from with zlib, use this path's) 2 1.1 christos if(DEFINED ZLIB_BUILD_MINIZIP) 3 1.1 christos set(WORK_DIR ${zlib_BINARY_DIR}) 4 1.1 christos set(inst_setup zlib_install) 5 1.1 christos else(DEFINED ZLIB_BUILD_MINIZIP) 6 1.1 christos set(WORK_DIR ${minizip_BINARY_DIR}) 7 1.1 christos set(inst_setup minizip_install) 8 1.1 christos set(ZLIB_ARG "-DZLIB_DIR=${ZLIB_DIR}") 9 1.1 christos 10 1.1 christos add_test( 11 1.1 christos NAME minizip_install 12 1.1 christos COMMAND ${CMAKE_COMMAND} --install ${minizip_BINARY_DIR} --prefix 13 1.1 christos ${CMAKE_CURRENT_BINARY_DIR}/test_install --config $<CONFIG> 14 1.1 christos WORKING_DIRECTORY ${minizip_BINARY_DIR}) 15 1.1 christos 16 1.1 christos set_tests_properties(minizip_install 17 1.1 christos PROPERTIES 18 1.1 christos FIXTURES_SETUP minizip_install) 19 1.1 christos endif(DEFINED ZLIB_BUILD_MINIZIP) 20 1.1 christos 21 1.1 christos file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/findpackage_test) 22 1.1 christos file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/findpackage_no_componentstest) 23 1.1 christos file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/findpackage_wrong_components_test) 24 1.1 christos file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_test) 25 1.1 christos file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_exclude_test) 26 1.1 christos 27 1.1 christos configure_file( 28 1.1 christos ${CMAKE_CURRENT_SOURCE_DIR}/find_package_test.cmake.in 29 1.1 christos ${CMAKE_CURRENT_BINARY_DIR}/findpackage_test/CMakeLists.txt @ONLY) 30 1.1 christos 31 1.1 christos configure_file( 32 1.1 christos ${CMAKE_CURRENT_SOURCE_DIR}/find_package_no_components_test.cmake.in 33 1.1 christos ${CMAKE_CURRENT_BINARY_DIR}/findpackage_no_components_test/CMakeLists.txt 34 1.1 christos @ONLY) 35 1.1 christos 36 1.1 christos configure_file( 37 1.1 christos ${CMAKE_CURRENT_SOURCE_DIR}/find_package_wrong_components_test.cmake.in 38 1.1 christos ${CMAKE_CURRENT_BINARY_DIR}/findpackage_wrong_components_test/CMakeLists.txt 39 1.1 christos @ONLY) 40 1.1 christos 41 1.1 christos configure_file( 42 1.1 christos ${CMAKE_CURRENT_SOURCE_DIR}/add_subdirectory_test.cmake.in 43 1.1 christos ${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_test/CMakeLists.txt @ONLY) 44 1.1 christos 45 1.1 christos configure_file( 46 1.1 christos ${CMAKE_CURRENT_SOURCE_DIR}/add_subdirectory_exclude_test.cmake.in 47 1.1 christos ${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_exclude_test/CMakeLists.txt 48 1.1 christos @ONLY) 49 1.1 christos 50 1.1 christos # CMAKE_GENERATOR_PLATFORM doesn't work in the if 51 1.1 christos set(GENERATOR ${CMAKE_GENERATOR_PLATFORM}) 52 1.1 christos 53 1.1 christos if(GENERATOR) 54 1.1 christos set(PLATFORM "-A ${GENERATOR}") 55 1.1 christos endif(GENERATOR) 56 1.1 christos 57 1.1 christos # 58 1.1 christos # findpackage_test 59 1.1 christos # 60 1.1 christos add_test( 61 1.1 christos NAME minizip_find_package_configure 62 1.1 christos COMMAND 63 1.1 christos ${CMAKE_COMMAND} ${PLATFORM} 64 1.1 christos -B${CMAKE_CURRENT_BINARY_DIR}/findpackage_test_build 65 1.1 christos -DCMAKE_BUILD_TYPE=$<CONFIG> -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} 66 1.1 christos -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} 67 1.1 christos -DCMAKE_INSTALL_PREFIX=${WORK_DIR}/test/test_install ${ZLIB_ARG} 68 1.1 christos --fresh -G "${CMAKE_GENERATOR}" 69 1.1 christos -S${CMAKE_CURRENT_BINARY_DIR}/findpackage_test) 70 1.1 christos 71 1.1 christos add_test( 72 1.1 christos NAME minizip_find_package_build 73 1.1 christos COMMAND ${CMAKE_COMMAND} --build . --config $<CONFIG> 74 1.1 christos WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/findpackage_test_build) 75 1.1 christos 76 1.1 christos set_tests_properties( 77 1.1 christos minizip_find_package_configure PROPERTIES FIXTURES_REQUIRED ${inst_setup} 78 1.1 christos FIXTURES_SETUP mzfp_config) 79 1.1 christos 80 1.1 christos set_tests_properties(minizip_find_package_build PROPERTIES FIXTURES_REQUIRED 81 1.1 christos mzfp_config) 82 1.1 christos 83 1.1 christos # 84 1.1 christos # findpackage_no_components_test 85 1.1 christos # 86 1.1 christos add_test( 87 1.1 christos NAME minizip_find_package_no_components_configure 88 1.1 christos COMMAND 89 1.1 christos ${CMAKE_COMMAND} ${PLATFORM} 90 1.1 christos -B${CMAKE_CURRENT_BINARY_DIR}/findpackage_no_components_test_build 91 1.1 christos -DCMAKE_BUILD_TYPE=$<CONFIG> -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} 92 1.1 christos -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} 93 1.1 christos -DCMAKE_INSTALL_PREFIX=${WORK_DIR}/test/test_install ${ZLIB_ARG} 94 1.1 christos --fresh -G "${CMAKE_GENERATOR}" 95 1.1 christos -S${CMAKE_CURRENT_BINARY_DIR}/findpackage_no_components_test) 96 1.1 christos 97 1.1 christos set_tests_properties( 98 1.1 christos minizip_find_package_no_components_configure PROPERTIES FIXTURES_REQUIRED ${inst_setup}) 99 1.1 christos 100 1.1 christos if(NOT MINIZIP_BUILD_SHARED OR NOT MINIZIP_BUILD_STATIC) 101 1.1 christos set_tests_properties( 102 1.1 christos minizip_find_package_no_components_configure PROPERTIES WILL_FAIL TRUE) 103 1.1 christos endif(NOT MINIZIP_BUILD_SHARED OR NOT MINIZIP_BUILD_STATIC) 104 1.1 christos 105 1.1 christos # 106 1.1 christos # findpackage_no_components_test 107 1.1 christos # 108 1.1 christos add_test( 109 1.1 christos NAME minizip_find_package_wrong_components_configure 110 1.1 christos COMMAND 111 1.1 christos ${CMAKE_COMMAND} ${PLATFORM} 112 1.1 christos -B${CMAKE_CURRENT_BINARY_DIR}/findpackage_wrong_components_test_build 113 1.1 christos -DCMAKE_BUILD_TYPE=$<CONFIG> -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} 114 1.1 christos -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} 115 1.1 christos -DCMAKE_INSTALL_PREFIX=${WORK_DIR}/test/test_install ${ZLIB_ARG} 116 1.1 christos --fresh -G "${CMAKE_GENERATOR}" 117 1.1 christos -S${CMAKE_CURRENT_BINARY_DIR}/findpackage_wrong_components_test) 118 1.1 christos 119 1.1 christos set_tests_properties( 120 1.1 christos minizip_find_package_wrong_components_configure 121 1.1 christos PROPERTIES 122 1.1 christos FIXTURES_REQUIRED ${inst_setup} 123 1.1 christos WILL_FAIL TRUE) 124 1.1 christos 125 1.1 christos # 126 1.1 christos # add_subdirectory_test 127 1.1 christos # 128 1.1 christos add_test( 129 1.1 christos NAME minizip_add_subdirectory_configure 130 1.1 christos COMMAND 131 1.1 christos ${CMAKE_COMMAND} ${PLATFORM} 132 1.1 christos -B${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_test_build 133 1.1 christos -DCMAKE_BUILD_TYPE=$<CONFIG> -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} 134 1.1 christos -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} 135 1.1 christos -DCMAKE_INSTALL_PREFIX=${WORK_DIR}/test/test_install ${ZLIB_ARG} 136 1.1 christos --fresh -G "${CMAKE_GENERATOR}" 137 1.1 christos -S${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_test) 138 1.1 christos 139 1.1 christos add_test( 140 1.1 christos NAME minizip_add_subdirectory_build 141 1.1 christos COMMAND ${CMAKE_COMMAND} --build . --config $<CONFIG> 142 1.1 christos WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_test_build) 143 1.1 christos 144 1.1 christos set_tests_properties( 145 1.1 christos minizip_add_subdirectory_configure 146 1.1 christos PROPERTIES FIXTURES_REQUIRED ${inst_setup} FIXTURES_SETUP mzas_config) 147 1.1 christos 148 1.1 christos set_tests_properties(minizip_add_subdirectory_build PROPERTIES FIXTURES_REQUIRED 149 1.1 christos mzas_config) 150 1.1 christos 151 1.1 christos # 152 1.1 christos # add_subdirectory_exclude_test 153 1.1 christos # 154 1.1 christos add_test( 155 1.1 christos NAME minizip_add_subdirectory_exclude_configure 156 1.1 christos COMMAND 157 1.1 christos ${CMAKE_COMMAND} ${PLATFORM} 158 1.1 christos -B${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_exclude_test_build 159 1.1 christos -DCMAKE_BUILD_TYPE=$<CONFIG> -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} 160 1.1 christos -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} 161 1.1 christos -DCMAKE_INSTALL_PREFIX=${WORK_DIR}/test/test_install ${ZLIB_ARG} 162 1.1 christos --fresh -G "${CMAKE_GENERATOR}" 163 1.1 christos -S${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_exclude_test) 164 1.1 christos 165 1.1 christos add_test( 166 1.1 christos NAME minizip_add_subdirectory_exclude_build 167 1.1 christos COMMAND ${CMAKE_COMMAND} --build . --config $<CONFIG> 168 1.1 christos WORKING_DIRECTORY 169 1.1 christos ${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_exclude_test_build) 170 1.1 christos 171 1.1 christos set_tests_properties( 172 1.1 christos minizip_add_subdirectory_exclude_configure 173 1.1 christos PROPERTIES FIXTURES_REQUIRED ${inst_setup} FIXTURES_SETUP mzasx_config) 174 1.1 christos 175 1.1 christos set_tests_properties(minizip_add_subdirectory_exclude_build 176 1.1 christos PROPERTIES FIXTURES_REQUIRED mzasx_config) 177