--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,7 +9,3 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
 add_subdirectory(src)
 add_definitions("${TINYSPLINE_DEFINITIONS}")
 
-add_subdirectory(examples)
-add_subdirectory(test)
-add_subdirectory(docs)
-add_subdirectory(tools)
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -324,14 +324,12 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
 	set(TINYSPLINE_LIBRARIES "${TINYSPLINE_LIBRARIES} -lm")
 
 	# TINYSPLINE_LIBRARY_C_FLAGS
-	set(TINYSPLINE_LIBRARY_C_FLAGS "${TINYSPLINE_LIBRARY_C_FLAGS} -Werror")
 	set(TINYSPLINE_LIBRARY_C_FLAGS "${TINYSPLINE_LIBRARY_C_FLAGS} -Wall")
 	set(TINYSPLINE_LIBRARY_C_FLAGS "${TINYSPLINE_LIBRARY_C_FLAGS} -Wextra")
 	set(TINYSPLINE_LIBRARY_C_FLAGS "${TINYSPLINE_LIBRARY_C_FLAGS} -Wfloat-equal")
 	set(TINYSPLINE_LIBRARY_C_FLAGS "${TINYSPLINE_LIBRARY_C_FLAGS} -pedantic")
 
 	# TINYSPLINE_LIBRARY_CXX_FLAGS 
-	set(TINYSPLINE_LIBRARY_CXX_FLAGS "${TINYSPLINE_LIBRARY_CXX_FLAGS} -Werror")
 	set(TINYSPLINE_LIBRARY_CXX_FLAGS "${TINYSPLINE_LIBRARY_CXX_FLAGS} -Wall")
 	set(TINYSPLINE_LIBRARY_CXX_FLAGS "${TINYSPLINE_LIBRARY_CXX_FLAGS} -Wextra")
 	set(TINYSPLINE_LIBRARY_CXX_FLAGS "${TINYSPLINE_LIBRARY_CXX_FLAGS} -Wfloat-equal")
@@ -358,14 +356,12 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
 	set(TINYSPLINE_LIBRARIES "${TINYSPLINE_LIBRARIES} -lm")
 
 	# TINYSPLINE_LIBRARY_C_FLAGS
-	set(TINYSPLINE_LIBRARY_C_FLAGS "${TINYSPLINE_LIBRARY_C_FLAGS} -Werror")
 	set(TINYSPLINE_LIBRARY_C_FLAGS "${TINYSPLINE_LIBRARY_C_FLAGS} -Wall")
 	set(TINYSPLINE_LIBRARY_C_FLAGS "${TINYSPLINE_LIBRARY_C_FLAGS} -Wextra")
 	set(TINYSPLINE_LIBRARY_C_FLAGS "${TINYSPLINE_LIBRARY_C_FLAGS} -Wfloat-equal")
 	set(TINYSPLINE_LIBRARY_C_FLAGS "${TINYSPLINE_LIBRARY_C_FLAGS} -pedantic")
 
 	# TINYSPLINE_LIBRARY_CXX_FLAGS 
-	set(TINYSPLINE_LIBRARY_CXX_FLAGS "${TINYSPLINE_LIBRARY_CXX_FLAGS} -Werror")
 	set(TINYSPLINE_LIBRARY_CXX_FLAGS "${TINYSPLINE_LIBRARY_CXX_FLAGS} -Wall")
 	set(TINYSPLINE_LIBRARY_CXX_FLAGS "${TINYSPLINE_LIBRARY_CXX_FLAGS} -Wextra")
 	set(TINYSPLINE_LIBRARY_CXX_FLAGS "${TINYSPLINE_LIBRARY_CXX_FLAGS} -Wfloat-equal")
@@ -386,11 +382,9 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
 
 	# TINYSPLINE_LIBRARY_C_FLAGS
 	set(TINYSPLINE_LIBRARY_C_FLAGS "${TINYSPLINE_LIBRARY_C_FLAGS} /Wall")
-	set(TINYSPLINE_LIBRARY_C_FLAGS "${TINYSPLINE_LIBRARY_C_FLAGS} /WX")
 
 	# TINYSPLINE_LIBRARY_CXX_FLAGS
 	set(TINYSPLINE_LIBRARY_CXX_FLAGS "${TINYSPLINE_LIBRARY_CXX_FLAGS} /Wall")
-	set(TINYSPLINE_LIBRARY_CXX_FLAGS "${TINYSPLINE_LIBRARY_CXX_FLAGS} /WX")
 	set(TINYSPLINE_LIBRARY_CXX_FLAGS "${TINYSPLINE_LIBRARY_CXX_FLAGS} /wd4514")
 	set(TINYSPLINE_LIBRARY_CXX_FLAGS "${TINYSPLINE_LIBRARY_CXX_FLAGS} /wd4710")
 	set(TINYSPLINE_LIBRARY_CXX_FLAGS "${TINYSPLINE_LIBRARY_CXX_FLAGS} /wd4350")
@@ -467,8 +461,11 @@ list(APPEND TINYSPLINE_CXX_SOURCE_FILES
 set(TINYSPLINE_CXX_SOURCE_FILES ${TINYSPLINE_CXX_SOURCE_FILES} PARENT_SCOPE)
 
 # C library
-if(TARGET_SUPPORTS_SHARED_LIBS)
+if(BUILD_SHARED_LIBS)
 	add_library(tinyspline_shared SHARED ${TINYSPLINE_C_SOURCE_FILES})
+	if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
+		target_link_libraries(tinyspline_shared PRIVATE m)
+	endif()
 	set_target_properties(tinyspline_shared PROPERTIES
 		OUTPUT_NAME "tinyspline"
 		DEBUG_POSTFIX "${TINYSPLINE_DEBUG_POSTFIX}"
@@ -479,7 +476,7 @@ if(TARGET_SUPPORTS_SHARED_LIBS)
 		ARCHIVE DESTINATION lib
 		RUNTIME DESTINATION bin
 	)
-endif()
+else()
 add_library(tinyspline_static STATIC ${TINYSPLINE_C_SOURCE_FILES})
 set_target_properties(tinyspline_static PROPERTIES
 	OUTPUT_NAME "tinyspline"
@@ -491,16 +488,17 @@ install(TARGETS tinyspline_static
 	LIBRARY DESTINATION lib
 	ARCHIVE DESTINATION lib
 )
-install(FILES tinyspline.h
-	DESTINATION include
-)
 target_include_directories(tinyspline_static
 	PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
 )
+endif()
+install(FILES tinyspline.h
+	DESTINATION include
+)
 
 # C++ library
 if(NOT TINYSPLINE_DISABLE_CXX AND TINYSPLINE_CXX_AVAILABLE)
-	if(TARGET_SUPPORTS_SHARED_LIBS)
+	if(BUILD_SHARED_LIBS)
 		add_library(tinysplinecpp_shared SHARED ${TINYSPLINE_CXX_SOURCE_FILES})
 		set_target_properties(tinysplinecpp_shared PROPERTIES
 			OUTPUT_NAME "tinysplinecpp"
@@ -512,7 +510,7 @@ if(NOT TINYSPLINE_DISABLE_CXX AND TINYSPLINE_CXX_AVAILABLE)
 			ARCHIVE DESTINATION lib
 			RUNTIME DESTINATION bin
 		)
-	endif()
+	else()
 	add_library(tinysplinecpp_static STATIC ${TINYSPLINE_CXX_SOURCE_FILES})
 	set_target_properties(tinysplinecpp_static PROPERTIES
 		OUTPUT_NAME "tinysplinecpp"
@@ -524,12 +522,13 @@ if(NOT TINYSPLINE_DISABLE_CXX AND TINYSPLINE_CXX_AVAILABLE)
 		LIBRARY DESTINATION lib
 		ARCHIVE DESTINATION lib
 	)
-	install(FILES tinysplinecpp.h
-		DESTINATION include
-	)
 	target_include_directories(tinysplinecpp_static
 		PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
 	)
+	endif()
+	install(FILES tinysplinecpp.h
+		DESTINATION include
+	)
 endif()
 
 
