CMakeLists.txt

changeset 89
777b2a10b835
parent 88
08ccaf26cffd
child 92
39947c46ed17
--- a/CMakeLists.txt	Thu Jul 23 01:52:04 2015 +0300
+++ b/CMakeLists.txt	Thu Jul 23 02:15:21 2015 +0300
@@ -57,16 +57,27 @@
 	add_definitions ("-D_CRT_SEURE_NO_WARNINGS")
 	target_link_libraries (${TARGET_NAME} wsock32 ws2_32)
 
-	if (PDCURSES_WIN32A_PATH)
-		include_directories (${PDCURSES_WIN32A_PATH}/include)
+	if (PDCURSES_PATH OR PDCURSES_WIN32A_PATH)
+		if (NOT PDCURSES_PATH)
+			set (PDCURSES_PATH "${PDCURSES_WIN32A_PATH}")
+			add_definitions (-DHAVE_PDCURSES_WIN32A)
+		endif()
+
+		include_directories (${PDCURSES_PATH}/include)
 
 		if (MINGW)
-			target_link_libraries (${TARGET_NAME} ${PDCURSES_WIN32A_PATH}/lib/pdcurses.a)
+			target_link_libraries (${TARGET_NAME} ${PDCURSES_PATH}/lib/pdcurses.a)
 		else()
-			target_link_libraries (${TARGET_NAME} ${PDCURSES_WIN32A_PATH}/lib/pdcurses.lib)
+			target_link_libraries (${TARGET_NAME} ${PDCURSES_PATH}/lib/pdcurses.lib)
 		endif()
 	else()
-		message (SEND_ERROR "Must give PDCURSES_WIN32A_PATH on Windows")
+		message (SEND_ERROR "Must provide PDCURSES_PATH or PDCURSES_WIN32A_PATH on Windows")
+
+		if (MINGW)
+			message (SEND_ERROR "This path must contain pdcurses.a in lib/, and curses.h in include/.")
+		else()
+			message (SEND_ERROR "This path must contain pdcurses.lib in lib/, and curses.h in include/.")
+		endif()
 	endif()
 else()
 	include_directories (${CURSES_INCUDE_DIRS}) # sic

mercurial