diff options
Diffstat (limited to 'contrib/iostream3/test/add_subdirectory_exclude_test.cmake.in')
| -rw-r--r-- | contrib/iostream3/test/add_subdirectory_exclude_test.cmake.in | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/contrib/iostream3/test/add_subdirectory_exclude_test.cmake.in b/contrib/iostream3/test/add_subdirectory_exclude_test.cmake.in new file mode 100644 index 000000000000..efc9cd8b8642 --- /dev/null +++ b/contrib/iostream3/test/add_subdirectory_exclude_test.cmake.in @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 3.12...3.31) + +project( + iostream_add_subdirectory_exclude + LANGUAGES CXX + VERSION @iostreamV3_VERSION@) + +option(ZLIB_IOSTREAM3_BUILD_SHARED "" @ZLIB_IOSTREAM3_BUILD_SHARED@) +option(ZLIB_IOSTREAM3_BUILD_STATIC "" @ZLIB_IOSTREAM3_BUILD_STATIC@) +option(ZLIB_IOSTREAM3_BUILD_TESTING "" OFF) + +add_subdirectory(@iostreamV3_SOURCE_DIR@ + ${CMAKE_CURRENT_BINARY_DIR}/iostream3 + EXCLUDE_FROM_ALL) + +set(IOSTREAM_SRCS + @iostreamV3_SOURCE_DIR@/test.cc) + +if(ZLIB_IOSTREAM3_BUILD_SHARED) + add_executable(test_example ${IOSTREAM_SRCS}) + target_link_libraries(test_example IOSTREAMV3::IOSTREAMV3) +endif(ZLIB_IOSTREAM3_BUILD_SHARED) + +if(ZLIB_IOSTREAM3_BUILD_STATIC) + add_executable(test_example_static ${IOSTREAM_SRCS}) + target_link_libraries(test_example_static IOSTREAMV3::IOSTREAMV3STATIC) +endif(ZLIB_IOSTREAM3_BUILD_STATIC) |
