1 1.1 christos # if we are built from with zlib, use this path's) 2 1.1 christos if(DEFINED ZLIB_BUILD_BLAST) 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_BLAST) 6 1.1 christos set(WORK_DIR ${blast_BINARY_DIR}) 7 1.1 christos set(inst_setup zlib_blast_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 zlib_blast_install 12 1.1 christos COMMAND ${CMAKE_COMMAND} --install ${blast_BINARY_DIR} --prefix 13 1.1 christos ${CMAKE_CURRENT_BINARY_DIR}/test_install --config $<CONFIG> 14 1.1 christos WORKING_DIRECTORY ${blast_BINARY_DIR}) 15 1.1 christos 16 1.1 christos set_tests_properties(zlib_blast_install 17 1.1 christos PROPERTIES 18 1.1 christos FIXTURES_SETUP zlib_blast_install) 19 1.1 christos endif(DEFINED ZLIB_BUILD_BLAST) 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}/add_subdirectory_test) 23 1.1 christos file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_exclude_test) 24 1.1 christos 25 1.1 christos configure_file( 26 1.1 christos ${CMAKE_CURRENT_SOURCE_DIR}/find_package_test.cmake.in 27 1.1 christos ${CMAKE_CURRENT_BINARY_DIR}/findpackage_test/CMakeLists.txt @ONLY) 28 1.1 christos 29 1.1 christos configure_file( 30 1.1 christos ${CMAKE_CURRENT_SOURCE_DIR}/add_subdirectory_test.cmake.in 31 1.1 christos ${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_test/CMakeLists.txt @ONLY) 32 1.1 christos 33 1.1 christos configure_file( 34 1.1 christos ${CMAKE_CURRENT_SOURCE_DIR}/add_subdirectory_exclude_test.cmake.in 35 1.1 christos ${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_exclude_test/CMakeLists.txt 36 1.1 christos @ONLY) 37 1.1 christos 38 1.1 christos configure_file( 39 1.1 christos ${CMAKE_CURRENT_SOURCE_DIR}/find_package_no_components_test.cmake.in 40 1.1 christos ${CMAKE_CURRENT_BINARY_DIR}/findpackage_no_components_test/CMakeLists.txt 41 1.1 christos @ONLY) 42 1.1 christos 43 1.1 christos configure_file( 44 1.1 christos ${CMAKE_CURRENT_SOURCE_DIR}/find_package_wrong_components_test.cmake.in 45 1.1 christos ${CMAKE_CURRENT_BINARY_DIR}/findpackage_wrong_components_test/CMakeLists.txt 46 1.1 christos @ONLY) 47 1.1 christos 48 1.1 christos # CMAKE_GENERATOR_PLATFORM doesn't work in the if 49 1.1 christos set(GENERATOR ${CMAKE_GENERATOR_PLATFORM}) 50 1.1 christos 51 1.1 christos if(GENERATOR) 52 1.1 christos set(PLATFORM "-A ${GENERATOR}") 53 1.1 christos endif(GENERATOR) 54 1.1 christos 55 1.1 christos # 56 1.1 christos # findpackage_test 57 1.1 christos # 58 1.1 christos add_test( 59 1.1 christos NAME zlib_blast_find_package_configure 60 1.1 christos COMMAND 61 1.1 christos ${CMAKE_COMMAND} ${PLATFORM} 62 1.1 christos -B${CMAKE_CURRENT_BINARY_DIR}/findpackage_test_build 63 1.1 christos -DCMAKE_BUILD_TYPE=$<CONFIG> 64 1.1 christos -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} 65 1.1 christos -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} 66 1.1 christos -DCMAKE_INSTALL_PREFIX=${WORK_DIR}/test/test_install ${ZLIB_ARG} 67 1.1 christos --fresh 68 1.1 christos -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 zlib_blast_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 zlib_blast_find_package_configure 78 1.1 christos PROPERTIES 79 1.1 christos FIXTURES_REQUIRED ${inst_setup} 80 1.1 christos FIXTURES_SETUP blast_fp_config) 81 1.1 christos 82 1.1 christos set_tests_properties(zlib_blast_find_package_build 83 1.1 christos PROPERTIES 84 1.1 christos FIXTURES_REQUIRED blast_fp_config) 85 1.1 christos 86 1.1 christos # 87 1.1 christos # add_subdirectory_test 88 1.1 christos # 89 1.1 christos add_test( 90 1.1 christos NAME zlib_blast_add_subdirectory_configure 91 1.1 christos COMMAND 92 1.1 christos ${CMAKE_COMMAND} ${PLATFORM} 93 1.1 christos -B${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_test_build 94 1.1 christos -DCMAKE_BUILD_TYPE=$<CONFIG> 95 1.1 christos -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} 96 1.1 christos -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} 97 1.1 christos -DCMAKE_INSTALL_PREFIX=${WORK_DIR}/test/test_install ${ZLIB_ARG} 98 1.1 christos --fresh 99 1.1 christos -G "${CMAKE_GENERATOR}" 100 1.1 christos -S${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_test) 101 1.1 christos 102 1.1 christos add_test( 103 1.1 christos NAME zlib_blast_add_subdirectory_build 104 1.1 christos COMMAND ${CMAKE_COMMAND} --build . --config $<CONFIG> 105 1.1 christos WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_test_build) 106 1.1 christos 107 1.1 christos set_tests_properties( 108 1.1 christos zlib_blast_add_subdirectory_configure 109 1.1 christos PROPERTIES 110 1.1 christos FIXTURES_REQUIRED ${inst_setup} 111 1.1 christos FIXTURES_SETUP blast_as_config) 112 1.1 christos 113 1.1 christos set_tests_properties(zlib_blast_add_subdirectory_build 114 1.1 christos PROPERTIES 115 1.1 christos FIXTURES_REQUIRED blast_as_config) 116 1.1 christos 117 1.1 christos # 118 1.1 christos # add_subdirectory_exclude_test 119 1.1 christos # 120 1.1 christos add_test( 121 1.1 christos NAME zlib_blast_add_subdirectory_exclude_configure 122 1.1 christos COMMAND 123 1.1 christos ${CMAKE_COMMAND} ${PLATFORM} 124 1.1 christos -B${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_exclude_test_build 125 1.1 christos -DCMAKE_BUILD_TYPE=$<CONFIG> 126 1.1 christos -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} 127 1.1 christos -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} 128 1.1 christos -DCMAKE_INSTALL_PREFIX=${WORK_DIR}/test/test_install ${ZLIB_ARG} 129 1.1 christos --fresh 130 1.1 christos -G "${CMAKE_GENERATOR}" 131 1.1 christos -S${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_exclude_test) 132 1.1 christos 133 1.1 christos add_test( 134 1.1 christos NAME zlib_blast_add_subdirectory_exclude_build 135 1.1 christos COMMAND ${CMAKE_COMMAND} --build . --config $<CONFIG> 136 1.1 christos WORKING_DIRECTORY 137 1.1 christos ${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_exclude_test_build) 138 1.1 christos 139 1.1 christos set_tests_properties(zlib_blast_add_subdirectory_exclude_configure 140 1.1 christos PROPERTIES 141 1.1 christos FIXTURES_REQUIRED ${inst_setup} 142 1.1 christos FIXTURES_SETUP blast_asx_config) 143 1.1 christos 144 1.1 christos set_tests_properties(zlib_blast_add_subdirectory_exclude_build 145 1.1 christos PROPERTIES 146 1.1 christos FIXTURES_REQUIRED blast_asx_config) 147 1.1 christos 148 1.1 christos # 149 1.1 christos # findpackage_no_components_test 150 1.1 christos # 151 1.1 christos add_test( 152 1.1 christos NAME zlib_blast_find_package_no_components_configure 153 1.1 christos COMMAND 154 1.1 christos ${CMAKE_COMMAND} ${PLATFORM} 155 1.1 christos -B${CMAKE_CURRENT_BINARY_DIR}/findpackage_no_components_test_build 156 1.1 christos -DCMAKE_BUILD_TYPE=$<CONFIG> -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} 157 1.1 christos -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} 158 1.1 christos -DCMAKE_INSTALL_PREFIX=${WORK_DIR}/test/test_install ${ZLIB_ARG} 159 1.1 christos --fresh 160 1.1 christos -G "${CMAKE_GENERATOR}" 161 1.1 christos -S${CMAKE_CURRENT_BINARY_DIR}/findpackage_no_components_test) 162 1.1 christos 163 1.1 christos set_tests_properties( 164 1.1 christos zlib_blast_find_package_no_components_configure 165 1.1 christos PROPERTIES 166 1.1 christos FIXTURES_REQUIRED ${inst_setup}) 167 1.1 christos 168 1.1 christos if(NOT ZLIB_BLAST_BUILD_SHARED OR NOT ZLIB_BLAST_BUILD_STATIC) 169 1.1 christos set_tests_properties(zlib_blast_find_package_no_components_configure 170 1.1 christos PROPERTIES 171 1.1 christos WILL_FAIL TRUE) 172 1.1 christos endif(NOT ZLIB_BLAST_BUILD_SHARED OR NOT ZLIB_BLAST_BUILD_STATIC) 173 1.1 christos 174 1.1 christos # 175 1.1 christos # findpackage_wrong_components_test 176 1.1 christos # 177 1.1 christos add_test( 178 1.1 christos NAME zlib_blast_find_package_wrong_components_configure 179 1.1 christos COMMAND 180 1.1 christos ${CMAKE_COMMAND} ${PLATFORM} 181 1.1 christos -B${CMAKE_CURRENT_BINARY_DIR}/findpackage_wrong_components_test_build 182 1.1 christos -DCMAKE_BUILD_TYPE=$<CONFIG> -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} 183 1.1 christos -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} 184 1.1 christos -DCMAKE_INSTALL_PREFIX=${WORK_DIR}/test/test_install ${ZLIB_ARG} 185 1.1 christos --fresh 186 1.1 christos -G "${CMAKE_GENERATOR}" 187 1.1 christos -S${CMAKE_CURRENT_BINARY_DIR}/findpackage_wrong_components_test) 188 1.1 christos 189 1.1 christos set_tests_properties(zlib_blast_find_package_wrong_components_configure 190 1.1 christos PROPERTIES 191 1.1 christos FIXTURES_REQUIRED ${inst_setup} 192 1.1 christos WILL_FAIL TRUE) 193 1.1 christos 194