diff --git a/CMakeLists.txt b/CMakeLists.txt index 022ed8b..277ea34 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -80,10 +80,12 @@ endif(N2N_OPTION_USE_ZSTD) if(N2N_OPTION_USE_PORTMAPPING) ADD_DEFINITIONS("-DHAVE_MINIUPNP") - ADD_DEFINITIONS("-DHAVE_NATPMP") include_directories(${THIRD_PARTY_DIR}/miniupnp/miniupnpc/include) include_directories(${PROJECT_BINARY_DIR}/lib_miniupnpc) +if(NOT DEFINED WIN32) + ADD_DEFINITIONS("-DHAVE_NATPMP") include_directories(${THIRD_PARTY_DIR}/libnatpmp) +endif(NOT DEFINED WIN32) endif(N2N_OPTION_USE_PORTMAPPING) if(NOT DEFINED CMAKE_BUILD_TYPE) @@ -170,9 +172,12 @@ endif(N2N_OPTION_USE_ZSTD) if(N2N_OPTION_USE_PORTMAPPING) add_subdirectory(${THIRD_PARTY_DIR}/miniupnp/miniupnpc lib_miniupnpc) link_directories(${PROJECT_BINARY_DIR}/lib_miniupnpc) + target_link_libraries(n2n libminiupnpc-static) +if(NOT DEFINED WIN32) add_subdirectory(${THIRD_PARTY_DIR}/libnatpmp libnatpmp) link_directories(${PROJECT_BINARY_DIR}/libnatpmp) - target_link_libraries(n2n libminiupnpc-static natpmp) + target_link_libraries(n2n natpmp) +endif(NOT DEFINED WIN32) endif(N2N_OPTION_USE_PORTMAPPING) if(DEFINED WIN32)