summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenton Woods <denton.woods@gmail.com>2017-02-26 15:50:28 -0600
committerGitHub <noreply@github.com>2017-02-26 15:50:28 -0600
commitcba359b0c5861557ea15303ffb03b124ca1fd514 (patch)
treedd974b331afe679dcaf25233bbf288f136ca1d8f
parent2508df57950039b1434d25d5c83efa6af4cc2ee5 (diff)
parent773ef6f0cd10069298f4497fa260d2f04351de8c (diff)
downloaddevil-cba359b0c5861557ea15303ffb03b124ca1fd514.tar.gz
Merge pull request #55 from Alexpux/master
Different build fixes
-rw-r--r--DevIL/include/IL/il.h1
-rw-r--r--DevIL/src-IL/CMakeLists.txt6
-rw-r--r--DevIL/src-IL/cmake/FindOpenEXR.cmake1
-rw-r--r--DevIL/src-ILUT/CMakeLists.txt24
-rw-r--r--DevIL/src-ILUT/src/ilut_win32.cpp6
5 files changed, 31 insertions, 7 deletions
diff --git a/DevIL/include/IL/il.h b/DevIL/include/IL/il.h
index d3bf65db..6aacb3bb 100644
--- a/DevIL/include/IL/il.h
+++ b/DevIL/include/IL/il.h
@@ -625,6 +625,7 @@ ILAPI void ILAPIENTRY ilShutDown(void);
ILAPI ILboolean ILAPIENTRY ilSurfaceToDxtcData(ILenum Format);
ILAPI ILboolean ILAPIENTRY ilTexImage(ILuint Width, ILuint Height, ILuint Depth, ILubyte NumChannels, ILenum Format, ILenum Type, void *Data);
ILAPI ILboolean ILAPIENTRY ilTexImageDxtc(ILint w, ILint h, ILint d, ILenum DxtFormat, const ILubyte* data);
+ILAPI ILboolean ILAPIENTRY ilTexImageSurface(ILuint Width, ILuint Height, ILuint Depth, ILubyte NumChannels, ILenum Format, ILenum Type, void *Data);
ILAPI ILenum ILAPIENTRY ilTypeFromExt(ILconst_string FileName);
ILAPI ILboolean ILAPIENTRY ilTypeFunc(ILenum Mode);
ILAPI ILboolean ILAPIENTRY ilLoadData(ILconst_string FileName, ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp);
diff --git a/DevIL/src-IL/CMakeLists.txt b/DevIL/src-IL/CMakeLists.txt
index 2547a81b..3cda85cf 100644
--- a/DevIL/src-IL/CMakeLists.txt
+++ b/DevIL/src-IL/CMakeLists.txt
@@ -219,11 +219,11 @@ set_target_properties(IL PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${LIBDIR})
set_target_properties(IL PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${LIBDIR})
set_target_properties(IL PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${LIBDIR})
-if(WIN32)
+if(MSVC)
# Linux uses libIL.so, libILU.so, and libILUT.so, but Windows uses
# DevIL.dll, ILU.dll, and ILUT.dll.
set_target_properties(IL PROPERTIES OUTPUT_NAME "DevIL")
-endif(WIN32)
+endif(MSVC)
if(UNICODE)
MESSAGE("DevIL, Compiling IL Unicode")
@@ -266,7 +266,7 @@ if(NOT IL_NO_LCMS)
endif(NOT IL_NO_LCMS)
if(NOT IL_NO_EXR)
- list(APPEND incs ${OPENEXR_INCLUDE_DIRS} )
+ list(APPEND incs ${OPENEXR_INCLUDE_DIR} )
list(APPEND libs ${OPENEXR_LIBRARIES} )
endif(NOT IL_NO_EXR)
diff --git a/DevIL/src-IL/cmake/FindOpenEXR.cmake b/DevIL/src-IL/cmake/FindOpenEXR.cmake
index 3718d989..2525d2dd 100644
--- a/DevIL/src-IL/cmake/FindOpenEXR.cmake
+++ b/DevIL/src-IL/cmake/FindOpenEXR.cmake
@@ -11,6 +11,7 @@
FIND_PATH(OPENEXR_INCLUDE_DIR ImfIO.h
+ $ENV{OPENEXR_DIR}/include/OpenEXR
$ENV{OPENEXR_DIR}/include
$ENV{OPENEXR_DIR}
~/Library/Frameworks
diff --git a/DevIL/src-ILUT/CMakeLists.txt b/DevIL/src-ILUT/CMakeLists.txt
index 296f9955..63662bc6 100644
--- a/DevIL/src-ILUT/CMakeLists.txt
+++ b/DevIL/src-ILUT/CMakeLists.txt
@@ -20,6 +20,24 @@ endif( CMAKE_SIZEOF_VOID_P EQUAL 8 )
include_directories( include ../include )
+# Find glut
+find_package(GLUT REQUIRED)
+include_directories(${GLUT_INCLUDE_DIRS})
+link_directories(${GLUT_LIBRARY_DIRS})
+add_definitions(${GLUT_DEFINITIONS})
+if(NOT GLUT_FOUND)
+ message(ERROR " GLUT not found!")
+endif(NOT GLUT_FOUND)
+
+# Find opengl
+find_package(OpenGL REQUIRED)
+include_directories(${OpenGL_INCLUDE_DIRS})
+link_directories(${OpenGL_LIBRARY_DIRS})
+add_definitions(${OpenGL_DEFINITIONS})
+if(NOT OPENGL_FOUND)
+ message(ERROR " OPENGL not found!")
+endif(NOT OPENGL_FOUND)
+
# for windows add the .def and .rc files to the source list
if(WIN32)
add_definitions(-DALLEGRO_MSVC)
@@ -32,7 +50,9 @@ if(WIN32)
else(UNICODE)
set(ILUT_RSRC ${ILUT_RSRC} "msvc/resources/IL Logo.ico" "msvc/ILUT.rc")
endif(UNICODE)
- set(CMAKE_C_FLAGS_RELEASE "/MT /O2")
+ if(MSVC)
+ set(CMAKE_C_FLAGS_RELEASE "/MT /O2")
+ endif(MSVC)
else(BUILD_SHARED_LIBS)
add_definitions(-DIL_STATIC_LIB)
endif(BUILD_SHARED_LIBS)
@@ -50,6 +70,8 @@ set_target_properties(ILUT PROPERTIES SOVERSION 1)
target_link_libraries(ILUT
IL
ILU
+ ${OPENGL_LIBRARIES}
+ ${GLUT_LIBRARY}
)
# generate pkg-config file
diff --git a/DevIL/src-ILUT/src/ilut_win32.cpp b/DevIL/src-ILUT/src/ilut_win32.cpp
index 69ace517..110de391 100644
--- a/DevIL/src-ILUT/src/ilut_win32.cpp
+++ b/DevIL/src-ILUT/src/ilut_win32.cpp
@@ -761,10 +761,10 @@ ILboolean ILAPIENTRY ilutLoadResource(HINSTANCE hInst, ILint ID, ILstring Resour
}
-#if !defined(_WIN32_WCE) && !(defined(_WIN32) && defined(__GNUC__))
-#define BUFFSIZE 8192 // Change to suit the efficiency.
ILboolean ILAPIENTRY ilutWinLoadUrl(ILstring Url)
{
+#if !defined(_WIN32_WCE) && !(defined(_WIN32) && defined(__GNUC__))
+#define BUFFSIZE 8192 // Change to suit the efficiency.
HINTERNET Handle, UrlHandle;
DWORD BytesRead = 0, Context = 1;
ILubyte Buff[BUFFSIZE], *Buffer, *TempBuff;
@@ -847,10 +847,10 @@ ILboolean ILAPIENTRY ilutWinLoadUrl(ILstring Url)
}
ifree(Buffer);
+#endif
return IL_TRUE;
}
-#endif
#endif//ILUT_USE_WIN32