--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,18 +12,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-cmake_minimum_required(VERSION 2.8.9)
+cmake_minimum_required(VERSION 3.1)
 project(EtcTest)
 
 set (CMAKE_CXX_STANDARD 11)
-IF (APPLE)
-	set (CMAKE_CXX_FLAGS "-I/usr/include/i386-linux-gnu/c++/4.8 -I/usr/include/c++/4.8 -std=c++11 -g3 -Wall -O3")
-ELSE ()
-	IF (WIN32)
-		set (CMAKE_CXX_FLAGS "-I/usr/include/i386-linux-gnu/c++/4.8 -I/usr/include/c++/4.8 -W4 /EHsc")
-	ELSE()
-		set (CMAKE_CXX_FLAGS "-I/usr/include/i386-linux-gnu/c++/4.8 -I/usr/include/c++/4.8 -std=c++11 -pthread -g3 -Wall -O2")
-	ENDIF()
-ENDIF ()
 ADD_SUBDIRECTORY(EtcLib)
-ADD_SUBDIRECTORY(EtcTool)
--- a/EtcLib/CMakeLists.txt
+++ b/EtcLib/CMakeLists.txt
@@ -22,3 +22,9 @@ file(GLOB SOURCES
 	${PROJECT_SOURCE_DIR}/Etc/*.cpp
 	${PROJECT_SOURCE_DIR}/EtcCodec/*.cpp)
 ADD_LIBRARY(EtcLib ${SOURCES})
+set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
+set(THREADS_PREFER_PTHREAD_FLAG TRUE)
+find_package(Threads REQUIRED)
+if(CMAKE_USE_PTHREADS_INIT)
+  target_link_libraries(EtcLib PRIVATE Threads::Threads)
+endif()
