diff --git a/CMakeLists.txt b/CMakeLists.txt index eb6e5ef..5714195 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,26 @@ execute_process( ) message(STATUS "Finished get_deps.py") +if (WIN32) + set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd") +elseif (LINUX) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") +elseif (APPLE) + # if(${APNGASM_COMPILE_TARGET} STREQUAL "x86_64") + set(CMAKE_OSX_DEPLOYMENT_TARGET "11.0") + # endif() +endif() + +set(ZLIB_USE_STATIC_LIBS ON) +set(PNG_USE_STATIC_LIBS ON) +set(Boost_USE_STATIC_LIBS ON) +if (WIN32) + set(Boost_USE_MULTITHREADED ON) + set(Boost_USE_STATIC_RUNTIME ON) +endif() + # Add conan packages if ("${APNGASM_COMPILE_TARGET}" STREQUAL "universal2") set(CONAN_TOOLCHAIN_1 ${CMAKE_SOURCE_DIR}/conan_output/armv8/conan_toolchain.cmake) @@ -46,26 +66,6 @@ else() endif() endif() -if (WIN32) - set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT") - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd") -elseif (LINUX) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") -elseif (APPLE) - # if(${APNGASM_COMPILE_TARGET} STREQUAL "x86_64") - set(CMAKE_OSX_DEPLOYMENT_TARGET "11.0") - # endif() -endif() - -set(ZLIB_USE_STATIC_LIBS ON) -set(PNG_USE_STATIC_LIBS ON) -set(Boost_USE_STATIC_LIBS ON) -if (WIN32) - set(Boost_USE_MULTITHREADED ON) - set(Boost_USE_STATIC_RUNTIME ON) -endif() - project(apngasm-python VERSION 1.0.6) set(PY_VERSION_SUFFIX "") set(PY_FULL_VERSION ${PROJECT_VERSION}${PY_VERSION_SUFFIX})