1 1.1 christos # if we are built from with zlib, use this path's) 2 1.1 christos if(DEFINED ZLIB_BUILD_IOSTREAM3) 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_IOSTREAM3) 6 1.1 christos set(WORK_DIR ${iostreamV3_BINARY_DIR}) 7 1.1 christos set(inst_setup zlib_iostream3_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_iostream3_install 12 1.1 christos COMMAND ${CMAKE_COMMAND} --install ${iostreamV3_BINARY_DIR} --prefix 13 1.1 christos ${CMAKE_CURRENT_BINARY_DIR}/test_install --config $<CONFIG> 14 1.1 christos WORKING_DIRECTORY ${iostreamV3_BINARY_DIR}) 15 1.1 christos 16 1.1 christos set_tests_properties(zlib_iostream3_install 17 1.1 christos PROPERTIES 18 1.1 christos FIXTURES_SETUP zlib_iostream3_install) 19 1.1 christos endif(DEFINED ZLIB_BUILD_IOSTREAM3) 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_iostream3_find_package_configure 60 1.1 christos COMMAND 61 1.1 christos ${CMAKE_COMMAND} 62 1.1 christos ${PLATFORM} 63 1.1 christos -B${CMAKE_CURRENT_BINARY_DIR}/findpackage_test_build 64 1.1 christos -DCMAKE_BUILD_TYPE=$<CONFIG> 65 1.1 christos -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 69 1.1 christos -G "${CMAKE_GENERATOR}" 70 1.1 christos -S${CMAKE_CURRENT_BINARY_DIR}/findpackage_test) 71 1.1 christos 72 1.1 christos add_test( 73 1.1 christos NAME zlib_iostream3_find_package_build 74 1.1 christos COMMAND ${CMAKE_COMMAND} --build . --config $<CONFIG> 75 1.1 christos WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/findpackage_test_build) 76 1.1 christos 77 1.1 christos set_tests_properties(zlib_iostream3_find_package_configure 78 1.1 christos PROPERTIES 79 1.1 christos FIXTURES_REQUIRED ${inst_setup} 80 1.1 christos FIXTURES_SETUP iostream3_fp_config) 81 1.1 christos 82 1.1 christos set_tests_properties(zlib_iostream3_find_package_build 83 1.1 christos PROPERTIES 84 1.1 christos FIXTURES_REQUIRED iostream3_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_iostream3_add_subdirectory_configure 91 1.1 christos COMMAND 92 1.1 christos ${CMAKE_COMMAND} 93 1.1 christos ${PLATFORM} 94 1.1 christos -B${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_test_build 95 1.1 christos -DCMAKE_BUILD_TYPE=$<CONFIG> 96 1.1 christos -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} 97 1.1 christos -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} 98 1.1 christos -DCMAKE_INSTALL_PREFIX=${WORK_DIR}/test/test_install 99 1.1 christos ${ZLIB_ARG} 100 1.1 christos --fresh 101 1.1 christos -G "${CMAKE_GENERATOR}" 102 1.1 christos -S${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_test) 103 1.1 christos 104 1.1 christos add_test( 105 1.1 christos NAME zlib_iostream3_add_subdirectory_build 106 1.1 christos COMMAND ${CMAKE_COMMAND} --build . --config $<CONFIG> 107 1.1 christos WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_test_build) 108 1.1 christos 109 1.1 christos set_tests_properties(zlib_iostream3_add_subdirectory_configure 110 1.1 christos PROPERTIES 111 1.1 christos FIXTURES_REQUIRED ${inst_setup} 112 1.1 christos FIXTURES_SETUP iostream3as_config) 113 1.1 christos 114 1.1 christos set_tests_properties(zlib_iostream3_add_subdirectory_build 115 1.1 christos PROPERTIES 116 1.1 christos FIXTURES_REQUIRED iostream3_as_config) 117 1.1 christos 118 1.1 christos # 119 1.1 christos # add_subdirectory_exclude_test 120 1.1 christos # 121 1.1 christos add_test( 122 1.1 christos NAME zlib_iostream3_add_subdirectory_exclude_configure 123 1.1 christos COMMAND 124 1.1 christos ${CMAKE_COMMAND} ${PLATFORM} 125 1.1 christos -B${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_exclude_test_build 126 1.1 christos -DCMAKE_BUILD_TYPE=$<CONFIG> -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_iostream3_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_iostream3_add_subdirectory_exclude_configure 140 1.1 christos PROPERTIES 141 1.1 christos FIXTURES_REQUIRED ${inst_setup} 142 1.1 christos FIXTURES_SETUP iostream3_asx_config) 143 1.1 christos 144 1.1 christos set_tests_properties(zlib_iostream3_add_subdirectory_exclude_build 145 1.1 christos PROPERTIES 146 1.1 christos FIXTURES_REQUIRED iostream3_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_iostream3_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(zlib_iostream3_find_package_no_components_configure 164 1.1 christos PROPERTIES 165 1.1 christos FIXTURES_REQUIRED ${inst_setup}) 166 1.1 christos 167 1.1 christos if(NOT ZLIB_IOSTREAM3_BUILD_SHARED OR NOT ZLIB_IOSTREAM3_BUILD_STATIC) 168 1.1 christos set_tests_properties(zlib_iostream3_find_package_no_components_configure 169 1.1 christos PROPERTIES 170 1.1 christos WILL_FAIL TRUE) 171 1.1 christos endif(NOT ZLIB_IOSTREAM3_BUILD_SHARED OR NOT ZLIB_IOSTREAM3_BUILD_STATIC) 172 1.1 christos 173 1.1 christos # 174 1.1 christos # findpackage_no_components_test 175 1.1 christos # 176 1.1 christos add_test( 177 1.1 christos NAME zlib_iostream3_find_package_wrong_components_configure 178 1.1 christos COMMAND 179 1.1 christos ${CMAKE_COMMAND} ${PLATFORM} 180 1.1 christos -B${CMAKE_CURRENT_BINARY_DIR}/findpackage_wrong_components_test_build 181 1.1 christos -DCMAKE_BUILD_TYPE=$<CONFIG> -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} 182 1.1 christos -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} 183 1.1 christos -DCMAKE_INSTALL_PREFIX=${WORK_DIR}/test/test_install ${ZLIB_ARG} 184 1.1 christos --fresh 185 1.1 christos -G "${CMAKE_GENERATOR}" 186 1.1 christos -S${CMAKE_CURRENT_BINARY_DIR}/findpackage_wrong_components_test) 187 1.1 christos 188 1.1 christos set_tests_properties(zlib_iostream3_find_package_wrong_components_configure 189 1.1 christos PROPERTIES 190 1.1 christos FIXTURES_REQUIRED ${inst_setup} 191 1.1 christos WILL_FAIL TRUE) 192