diff --git a/CMakeLists.txt b/CMakeLists.txt index 3921dfe..ee68d6b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,11 +16,18 @@ ENDIF( NOT CMAKE_BUILD_TYPE ) set( SSE_MATTERS NO ) +if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + set(MACOSX TRUE) +endif() + if( CMAKE_COMPILER_IS_GNUCXX ) set( GPROF 0 CACHE BOOL "Enable profiling with gprof for Debug and RelWithDebInfo build types." ) set( PROFILE 0 CACHE INT "1=Generate profile coverage info, 2=Use it" ) + if (NOT MACOSX) + set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} -static -static-libgcc -static-libstdc++") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static -static-libgcc -static-libstdc++") + endif() endif( CMAKE_COMPILER_IS_GNUCXX ) - find_package( ZLIB ) if( MSVC )