CMakeLists.txt

changeset 81
a18aaf460648
parent 76
6de6d9a64ebd
child 83
08bfc3d9d2ae
--- a/CMakeLists.txt	Fri May 15 21:43:21 2015 +0300
+++ b/CMakeLists.txt	Tue May 26 11:41:58 2015 +0300
@@ -1,4 +1,5 @@
 cmake_minimum_required (VERSION 2.4)
+cmake_policy (SET CMP0003 NEW)
 project (zfc9000)
 
 add_library (huffman STATIC
@@ -24,12 +25,26 @@
 
 set (CURSES_NEED_NCURSES, True)
 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -W -Wall")
-find_package (Curses)
+
+if (NOT WIN32)
+	find_package (Curses)
+endif()
+
+if (MINGW)
+	set (CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++ -static")
+endif()
+
 include_directories (${CURSES_INCUDE_DIRS})
 include_directories (${CMAKE_CURRENT_BINARY_DIR})
 include_directories (huffman)
 add_executable (${PROJECT_NAME} ${SOURCE_FILES})
-target_link_libraries (${PROJECT_NAME} ${CURSES_LIBRARIES} huffman)
+target_link_libraries (${PROJECT_NAME} huffman)
+
+if (NOT WIN32)
+	target_link_libraries (${PROJECT_NAME} ${CURSES_LIBRARIES})
+else()
+	target_link_libraries (${PROJECT_NAME} ${CMAKE_CURRENT_BINARY_DIR}/pdcurses.a wsock32 ws2_32)
+endif()
 
 add_custom_target (make_hginfo_h
 	COMMAND python

mercurial