-
Notifications
You must be signed in to change notification settings - Fork 147
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
54 lines (44 loc) · 1.59 KB
/
Copy pathCMakeLists.txt
File metadata and controls
54 lines (44 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
cmake_minimum_required(VERSION 2.6)
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)
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()
Add_Subdirectory(test)
endif()