diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 877c6fce..23a2b47f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -62,21 +62,28 @@ aux_source_directory ("${PROJECT_SOURCE_DIR}/zlib/" SOURCEFILE) #Windows specific libraries and linker flags if(WIN32) + include_directories ("${PROJECT_SOURCE_DIR}/win_spec_incld/") include_directories ("${PROJECT_SOURCE_DIR}/win_iconv/") aux_source_directory ("${PROJECT_SOURCE_DIR}/win_iconv/" SOURCEFILE) - set (EXTRA_LIBS ${EXTRA_LIBS} -lws2_32 -lwinmm) + set (EXTRA_LIBS ${EXTRA_LIBS} ws2_32 winmm) else (WIN32) # Adding some platform specific library path link_directories (/opt/local/lib) link_directories (/usr/local/lib) endif(WIN32) -set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -Wall -g -std=gnu99 -Wno-write-strings -D_FILE_OFFSET_BITS=64") +if(MSVC) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -W3 /wd4005 /wd4996") +else (MSVC) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-write-strings -g -std=gnu99") +endif(MSVC) + +set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_FILE_OFFSET_BITS=64") add_subdirectory (lib_ccx) aux_source_directory (${PROJECT_SOURCE_DIR} SOURCEFILE) set (EXTRA_LIBS ${EXTRA_LIBS} ccx) -set (EXTRA_LIBS ${EXTRA_LIBS} m) +# set (EXTRA_LIBS ${EXTRA_LIBS} m) if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set (EXTRA_LIBS ${EXTRA_LIBS} iconv) diff --git a/src/lib_ccx/CMakeLists.txt b/src/lib_ccx/CMakeLists.txt index b9951c0c..8878e4f1 100644 --- a/src/lib_ccx/CMakeLists.txt +++ b/src/lib_ccx/CMakeLists.txt @@ -1,6 +1,14 @@ cmake_policy (SET CMP0037 NEW) -set (CMAKE_C_FLAGS "-O0 -Wall -g -std=gnu99") +if(MSVC) + set (CMAKE_C_FLAGS "-W3 /wd4005 /wd4996") +else (MSVC) + set (CMAKE_C_FLAGS "-Wall -g -std=gnu99") +endif(MSVC) + +if(WIN32) + add_definitions(-DWIN32) +endif(WIN32) if (WITH_FFMPEG) find_package(PkgConfig)