Commits

Anonymous committed c7610d0

- fix test for the build type
- add profile options
- don't try to find pthread on windows

Comments (0)

Files changed (1)

 endif(BUILD_TEST)
 
 if (NOT WIN32)
-	STRING(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_TOLOWER)
-	IF (CMAKE_BUILD_TYPE_TOLOWER MATCHES debug)
-		set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -O0")
-	ENDIF (CMAKE_BUILD_TYPE_TOLOWER MATCHES debug)
+	if(DEFINED CMAKE_BUILD_TYPE)
+		STRING(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_TOLOWER)
+		IF (CMAKE_BUILD_TYPE_TOLOWER MATCHES debug)
+			set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -O0")
+		ENDIF (CMAKE_BUILD_TYPE_TOLOWER MATCHES debug)
+	endif(DEFINED CMAKE_BUILD_TYPE)
 endif (NOT WIN32)
 
 if (USE_EXT_GD)
 
 	FIND_PACKAGE(ZLIB)
 
+	IF (NOT WIN32)
+		FIND_PACKAGE(PTHREAD)
+	ENDIF (NOT WIN32)
+
+	FIND_PACKAGE(Freetype)
+	FIND_PACKAGE(XPM)
+
 	if (ENABLE_JPEG)
 		FIND_PACKAGE(JPEG)
 	endif (ENABLE_JPEG)
 		FIND_PACKAGE(Fontconfig)
 	endif (ENABLE_FONTCONFIG)
 
-
-
 	if (FREETYPE_FOUND)
 		INCLUDE_DIRECTORIES(${FREETYPE_INCLUDE_DIR})
 		SET(HAVE_FT2BUILD_H 1)
 		SET(GD_LIB gd)
 	endif (WIN32)
 
+	IF(PROFILE)
+		add_definitions("-pg")
+		set(CMAKE_EXE_LINKER_FLAGS ${LINK_FLAGS} "-pg")
+	ENDIF(PROFILE)
+
 	SET(GD_INCLUDE_DIR "${GD_SOURCE_DIR}/src" "${GD_SOURCE_DIR}")
 	INCLUDE_DIRECTORIES(before ${FONTCONFIG_INCLUDE_DIR})