Skip to content

Commit

Permalink
Changed 'UNIX' to 'NOT MSVC'
Browse files Browse the repository at this point in the history
  • Loading branch information
j0r1 committed Mar 17, 2017
1 parent 8e81f74 commit dabdc11
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 32 deletions.
32 changes: 16 additions & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,24 +41,24 @@ endif()
include(TestBigEndian)
include("${PROJECT_SOURCE_DIR}/cmake/Macros.cmake")

if (NOT UNIX)
if (MSVC)
set(EMIPLIB_COMPILE_STATIC ON CACHE BOOL "Flag indicating if a static library should be built, or a dynamic one")
endif (NOT UNIX)
endif ()

if (UNIX)
if (NOT MSVC)
if (APPLE)
set(TMP ON)
else (APPLE)
set(TMP OFF)
endif (APPLE)
option(EMIPLIB_LINK "Flag indicating if the shared library should be automatically linked against the other libraries used" ${TMP})
else (UNIX)
else ()
if (EMIPLIB_COMPILE_STATIC)
set(EMIPLIB_LINK FALSE)
else (EMIPLIB_COMPILE_STATIC)
set(EMIPLIB_LINK TRUE)
endif (EMIPLIB_COMPILE_STATIC)
endif (UNIX)
endif ()

set(EMIPLIB_REQUIRED_MODULES "")
set(EMIPLIB_INTERNAL_INCLUDES "")
Expand Down Expand Up @@ -331,22 +331,22 @@ else (EMIPLIB_STDINT)
if (EMIPLIB_INTTYPES)
set(EMIPLIB_INTTYPE_HEADERS "#include <inttypes.h>\n")
else (EMIPLIB_INTTYPES)
if (NOT UNIX AND WIN32)
if (MSVC)
set(EMIPLIB_INTTYPE_HEADERS "#include \"miptypes_win.h\"")
else (NOT UNIX AND WIN32)
else ()
set(EMIPLIB_INTTYPE_HEADERS "#error Could not find header files that define types like 'uint32_t'. Please edit the file ${PROJECT_BINARY_DIR}/src/core/miptypes.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")
message("\n\nError: Could not find header files that define types like 'uint32_t'.\nPlease edit the file ${PROJECT_BINARY_DIR}/src/core/miptypes.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")
endif (NOT UNIX AND WIN32)
endif ()
endif (EMIPLIB_INTTYPES)
endif (EMIPLIB_STDINT)

if (UNIX OR EMIPLIB_COMPILE_STATIC)
if (NOT MSVC OR EMIPLIB_COMPILE_STATIC)
set(EMIPLIB_IMPORT "")
set(EMIPLIB_EXPORT "")
else (UNIX OR EMIPLIB_COMPILE_STATIC)
else ()
set(EMIPLIB_IMPORT "__declspec(dllimport)")
set(EMIPLIB_EXPORT "__declspec(dllexport)")
endif (UNIX OR EMIPLIB_COMPILE_STATIC)
endif ()

configure_file("${PROJECT_SOURCE_DIR}/src/core/mipconfig.h.in" "${PROJECT_BINARY_DIR}/src/core/mipconfig.h")
configure_file("${PROJECT_SOURCE_DIR}/src/core/miptypes.h.in" "${PROJECT_BINARY_DIR}/src/core/miptypes.h")
Expand All @@ -359,12 +359,12 @@ if (EMIPLIB_COMPILE_TESTS)
add_subdirectory(tests)
endif()

if (UNIX)
if (NOT MSVC)
set(EMIPLIB_LIBS "-L${LIBRARY_INSTALL_DIR}" "-lemip")
else (UNIX)
else ()
set(EMIPLIB_LIBS optimized "${LIBRARY_INSTALL_DIR}/emiplib.lib"
debug "${LIBRARY_INSTALL_DIR}/emiplib_d.lib")
endif (UNIX)
endif ()

set(EMIPLIB_INCDIRS ${EMIPLIB_EXTERNAL_INCLUDES} ${CMAKE_INSTALL_PREFIX}/include)
set(EMIPLIB_LIBS ${EMIPLIB_LIBS} ${EMIPLIB_LINK_LIBS})
Expand All @@ -382,7 +382,7 @@ endforeach()
configure_file("${PROJECT_SOURCE_DIR}/cmake/EMIPLIBConfig.cmake.in" "${PROJECT_BINARY_DIR}/cmake/EMIPLIBConfig.cmake")
install(FILES "${PROJECT_BINARY_DIR}/cmake/EMIPLIBConfig.cmake" DESTINATION ${LIBRARY_INSTALL_DIR}/cmake/EMIPLIB)

if (UNIX)
if (NOT MSVC)
foreach(ARG ${EMIPLIB_LIBS})
set(EMIPLIB_LIBS_PKGCONFIG "${EMIPLIB_LIBS_PKGCONFIG} ${ARG}")
endforeach()
Expand All @@ -392,7 +392,7 @@ if (UNIX)

configure_file(${PROJECT_SOURCE_DIR}/pkgconfig/emiplib.pc.in ${PROJECT_BINARY_DIR}/pkgconfig/emiplib.pc)
install(FILES ${PROJECT_BINARY_DIR}/pkgconfig/emiplib.pc DESTINATION ${LIBRARY_INSTALL_DIR}/pkgconfig)
endif (UNIX)
endif ()

if (EMIPLIB_GPL)
message("License: GPL\n\n"
Expand Down
4 changes: 2 additions & 2 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ apply_include_paths("${EMIPLIB_EXTERNAL_INCLUDES}")
foreach(IDX avsession feedbackexample multiplesoundfileplayer simplechain soundfileplayer soundrecorder pushtotalk
pushtotalk2 soundvolume audiosession)
add_executable(${IDX} ${IDX}.cpp)
if (UNIX OR EMIPLIB_COMPILE_STATIC)
if (NOT MSVC OR EMIPLIB_COMPILE_STATIC)
target_link_libraries(${IDX} emiplib-static ${EMIPLIB_LINK_LIBS})
else ()
target_link_libraries(${IDX} emiplib-shared ${EMIPLIB_LINK_LIBS})
endif (UNIX OR EMIPLIB_COMPILE_STATIC)
endif ()
endforeach(IDX)

24 changes: 12 additions & 12 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -251,38 +251,38 @@ thirdparty/lpc/lpccodec.cpp
thirdparty/tinyjpeg/tinyjpeg.c
thirdparty/tinyjpeg/jidctflt.c )

if (NOT UNIX AND WIN32)
if (MSVC)
set(CMAKE_DEBUG_POSTFIX _d)
endif (NOT UNIX AND WIN32)
endif ()

apply_include_paths("${EMIPLIB_INTERNAL_INCLUDES}")
apply_include_paths("${EMIPLIB_EXTERNAL_INCLUDES}")

if (UNIX OR EMIPLIB_COMPILE_STATIC)
if (NOT MSVC OR EMIPLIB_COMPILE_STATIC)
add_library(emiplib-static STATIC ${SOURCES} ${HEADERS})
if (UNIX)
if (NOT MSVC)
set_target_properties(emiplib-static PROPERTIES OUTPUT_NAME emip)
else (UNIX)
else ()
set_target_properties(emiplib-static PROPERTIES OUTPUT_NAME emiplib)
endif (UNIX)
endif ()
set_target_properties(emiplib-static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
set(EMIPLIB_INSTALLTARGETS emiplib-static)
endif (UNIX OR EMIPLIB_COMPILE_STATIC)
endif ()

if (UNIX OR NOT EMIPLIB_COMPILE_STATIC)
if (NOT MSVC OR NOT EMIPLIB_COMPILE_STATIC)
add_library(emiplib-shared SHARED ${SOURCES} ${HEADERS})
set_target_properties(emiplib-shared PROPERTIES VERSION ${VERSION})
if (UNIX)
if (NOT MSVC)
set_target_properties(emiplib-shared PROPERTIES OUTPUT_NAME emip)
else (UNIX)
else ()
set_target_properties(emiplib-shared PROPERTIES OUTPUT_NAME emiplib)
endif (UNIX)
endif ()
set_target_properties(emiplib-shared PROPERTIES CLEAN_DIRECT_OUTPUT 1)
set(EMIPLIB_INSTALLTARGETS ${EMIPLIB_INSTALLTARGETS} emiplib-shared)
if (EMIPLIB_LINK)
target_link_libraries(emiplib-shared ${EMIPLIB_LINK_LIBS})
endif (EMIPLIB_LINK)
endif (UNIX OR NOT EMIPLIB_COMPILE_STATIC)
endif ()

install(FILES ${HEADERS} DESTINATION include/emiplib)
install(TARGETS ${EMIPLIB_INSTALLTARGETS} DESTINATION ${LIBRARY_INSTALL_DIR})
Expand Down
4 changes: 2 additions & 2 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ apply_include_paths("${EMIPLIB_INTERNAL_INCLUDES}")
apply_include_paths("${EMIPLIB_EXTERNAL_INCLUDES}")

macro(linkit TARGET)
if (UNIX OR EMIPLIB_COMPILE_STATIC)
if (NOT MSVC OR EMIPLIB_COMPILE_STATIC)
target_link_libraries(${TARGET} emiplib-static ${EMIPLIB_LINK_LIBS} ${ARGN})
else ()
target_link_libraries(${TARGET} emiplib-shared ${EMIPLIB_LINK_LIBS} ${ARGN})
endif (UNIX OR EMIPLIB_COMPILE_STATIC)
endif ()
endmacro()

foreach(IDX pulseouttest portaudioouttest replayaudio qtouttest audiocodectest delayedchainstarttest streamopus streamopusrecv
Expand Down

0 comments on commit dabdc11

Please sign in to comment.