Home | History | Annotate | Line # | Download | only in test
      1 cmake_minimum_required(VERSION 3.12...3.31)
      2 
      3 project(
      4     iostream_add_subdirectory
      5     LANGUAGES CXX
      6     VERSION @iostreamV3_VERSION@)
      7 
      8 option(ZLIB_IOSTREAM3_BUILD_SHARED "" @ZLIB_IOSTREAM3_BUILD_SHARED@)
      9 option(ZLIB_IOSTREAM3_BUILD_STATIC "" @ZLIB_IOSTREAM3_BUILD_STATIC@)
     10 option(ZLIB_IOSTREAM3_BUILD_TESTING "" OFF)
     11 
     12 add_subdirectory(@iostreamV3_SOURCE_DIR@ ${CMAKE_CURRENT_BINARY_DIR}/iostream3)
     13 
     14 set(IOSTREAM_SRCS
     15     @iostreamV3_SOURCE_DIR@/test.cc)
     16 
     17 if(ZLIB_IOSTREAM3_BUILD_SHARED)
     18     add_executable(test_example ${IOSTREAM_SRCS})
     19     target_link_libraries(test_example IOSTREAMV3::IOSTREAMV3)
     20 endif(ZLIB_IOSTREAM3_BUILD_SHARED)
     21 
     22 if(ZLIB_IOSTREAM3_BUILD_STATIC)
     23     add_executable(test_example_static ${IOSTREAM_SRCS})
     24     target_link_libraries(test_example_static IOSTREAMV3::IOSTREAMV3STATIC)
     25 endif(ZLIB_IOSTREAM3_BUILD_STATIC)
     26