Skip to content

Commit 4748db5

Browse files
committed
Changed 'UNIX' to 'NOT MSVC'
Seems to work better with MinGW/MSYS
1 parent da4fa89 commit 4748db5

File tree

4 files changed

+28
-28
lines changed

4 files changed

+28
-28
lines changed

CMakeLists.txt

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -141,31 +141,31 @@ else (JRTPLIB_STDINT)
141141
if (JRTPLIB_INTTYPES)
142142
set(RTP_INTTYPE_HEADERS "#include <inttypes.h>\n#include <sys/types.h>\n")
143143
else (JRTPLIB_INTTYPES)
144-
if (NOT UNIX AND WIN32)
144+
if (MSVC)
145145
set(RTP_INTTYPE_HEADERS "#include \"rtptypes_win.h\"")
146-
else (NOT UNIX AND WIN32)
146+
else (MSVC)
147147
set(RTP_INTTYPE_HEADERS "#error Could not find header files that define types like 'uint32_t'. Please edit the file ${PROJECT_BINARY_DIR}/src/rtptypes_unix.h and make sure that the following types are defined: int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t")
148148
message("\n\nError: Could not find header files that define types like 'uint32_t'.\nPlease edit the file ${PROJECT_BINARY_DIR}/src/rtptypes_unix.h\nand make sure that the following types are defined: \nint8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t\n\n")
149-
endif (NOT UNIX AND WIN32)
149+
endif (MSVC)
150150
endif (JRTPLIB_INTTYPES)
151151
endif (JRTPLIB_STDINT)
152152

153153
if (RTP_SOCKETTYPE_WINSOCK)
154154
set(RTP_WINSOCK_HEADERS "#ifdef RTP_SOCKETTYPE_WINSOCK\n #include <winsock2.h> \n #include <ws2tcpip.h>\n#ifndef _WIN32_WCE\n #include <sys/types.h>\n#endif // _WIN32_WCE\n#endif // RTP_SOCKETTYPE_WINSOCK\n")
155155
endif (RTP_SOCKETTYPE_WINSOCK)
156156

157-
if (NOT UNIX)
157+
if (MSVC)
158158
set(JRTPLIB_COMPILE_STATIC ON CACHE BOOL "Flag indicating if a static library should be built, or a dynamic one")
159159
list(APPEND JRTPLIB_LINK_LIBS "ws2_32")
160-
endif (NOT UNIX)
160+
endif ()
161161

162-
if (UNIX OR JRTPLIB_COMPILE_STATIC)
162+
if (NOT MSVC OR JRTPLIB_COMPILE_STATIC)
163163
set(JRTPLIB_IMPORT "")
164164
set(JRTPLIB_EXPORT "")
165-
else (UNIX OR JRTPLIB_COMPILE_STATIC)
165+
else ()
166166
set(JRTPLIB_IMPORT "__declspec(dllimport)")
167167
set(JRTPLIB_EXPORT "__declspec(dllexport)")
168-
endif (UNIX OR JRTPLIB_COMPILE_STATIC)
168+
endif ()
169169

170170
configure_file("${PROJECT_SOURCE_DIR}/src/rtptypes.h.in" "${PROJECT_BINARY_DIR}/src/rtptypes.h")
171171
configure_file("${PROJECT_SOURCE_DIR}/src/rtpconfig.h.in" "${PROJECT_BINARY_DIR}/src/rtpconfig.h")
@@ -180,12 +180,12 @@ if (JRTPLIB_COMPILE_TESTS)
180180
add_subdirectory(tests)
181181
endif()
182182

183-
if (UNIX)
183+
if (NOT MSVC)
184184
set(JRTPLIB_LIBS "-L${LIBRARY_INSTALL_DIR}" "-ljrtp")
185-
else (UNIX)
185+
else ()
186186
set(JRTPLIB_LIBS optimized "${LIBRARY_INSTALL_DIR}/jrtplib.lib"
187187
debug "${LIBRARY_INSTALL_DIR}/jrtplib_d.lib")
188-
endif (UNIX)
188+
endif ()
189189

190190
set(JRTPLIB_INCDIRS ${JRTPLIB_EXTERNAL_INCLUDES} ${CMAKE_INSTALL_PREFIX}/include)
191191
set(JRTPLIB_LIBS ${JRTPLIB_LIBS} ${JRTPLIB_LINK_LIBS})
@@ -203,7 +203,7 @@ endforeach()
203203
configure_file("${PROJECT_SOURCE_DIR}/cmake/JRTPLIBConfig.cmake.in" "${PROJECT_BINARY_DIR}/cmake/JRTPLIBConfig.cmake")
204204
install(FILES "${PROJECT_BINARY_DIR}/cmake/JRTPLIBConfig.cmake" DESTINATION ${LIBRARY_INSTALL_DIR}/cmake/JRTPLIB)
205205

206-
if (UNIX)
206+
if (NOT MSVC)
207207
foreach(ARG ${JRTPLIB_LIBS})
208208
set(JRTPLIB_LIBS_PKGCONFIG "${JRTPLIB_LIBS_PKGCONFIG} ${ARG}")
209209
endforeach()
@@ -213,6 +213,6 @@ if (UNIX)
213213

214214
configure_file(${PROJECT_SOURCE_DIR}/pkgconfig/jrtplib.pc.in ${PROJECT_BINARY_DIR}/pkgconfig/jrtplib.pc)
215215
install(FILES ${PROJECT_BINARY_DIR}/pkgconfig/jrtplib.pc DESTINATION ${LIBRARY_INSTALL_DIR}/pkgconfig)
216-
endif (UNIX)
216+
endif ()
217217

218218

examples/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apply_include_paths("${JRTPLIB_EXTERNAL_INCLUDES}")
33

44
foreach(IDX 1 2 3 4 5 6 7 8)
55
add_executable(example${IDX} example${IDX}.cpp)
6-
if (UNIX OR JRTPLIB_COMPILE_STATIC)
6+
if (NOT MSVC OR JRTPLIB_COMPILE_STATIC)
77
target_link_libraries(example${IDX} jrtplib-static)
88
else ()
99
target_link_libraries(example${IDX} jrtplib-shared)

src/CMakeLists.txt

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,12 @@ set(SOURCES
103103
rtptcptransmitter.cpp
104104
)
105105

106-
if (UNIX)
106+
if (NOT MSVC)
107107
set (SOURCES ${SOURCES} extratransmitters/rtpfaketransmitter.cpp )
108108
set (HEADERS ${HEADERS} extratransmitters/rtpfaketransmitter.h )
109-
else (UNIX)
109+
else ()
110110
set(CMAKE_DEBUG_POSTFIX _d)
111-
endif (UNIX)
111+
endif ()
112112

113113
# Enable extra compiler warnings and mark warnings as errors: -Wall -Wextra -Werror
114114
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUCC)
@@ -118,30 +118,30 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUCC)
118118
endif ()
119119
endif(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUCC)
120120

121-
if (UNIX OR JRTPLIB_COMPILE_STATIC)
121+
if (NOT MSVC OR JRTPLIB_COMPILE_STATIC)
122122
add_library(jrtplib-static STATIC ${SOURCES} ${HEADERS})
123-
if (UNIX)
123+
if (NOT MSVC)
124124
set_target_properties(jrtplib-static PROPERTIES OUTPUT_NAME jrtp)
125-
else (UNIX)
125+
else ()
126126
set_target_properties(jrtplib-static PROPERTIES OUTPUT_NAME jrtplib)
127-
endif(UNIX)
127+
endif()
128128
set_target_properties(jrtplib-static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
129129
set(JRTPLIB_INSTALLTARGETS jrtplib-static)
130130
target_link_libraries(jrtplib-static ${JRTPLIB_LINK_LIBS})
131-
endif (UNIX OR JRTPLIB_COMPILE_STATIC)
131+
endif (NOT MSVC OR JRTPLIB_COMPILE_STATIC)
132132

133-
if (UNIX OR NOT JRTPLIB_COMPILE_STATIC)
133+
if (NOT MSVC OR NOT JRTPLIB_COMPILE_STATIC)
134134
add_library(jrtplib-shared SHARED ${SOURCES} ${HEADERS})
135-
if (UNIX)
135+
if (NOT MSVC)
136136
set_target_properties(jrtplib-shared PROPERTIES OUTPUT_NAME jrtp)
137-
else (UNIX)
137+
else ()
138138
set_target_properties(jrtplib-shared PROPERTIES OUTPUT_NAME jrtplib)
139-
endif(UNIX)
139+
endif()
140140
set_target_properties(jrtplib-shared PROPERTIES VERSION ${VERSION})
141141
set_target_properties(jrtplib-shared PROPERTIES CLEAN_DIRECT_OUTPUT 1)
142142
set(JRTPLIB_INSTALLTARGETS ${JRTPLIB_INSTALLTARGETS} jrtplib-shared)
143143
target_link_libraries(jrtplib-shared ${JRTPLIB_LINK_LIBS})
144-
endif (UNIX OR NOT JRTPLIB_COMPILE_STATIC)
144+
endif (NOT MSVC OR NOT JRTPLIB_COMPILE_STATIC)
145145

146146
apply_include_paths("${JRTPLIB_INTERNAL_INCLUDES}")
147147
apply_include_paths("${JRTPLIB_EXTERNAL_INCLUDES}")

tests/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ apply_include_paths("${JRTPLIB_EXTERNAL_INCLUDES}")
44
foreach(T testmultiplex testexistingsockets testautoportbase srtptest rtcpdump readlogfile
55
timetest timeinittest abortdesctest abortdescipv6 tcptest)
66
add_executable(${T} ${T}.cpp)
7-
if (UNIX OR JRTPLIB_COMPILE_STATIC)
7+
if (NOT MSVC OR JRTPLIB_COMPILE_STATIC)
88
target_link_libraries(${T} jrtplib-static)
99
else ()
1010
target_link_libraries(${T} jrtplib-shared)

0 commit comments

Comments
 (0)