Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 41 additions & 2 deletions DevIL/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,48 @@ project(ImageLib)
# include our custom modules
set (CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules")


# From http://stackoverflow.com/questions/17317350/compiling-32-and-64-bit
if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
MESSAGE( "DevIL, 64 bit compiler detected" )
SET( EX_PLATFORM 64 )
SET( EX_PLATFORM_NAME "x64" )
else( CMAKE_SIZEOF_VOID_P EQUAL 8 )
MESSAGE( "DevIL, 32 bit compiler detected" )
SET( EX_PLATFORM 32 )
SET( EX_PLATFORM_NAME "x86" )
endif( CMAKE_SIZEOF_VOID_P EQUAL 8 )

# Sets the output folders
set(LIBDIR "../lib/")
set(LIBDIR "${LIBDIR}${EX_PLATFORM_NAME}")
if(UNICODE)
set(LIBDIR "${LIBDIR}/unicode")
endif(UNICODE)

set(IL_RUNTIME_DIR ${LIBDIR} CACHE PATH "Output location for Devil .dlls/.so")
set(IL_LIBRARY_DIR ${LIBDIR} CACHE PATH "Output location for Devil .libs")
# Sets the output folders
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${IL_RUNTIME_DIR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${IL_LIBRARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${IL_LIBRARY_DIR})

add_subdirectory(src-IL)
add_subdirectory(src-ILU)
add_subdirectory(src-ILUT)

option(IL_BUILD_ILU "build ILU library" ON)
if (IL_BUILD_ILU)
add_subdirectory(src-ILU)
endif()

option(IL_BUILD_ILUT "build ILUT library" ON)
#Could avoid this extra check with CMakeDependentOption
#But that would require bumping cmake version to 3.1
if (IL_BUILD_ILUT AND (NOT IL_BUILD_ILU))
message(FATAL_ERROR "Can't build ILUT without ILU. Enable IL_BUILD_ILU")
elseif(IL_BUILD_ILUT)
add_subdirectory(src-ILUT)
endif()

option(IL_TESTS "build DevIL tests" ON)
if (IL_TESTS)
ENABLE_TESTING()
Expand Down
19 changes: 0 additions & 19 deletions DevIL/src-IL/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,6 @@ file(GLOB DevIL_INC include/*.h ../include/config.h ../include/IL/devil_internal
file(GLOB DevIL_RSRC)
file(GLOB DevIL_TXT)

# From http://stackoverflow.com/questions/17317350/compiling-32-and-64-bit
if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
MESSAGE( "DevIL, 64 bit compiler detected" )
SET( EX_PLATFORM 64 )
SET( EX_PLATFORM_NAME "x64" )
else( CMAKE_SIZEOF_VOID_P EQUAL 8 )
MESSAGE( "DevIL, 32 bit compiler detected" )
SET( EX_PLATFORM 32 )
SET( EX_PLATFORM_NAME "x86" )
endif( CMAKE_SIZEOF_VOID_P EQUAL 8 )

include_directories( include ../include )

Expand Down Expand Up @@ -209,15 +199,6 @@ if(NOT ${IL_SQUISH_LIB})
endif(LIBSQUISH_FOUND)
endif(NOT ${IL_SQUISH_LIB})

# Sets the output folders
set(LIBDIR "../lib/")
set(LIBDIR "${LIBDIR}${EX_PLATFORM_NAME}")
if(UNICODE)
set(LIBDIR "${LIBDIR}/unicode")
endif(UNICODE)
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(MSVC)
# Linux uses libIL.so, libILU.so, and libILUT.so, but Windows uses
Expand Down
22 changes: 0 additions & 22 deletions DevIL/src-ILU/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,6 @@ file(GLOB ILU_SRCS src/*.cpp)
file(GLOB ILU_INC include/*.h ../include/IL/devil_internal_exports.h ../include/IL/ilu.h)
file(GLOB ILU_RSRC)

# From http://stackoverflow.com/questions/17317350/compiling-32-and-64-bit
MESSAGE(" ")
if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
MESSAGE( "64 bit compiler detected" )
SET( EX_PLATFORM 64 )
SET( EX_PLATFORM_NAME "x64" )
else( CMAKE_SIZEOF_VOID_P EQUAL 8 )
MESSAGE( "32 bit compiler detected" )
SET( EX_PLATFORM 32 )
SET( EX_PLATFORM_NAME "x86" )
endif( CMAKE_SIZEOF_VOID_P EQUAL 8 )

include_directories( include ../include )

# for windows add the .def and .rc files to the source list
Expand Down Expand Up @@ -58,16 +46,6 @@ target_link_libraries(ILU
configure_file( pkgconfig/ILU.pc.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/ILU.pc @ONLY)

# Sets the output folders
set(LIBDIR "../lib/")
set(LIBDIR "${LIBDIR}${EX_PLATFORM_NAME}")
if(UNICODE)
set(LIBDIR "${LIBDIR}/unicode")
endif(UNICODE)
set_target_properties(ILU PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${LIBDIR})
set_target_properties(ILU PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${LIBDIR})
set_target_properties(ILU PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${LIBDIR})

if(UNICODE)
MESSAGE("Compiling ILU Unicode")
add_definitions(-DUNICODE -D_UNICODE)
Expand Down
21 changes: 0 additions & 21 deletions DevIL/src-ILUT/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,6 @@ file(GLOB ILUT_SRCS src/*.cpp)
file(GLOB ILUT_INC include/*.h ../include/IL/devil_internal_exports.h ../include/IL/ilut.h)
file(GLOB ILUT_RSRC)

# From http://stackoverflow.com/questions/17317350/compiling-32-and-64-bit
MESSAGE(" ")
if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
MESSAGE( "64 bit compiler detected" )
SET( EX_PLATFORM 64 )
SET( EX_PLATFORM_NAME "x64" )
else( CMAKE_SIZEOF_VOID_P EQUAL 8 )
MESSAGE( "32 bit compiler detected" )
SET( EX_PLATFORM 32 )
SET( EX_PLATFORM_NAME "x86" )
endif( CMAKE_SIZEOF_VOID_P EQUAL 8 )

include_directories( include ../include )

# Find glut
Expand Down Expand Up @@ -78,15 +66,6 @@ target_link_libraries(ILUT
configure_file( pkgconfig/ILUT.pc.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/ILUT.pc @ONLY)

# Sets the output folders
set(LIBDIR "../lib/")
set(LIBDIR "${LIBDIR}${EX_PLATFORM_NAME}")
if(UNICODE)
set(LIBDIR "${LIBDIR}/unicode")
endif(UNICODE)
set_target_properties(ILUT PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${LIBDIR})
set_target_properties(ILUT PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${LIBDIR})
set_target_properties(ILUT PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${LIBDIR})

if(UNICODE)
MESSAGE("Compiling ILUT Unicode")
Expand Down