CMakeLists.txt
author Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
Sun, 16 May 2010 15:41:05 -0500
changeset 275 97b303e79826
parent 274 b10562c14db0
permissions -rw-r--r--
Removing plain makefiles -- Deprecated in favor of CMake generated makefiles, which now work on all major platforms
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
103
e58c73e8c0f1 Quickly created CMake to build the source
Harley Laue <losinggeneration@gmail.com>
parents:
diff changeset
     1
project(lugaru)
e58c73e8c0f1 Quickly created CMake to build the source
Harley Laue <losinggeneration@gmail.com>
parents:
diff changeset
     2
e58c73e8c0f1 Quickly created CMake to build the source
Harley Laue <losinggeneration@gmail.com>
parents:
diff changeset
     3
cmake_minimum_required(VERSION 2.6)
e58c73e8c0f1 Quickly created CMake to build the source
Harley Laue <losinggeneration@gmail.com>
parents:
diff changeset
     4
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
     5
set(SRCDIR "${CMAKE_CURRENT_SOURCE_DIR}/Source")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
     6
set(DEPDIR "${CMAKE_CURRENT_SOURCE_DIR}/Dependencies")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
     7
203
f0d0a6ab22c4 Fixed CMake detection of internal libs
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 199
diff changeset
     8
if(NOT CMAKE_BUILD_TYPE)
f0d0a6ab22c4 Fixed CMake detection of internal libs
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 199
diff changeset
     9
  set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
f0d0a6ab22c4 Fixed CMake detection of internal libs
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 199
diff changeset
    10
      "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel"
f0d0a6ab22c4 Fixed CMake detection of internal libs
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 199
diff changeset
    11
      FORCE)
108
5c75adc4301e Added support for 'make install' target in CMake scripts
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 106
diff changeset
    12
endif(NOT CMAKE_BUILD_TYPE)
5c75adc4301e Added support for 'make install' target in CMake scripts
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 106
diff changeset
    13
5c75adc4301e Added support for 'make install' target in CMake scripts
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 106
diff changeset
    14
if(NOT LUGARU_INSTALL_PREFIX)
5c75adc4301e Added support for 'make install' target in CMake scripts
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 106
diff changeset
    15
  if(WIN32)
194
9011bad18a44 Fixed error in handling Lugaru's default Windows install prefix
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 192
diff changeset
    16
     set(LUGARU_INSTALL_PREFIX "C:/Lugaru" CACHE PATH
108
5c75adc4301e Added support for 'make install' target in CMake scripts
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 106
diff changeset
    17
     "LUGARU_INSTALL_PREFIX: Install path prefix, prepended onto install directories."
5c75adc4301e Added support for 'make install' target in CMake scripts
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 106
diff changeset
    18
      FORCE)
5c75adc4301e Added support for 'make install' target in CMake scripts
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 106
diff changeset
    19
  else(WIN32)
194
9011bad18a44 Fixed error in handling Lugaru's default Windows install prefix
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 192
diff changeset
    20
     set(LUGARU_INSTALL_PREFIX "/usr/local/lugaru" CACHE PATH
108
5c75adc4301e Added support for 'make install' target in CMake scripts
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 106
diff changeset
    21
     "CMAKE_INSTALL_PREFIX: Install path prefix, prepended onto install directories."
5c75adc4301e Added support for 'make install' target in CMake scripts
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 106
diff changeset
    22
      FORCE)
5c75adc4301e Added support for 'make install' target in CMake scripts
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 106
diff changeset
    23
  endif(WIN32)
5c75adc4301e Added support for 'make install' target in CMake scripts
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 106
diff changeset
    24
endif(NOT LUGARU_INSTALL_PREFIX)
5c75adc4301e Added support for 'make install' target in CMake scripts
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 106
diff changeset
    25
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    26
set(CMAKE_INSTALL_PREFIX "${LUGARU_INSTALL_PREFIX}" CACHE INTERNAL "Prefix prepended to install directories" FORCE)
108
5c75adc4301e Added support for 'make install' target in CMake scripts
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 106
diff changeset
    27
229
2a456fb60968 Fixed conditional with configuring OpenGL to only activate with MinGW
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 227
diff changeset
    28
if(MINGW)
129
068873e48367 Fixed Windows conditionals for building resources and OpenGL library linkage in CMake scripts; Switching to default branch
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 119
diff changeset
    29
	set(OPENGL_gl_LIBRARY "-lopengl32" CACHE STRING "OpenGL library for Win32" FORCE)
068873e48367 Fixed Windows conditionals for building resources and OpenGL library linkage in CMake scripts; Switching to default branch
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 119
diff changeset
    30
	set(OPENGL_glu_LIBRARY "-lglu32" CACHE STRING "GLU library for Win32" FORCE)
229
2a456fb60968 Fixed conditional with configuring OpenGL to only activate with MinGW
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 227
diff changeset
    31
endif(MINGW)
108
5c75adc4301e Added support for 'make install' target in CMake scripts
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 106
diff changeset
    32
265
fb5be83391cc Made massive change to CMake scripts. Hopefully now CMake scripts will produce working Mac OS X Application bundles in the install step.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 264
diff changeset
    33
if(APPLE)
274
b10562c14db0 Turn on x86_64 building by default in CMake scripts for OSX
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 271
diff changeset
    34
	set(CMAKE_OSX_ARCHITECTURES "i386;x86_64;ppc" CACHE STRING "Build architectures for OSX")
265
fb5be83391cc Made massive change to CMake scripts. Hopefully now CMake scripts will produce working Mac OS X Application bundles in the install step.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 264
diff changeset
    35
	set(CMAKE_OSX_DEPLOYMENT_TARGET "10.5" CACHE STRING 
268
a55b16cc4ff9 Took off some FORCE markers to allow configuration on OSX
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 265
diff changeset
    36
		"Minimum OS X version to target for deployment (at runtime); newer APIs weak linked. Set to empty string for default value")
265
fb5be83391cc Made massive change to CMake scripts. Hopefully now CMake scripts will produce working Mac OS X Application bundles in the install step.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 264
diff changeset
    37
	set(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.5.sdk" CACHE PATH 
268
a55b16cc4ff9 Took off some FORCE markers to allow configuration on OSX
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 265
diff changeset
    38
		"The product will be built against the headers and libraries located inside the indicated SDK.")
a55b16cc4ff9 Took off some FORCE markers to allow configuration on OSX
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 265
diff changeset
    39
endif(APPLE)
a55b16cc4ff9 Took off some FORCE markers to allow configuration on OSX
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 265
diff changeset
    40
a55b16cc4ff9 Took off some FORCE markers to allow configuration on OSX
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 265
diff changeset
    41
if(APPLE)
a55b16cc4ff9 Took off some FORCE markers to allow configuration on OSX
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 265
diff changeset
    42
	# Save our sanity; Set all available libraries to internal by default
a55b16cc4ff9 Took off some FORCE markers to allow configuration on OSX
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 265
diff changeset
    43
	set(LUGARU_FORCE_INTERNAL_SDL True)
a55b16cc4ff9 Took off some FORCE markers to allow configuration on OSX
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 265
diff changeset
    44
	set(LUGARU_FORCE_INTERNAL_GLU True)
a55b16cc4ff9 Took off some FORCE markers to allow configuration on OSX
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 265
diff changeset
    45
	set(LUGARU_FORCE_INTERNAL_JPEG True)
a55b16cc4ff9 Took off some FORCE markers to allow configuration on OSX
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 265
diff changeset
    46
	set(LUGARU_FORCE_INTERNAL_PNG True)
a55b16cc4ff9 Took off some FORCE markers to allow configuration on OSX
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 265
diff changeset
    47
	set(LUGARU_FORCE_INTERNAL_VORBIS True)
a55b16cc4ff9 Took off some FORCE markers to allow configuration on OSX
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 265
diff changeset
    48
	set(LUGARU_FORCE_INTERNAL_ZLIB True)
265
fb5be83391cc Made massive change to CMake scripts. Hopefully now CMake scripts will produce working Mac OS X Application bundles in the install step.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 264
diff changeset
    49
endif(APPLE)
fb5be83391cc Made massive change to CMake scripts. Hopefully now CMake scripts will produce working Mac OS X Application bundles in the install step.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 264
diff changeset
    50
106
e9183cfb697e Added in support for the CMake module for searching for and configuring to use libvorbisfile and libogg
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 103
diff changeset
    51
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    52
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    53
set(LUGARU_SRCS
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    54
	${SRCDIR}/Frustum.cpp
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    55
	${SRCDIR}/GameDraw.cpp
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    56
	${SRCDIR}/GameInitDispose.cpp
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    57
	${SRCDIR}/GameTick.cpp
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    58
	${SRCDIR}/Globals.cpp
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    59
	${SRCDIR}/Lights.cpp
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    60
	${SRCDIR}/Models.cpp
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    61
	${SRCDIR}/Objects.cpp
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    62
	${SRCDIR}/pack.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    63
	${SRCDIR}/pack_private.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    64
	${SRCDIR}/Person.cpp
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    65
	${SRCDIR}/private.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    66
	${SRCDIR}/Quaternions.cpp
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    67
	${SRCDIR}/Random.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    68
	${SRCDIR}/Skeleton.cpp
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    69
	${SRCDIR}/Skybox.cpp
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    70
	${SRCDIR}/Sprites.cpp
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    71
	${SRCDIR}/Terrain.cpp
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    72
	${SRCDIR}/Text.cpp
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    73
	${SRCDIR}/TGALoader.cpp
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    74
	${SRCDIR}/unpack.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    75
	${SRCDIR}/unpack_private.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    76
	${SRCDIR}/Weapons.cpp
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    77
	${SRCDIR}/OpenGL_Windows.cpp
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    78
	${SRCDIR}/openal_wrapper.cpp
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    79
	${SRCDIR}/WinInput.cpp
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    80
)
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    81
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    82
set(LUGARU_H
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    83
	${SRCDIR}/Constants.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    84
	${SRCDIR}/Frustum.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    85
	${SRCDIR}/Game.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    86
	${SRCDIR}/Lights.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    87
	${SRCDIR}/LinkedList.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    88
	${SRCDIR}/Models.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    89
	${SRCDIR}/Objects.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    90
	${SRCDIR}/Person.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    91
	${SRCDIR}/PhysicsMath.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    92
	${SRCDIR}/Pointer.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    93
	${SRCDIR}/Quaternions.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    94
	${SRCDIR}/Random.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    95
	${SRCDIR}/Skeleton.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    96
	${SRCDIR}/Skybox.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    97
	${SRCDIR}/Sprites.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    98
	${SRCDIR}/TGALoader.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    99
	${SRCDIR}/Terrain.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   100
	${SRCDIR}/Text.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   101
	${SRCDIR}/Weapons.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   102
	${SRCDIR}/WinInput.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   103
	${SRCDIR}/alstubs.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   104
	${SRCDIR}/binio.h
189
8f78a01a216f Forgot to update CMake... again...
Harley Laue <losinggeneration@gmail.com>
parents: 185
diff changeset
   105
	${SRCDIR}/openal_wrapper.h
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   106
	${SRCDIR}/gamegl.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   107
	${SRCDIR}/glstubs.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   108
	${SRCDIR}/mmgr.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   109
	${SRCDIR}/nommgr.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   110
	${SRCDIR}/pack_private.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   111
	${SRCDIR}/private.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   112
	${SRCDIR}/unpack_private.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   113
)
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   114
258
2eb9569dd401 Don't force GL headers if the user doesn't want that
Harley Laue <losinggeneration@gmail.com>
parents: 236
diff changeset
   115
if(UNIX)
2eb9569dd401 Don't force GL headers if the user doesn't want that
Harley Laue <losinggeneration@gmail.com>
parents: 236
diff changeset
   116
	set(LUGARU_SRCS
2eb9569dd401 Don't force GL headers if the user doesn't want that
Harley Laue <losinggeneration@gmail.com>
parents: 236
diff changeset
   117
		${LUGARU_SRCS}
2eb9569dd401 Don't force GL headers if the user doesn't want that
Harley Laue <losinggeneration@gmail.com>
parents: 236
diff changeset
   118
		${SRCDIR}/MacCompatibility.cpp
2eb9569dd401 Don't force GL headers if the user doesn't want that
Harley Laue <losinggeneration@gmail.com>
parents: 236
diff changeset
   119
	)
2eb9569dd401 Don't force GL headers if the user doesn't want that
Harley Laue <losinggeneration@gmail.com>
parents: 236
diff changeset
   120
	set(LUGARU_H
2eb9569dd401 Don't force GL headers if the user doesn't want that
Harley Laue <losinggeneration@gmail.com>
parents: 236
diff changeset
   121
		${LUGARU_H}
2eb9569dd401 Don't force GL headers if the user doesn't want that
Harley Laue <losinggeneration@gmail.com>
parents: 236
diff changeset
   122
		${SRCDIR}/MacCompatibility.h
2eb9569dd401 Don't force GL headers if the user doesn't want that
Harley Laue <losinggeneration@gmail.com>
parents: 236
diff changeset
   123
	)
2eb9569dd401 Don't force GL headers if the user doesn't want that
Harley Laue <losinggeneration@gmail.com>
parents: 236
diff changeset
   124
endif(UNIX)
2eb9569dd401 Don't force GL headers if the user doesn't want that
Harley Laue <losinggeneration@gmail.com>
parents: 236
diff changeset
   125
2eb9569dd401 Don't force GL headers if the user doesn't want that
Harley Laue <losinggeneration@gmail.com>
parents: 236
diff changeset
   126
if(MSVC) # MSVC non-C99 support biting us hard
2eb9569dd401 Don't force GL headers if the user doesn't want that
Harley Laue <losinggeneration@gmail.com>
parents: 236
diff changeset
   127
	set(LUGARU_H
2eb9569dd401 Don't force GL headers if the user doesn't want that
Harley Laue <losinggeneration@gmail.com>
parents: 236
diff changeset
   128
		${LUGARU_H}
2eb9569dd401 Don't force GL headers if the user doesn't want that
Harley Laue <losinggeneration@gmail.com>
parents: 236
diff changeset
   129
		${DEPDIR}/msinttypes/stdint.h
2eb9569dd401 Don't force GL headers if the user doesn't want that
Harley Laue <losinggeneration@gmail.com>
parents: 236
diff changeset
   130
		${DEPDIR}/msinttypes/inttypes.h
2eb9569dd401 Don't force GL headers if the user doesn't want that
Harley Laue <losinggeneration@gmail.com>
parents: 236
diff changeset
   131
	)
2eb9569dd401 Don't force GL headers if the user doesn't want that
Harley Laue <losinggeneration@gmail.com>
parents: 236
diff changeset
   132
endif(MSVC)
2eb9569dd401 Don't force GL headers if the user doesn't want that
Harley Laue <losinggeneration@gmail.com>
parents: 236
diff changeset
   133
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   134
if(WIN32)
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   135
  if(CMAKE_CROSSCOMPILING)
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   136
    ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lugaru_resource.obj
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   137
						  COMMAND i686-pc-mingw32-windres
265
fb5be83391cc Made massive change to CMake scripts. Hopefully now CMake scripts will produce working Mac OS X Application bundles in the install step.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 264
diff changeset
   138
							  -I${SRCDIR}/win-res
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   139
							  -o ${CMAKE_CURRENT_BINARY_DIR}/lugaru_resource.obj
265
fb5be83391cc Made massive change to CMake scripts. Hopefully now CMake scripts will produce working Mac OS X Application bundles in the install step.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 264
diff changeset
   140
							  -i${SRCDIR}/win-res/Lugaru.rc
fb5be83391cc Made massive change to CMake scripts. Hopefully now CMake scripts will produce working Mac OS X Application bundles in the install step.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 264
diff changeset
   141
					      DEPENDS ${SRCDIR}/win-res/Lugaru.rc
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   142
						  )
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   143
  endif(CMAKE_CROSSCOMPILING)
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   144
  if(NOT CMAKE_CROSSCOMPILING)
226
b088d858bd7a Added in support for resource compilation in MSVC; Windows support is hopefully complete from the buildsystem.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 224
diff changeset
   145
   if(MSVC)
b088d858bd7a Added in support for resource compilation in MSVC; Windows support is hopefully complete from the buildsystem.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 224
diff changeset
   146
    ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lugaru_resource.obj
b088d858bd7a Added in support for resource compilation in MSVC; Windows support is hopefully complete from the buildsystem.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 224
diff changeset
   147
						  COMMAND rc
265
fb5be83391cc Made massive change to CMake scripts. Hopefully now CMake scripts will produce working Mac OS X Application bundles in the install step.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 264
diff changeset
   148
							  -I${SRCDIR}/win-res
226
b088d858bd7a Added in support for resource compilation in MSVC; Windows support is hopefully complete from the buildsystem.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 224
diff changeset
   149
							  -fo${CMAKE_CURRENT_BINARY_DIR}/lugaru_resource.obj
265
fb5be83391cc Made massive change to CMake scripts. Hopefully now CMake scripts will produce working Mac OS X Application bundles in the install step.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 264
diff changeset
   150
							  ${SRCDIR}/win-res/Lugaru.rc
fb5be83391cc Made massive change to CMake scripts. Hopefully now CMake scripts will produce working Mac OS X Application bundles in the install step.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 264
diff changeset
   151
					      DEPENDS ${SRCDIR}/win-res/Lugaru.rc
226
b088d858bd7a Added in support for resource compilation in MSVC; Windows support is hopefully complete from the buildsystem.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 224
diff changeset
   152
						  )
b088d858bd7a Added in support for resource compilation in MSVC; Windows support is hopefully complete from the buildsystem.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 224
diff changeset
   153
   endif(MSVC)
b088d858bd7a Added in support for resource compilation in MSVC; Windows support is hopefully complete from the buildsystem.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 224
diff changeset
   154
   if(MINGW)
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   155
    ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lugaru_resource.obj
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   156
						  COMMAND windres
265
fb5be83391cc Made massive change to CMake scripts. Hopefully now CMake scripts will produce working Mac OS X Application bundles in the install step.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 264
diff changeset
   157
							  -I${SRCDIR}/win-res
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   158
							  -o ${CMAKE_CURRENT_BINARY_DIR}/lugaru_resource.obj
265
fb5be83391cc Made massive change to CMake scripts. Hopefully now CMake scripts will produce working Mac OS X Application bundles in the install step.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 264
diff changeset
   159
							  -i${SRCDIR}/win-res/Lugaru.rc
fb5be83391cc Made massive change to CMake scripts. Hopefully now CMake scripts will produce working Mac OS X Application bundles in the install step.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 264
diff changeset
   160
					      DEPENDS ${SRCDIR}/win-res/Lugaru.rc
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   161
						  )
226
b088d858bd7a Added in support for resource compilation in MSVC; Windows support is hopefully complete from the buildsystem.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 224
diff changeset
   162
   endif(MINGW)
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   163
  endif(NOT CMAKE_CROSSCOMPILING)
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   164
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   165
  # !!! FIXME: get rid of this.
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   166
  set(LUGARU_SRCS
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   167
	${LUGARU_SRCS}
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   168
	${SRCDIR}/WinDefs.cpp)
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   169
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   170
  set(LUGARU_H
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   171
	${LUGARU_H}
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   172
	${SRCDIR}/WinDefs.h
265
fb5be83391cc Made massive change to CMake scripts. Hopefully now CMake scripts will produce working Mac OS X Application bundles in the install step.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 264
diff changeset
   173
	${SRCDIR}/win-res/resource.h)
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   174
endif(WIN32)
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   175
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   176
if (APPLE)
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   177
    set(PLATFORM_LIBS "-framework Carbon -framework Cocoa -framework OpenGL -framework OpenAL")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   178
endif (APPLE)
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   179
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   180
# Deal with dependencies...
103
e58c73e8c0f1 Quickly created CMake to build the source
Harley Laue <losinggeneration@gmail.com>
parents:
diff changeset
   181
find_package(OpenGL REQUIRED)
259
39c93192fc7d Removing option to not use internal OpenGL headers on Windows; headers for all Windows compilers are not sane
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 258
diff changeset
   182
# force this include dir no matter what on Windows, so we get sane headers.
39c93192fc7d Removing option to not use internal OpenGL headers on Windows; headers for all Windows compilers are not sane
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 258
diff changeset
   183
if(NOT WIN32)
39c93192fc7d Removing option to not use internal OpenGL headers on Windows; headers for all Windows compilers are not sane
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 258
diff changeset
   184
	option (LUGARU_FORCE_INTERNAL_OPENGL "Force internal OpenGL headers, even if there's a system version" True)
39c93192fc7d Removing option to not use internal OpenGL headers on Windows; headers for all Windows compilers are not sane
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 258
diff changeset
   185
	if (LUGARU_FORCE_INTERNAL_OPENGL)
39c93192fc7d Removing option to not use internal OpenGL headers on Windows; headers for all Windows compilers are not sane
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 258
diff changeset
   186
		include_directories("${DEPDIR}/OpenGL")
39c93192fc7d Removing option to not use internal OpenGL headers on Windows; headers for all Windows compilers are not sane
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 258
diff changeset
   187
	endif (LUGARU_FORCE_INTERNAL_OPENGL)
261
67c209d05a9e Fix error on forcing inclusion of OpenGL headers on Windows
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 259
diff changeset
   188
endif(NOT WIN32)
67c209d05a9e Fix error on forcing inclusion of OpenGL headers on Windows
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 259
diff changeset
   189
67c209d05a9e Fix error on forcing inclusion of OpenGL headers on Windows
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 259
diff changeset
   190
if(WIN32)
258
2eb9569dd401 Don't force GL headers if the user doesn't want that
Harley Laue <losinggeneration@gmail.com>
parents: 236
diff changeset
   191
	include_directories("${DEPDIR}/OpenGL")
261
67c209d05a9e Fix error on forcing inclusion of OpenGL headers on Windows
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 259
diff changeset
   192
endif(WIN32)
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   193
271
84c392894e25 Added a line to enforce inclusion of C99 support headers for MSVC
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 269
diff changeset
   194
if(MSVC) # More Visual Studio annoyances
84c392894e25 Added a line to enforce inclusion of C99 support headers for MSVC
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 269
diff changeset
   195
	include_directories("${DEPDIR}/msinttypes")
84c392894e25 Added a line to enforce inclusion of C99 support headers for MSVC
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 269
diff changeset
   196
endif(MSVC)
84c392894e25 Added a line to enforce inclusion of C99 support headers for MSVC
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 269
diff changeset
   197
192
17c5df59e083 Oops, forgot to actually pre-define the OpenAL internal library configuration
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 190
diff changeset
   198
option (LUGARU_FORCE_INTERNAL_OPENAL "Force internal libOpenAL, even if there's a system version" False)
188
de6bc7071b0c Added internal OpenAL libs for MinGW on Windows; MSVC internal libs to come soon
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 185
diff changeset
   199
if (NOT LUGARU_FORCE_INTERNAL_OPENAL)
258
2eb9569dd401 Don't force GL headers if the user doesn't want that
Harley Laue <losinggeneration@gmail.com>
parents: 236
diff changeset
   200
	find_package(OpenAL REQUIRED)
197
f88b3d83e992 Fixed CMake so Force internal actually has a chance at working correctly
Harley Laue <losinggeneration@gmail.com>
parents: 190
diff changeset
   201
else(NOT LUGARU_FORCE_INTERNAL_OPENAL)
f88b3d83e992 Fixed CMake so Force internal actually has a chance at working correctly
Harley Laue <losinggeneration@gmail.com>
parents: 190
diff changeset
   202
	set(OPENAL_FOUND False)
188
de6bc7071b0c Added internal OpenAL libs for MinGW on Windows; MSVC internal libs to come soon
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 185
diff changeset
   203
endif (NOT LUGARU_FORCE_INTERNAL_OPENAL)
de6bc7071b0c Added internal OpenAL libs for MinGW on Windows; MSVC internal libs to come soon
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 185
diff changeset
   204
258
2eb9569dd401 Don't force GL headers if the user doesn't want that
Harley Laue <losinggeneration@gmail.com>
parents: 236
diff changeset
   205
if (NOT OPENAL_FOUND OR LUGARU_FORCE_INTERNAL_OPENAL)
188
de6bc7071b0c Added internal OpenAL libs for MinGW on Windows; MSVC internal libs to come soon
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 185
diff changeset
   206
    message(STATUS "Using internal copy of OpenAL")
de6bc7071b0c Added internal OpenAL libs for MinGW on Windows; MSVC internal libs to come soon
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 185
diff changeset
   207
    set(LUGARU_MISSING_DEPS "${LUGARU_MISSING_DEPS} OpenAL")
de6bc7071b0c Added internal OpenAL libs for MinGW on Windows; MSVC internal libs to come soon
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 185
diff changeset
   208
    set(OPENALDIR "${DEPDIR}/OpenAL")
de6bc7071b0c Added internal OpenAL libs for MinGW on Windows; MSVC internal libs to come soon
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 185
diff changeset
   209
    set(OPENAL_INCLUDE_DIR "${OPENALDIR}/include/AL")
de6bc7071b0c Added internal OpenAL libs for MinGW on Windows; MSVC internal libs to come soon
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 185
diff changeset
   210
    set(OPENAL_LIBRARY "")
de6bc7071b0c Added internal OpenAL libs for MinGW on Windows; MSVC internal libs to come soon
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 185
diff changeset
   211
203
f0d0a6ab22c4 Fixed CMake detection of internal libs
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 199
diff changeset
   212
    if (WIN32)
188
de6bc7071b0c Added internal OpenAL libs for MinGW on Windows; MSVC internal libs to come soon
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 185
diff changeset
   213
        set(LUGARU_HAS_INTERNAL_OPENAL True)
258
2eb9569dd401 Don't force GL headers if the user doesn't want that
Harley Laue <losinggeneration@gmail.com>
parents: 236
diff changeset
   214
        if (MSVC80)
224
1032a9cd8de0 Added in support for MSVC building for MSVC2005 and MSVC2008; Windows support is hopefully complete from the builsystem.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 218
diff changeset
   215
            set(OPENAL_LIBRARY
1032a9cd8de0 Added in support for MSVC building for MSVC2005 and MSVC2008; Windows support is hopefully complete from the builsystem.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 218
diff changeset
   216
                ${OPENALDIR}/lib/win32/msvc2005/OpenAL32.lib
1032a9cd8de0 Added in support for MSVC building for MSVC2005 and MSVC2008; Windows support is hopefully complete from the builsystem.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 218
diff changeset
   217
            )
1032a9cd8de0 Added in support for MSVC building for MSVC2005 and MSVC2008; Windows support is hopefully complete from the builsystem.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 218
diff changeset
   218
        endif (MSVC80)
258
2eb9569dd401 Don't force GL headers if the user doesn't want that
Harley Laue <losinggeneration@gmail.com>
parents: 236
diff changeset
   219
        if (MSVC90)
224
1032a9cd8de0 Added in support for MSVC building for MSVC2005 and MSVC2008; Windows support is hopefully complete from the builsystem.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 218
diff changeset
   220
            set(OPENAL_LIBRARY
1032a9cd8de0 Added in support for MSVC building for MSVC2005 and MSVC2008; Windows support is hopefully complete from the builsystem.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 218
diff changeset
   221
                ${OPENALDIR}/lib/win32/msvc2008/OpenAL32.lib
1032a9cd8de0 Added in support for MSVC building for MSVC2005 and MSVC2008; Windows support is hopefully complete from the builsystem.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 218
diff changeset
   222
            )
1032a9cd8de0 Added in support for MSVC building for MSVC2005 and MSVC2008; Windows support is hopefully complete from the builsystem.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 218
diff changeset
   223
        endif (MSVC90)
188
de6bc7071b0c Added internal OpenAL libs for MinGW on Windows; MSVC internal libs to come soon
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 185
diff changeset
   224
        if (MINGW)
de6bc7071b0c Added internal OpenAL libs for MinGW on Windows; MSVC internal libs to come soon
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 185
diff changeset
   225
            set(OPENAL_LIBRARY
de6bc7071b0c Added internal OpenAL libs for MinGW on Windows; MSVC internal libs to come soon
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 185
diff changeset
   226
                ${OPENALDIR}/lib/win32/mingw/libOpenAL32.dll.a
de6bc7071b0c Added internal OpenAL libs for MinGW on Windows; MSVC internal libs to come soon
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 185
diff changeset
   227
            )
de6bc7071b0c Added internal OpenAL libs for MinGW on Windows; MSVC internal libs to come soon
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 185
diff changeset
   228
        endif (MINGW)
203
f0d0a6ab22c4 Fixed CMake detection of internal libs
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 199
diff changeset
   229
     endif(WIN32)
188
de6bc7071b0c Added internal OpenAL libs for MinGW on Windows; MSVC internal libs to come soon
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 185
diff changeset
   230
de6bc7071b0c Added internal OpenAL libs for MinGW on Windows; MSVC internal libs to come soon
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 185
diff changeset
   231
    if (NOT LUGARU_HAS_INTERNAL_OPENAL)
de6bc7071b0c Added internal OpenAL libs for MinGW on Windows; MSVC internal libs to come soon
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 185
diff changeset
   232
        message(ERROR "We don't have a prebuilt OpenAL for this platform.")
de6bc7071b0c Added internal OpenAL libs for MinGW on Windows; MSVC internal libs to come soon
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 185
diff changeset
   233
    endif (NOT LUGARU_HAS_INTERNAL_OPENAL)
258
2eb9569dd401 Don't force GL headers if the user doesn't want that
Harley Laue <losinggeneration@gmail.com>
parents: 236
diff changeset
   234
endif (NOT OPENAL_FOUND OR LUGARU_FORCE_INTERNAL_OPENAL)
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   235
182
20ef226ace70 Fixed dependencies, made them optional (so you can override system libs).
Ryan C. Gordon <icculus@icculus.org>
parents: 180
diff changeset
   236
option (LUGARU_FORCE_INTERNAL_SDL "Force internal libSDL, even if there's a system version" False)
20ef226ace70 Fixed dependencies, made them optional (so you can override system libs).
Ryan C. Gordon <icculus@icculus.org>
parents: 180
diff changeset
   237
if (NOT LUGARU_FORCE_INTERNAL_SDL)
20ef226ace70 Fixed dependencies, made them optional (so you can override system libs).
Ryan C. Gordon <icculus@icculus.org>
parents: 180
diff changeset
   238
    find_package(SDL)
197
f88b3d83e992 Fixed CMake so Force internal actually has a chance at working correctly
Harley Laue <losinggeneration@gmail.com>
parents: 190
diff changeset
   239
else(NOT LUGARU_FORCE_INTERNAL_SDL)
f88b3d83e992 Fixed CMake so Force internal actually has a chance at working correctly
Harley Laue <losinggeneration@gmail.com>
parents: 190
diff changeset
   240
	set(SDL_FOUND False)
182
20ef226ace70 Fixed dependencies, made them optional (so you can override system libs).
Ryan C. Gordon <icculus@icculus.org>
parents: 180
diff changeset
   241
endif (NOT LUGARU_FORCE_INTERNAL_SDL)
197
f88b3d83e992 Fixed CMake so Force internal actually has a chance at working correctly
Harley Laue <losinggeneration@gmail.com>
parents: 190
diff changeset
   242
182
20ef226ace70 Fixed dependencies, made them optional (so you can override system libs).
Ryan C. Gordon <icculus@icculus.org>
parents: 180
diff changeset
   243
if (NOT SDL_FOUND)
20ef226ace70 Fixed dependencies, made them optional (so you can override system libs).
Ryan C. Gordon <icculus@icculus.org>
parents: 180
diff changeset
   244
    message(STATUS "Using internal copy of SDL")
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   245
    set(LUGARU_MISSING_DEPS "${LUGARU_MISSING_DEPS} SDL")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   246
    set(SDLDIR "${DEPDIR}/SDL12")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   247
    set(SDL_INCLUDE_DIR "${SDLDIR}/include")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   248
    set(SDL_LIBRARY "")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   249
    if (APPLE)
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   250
        set(LUGARU_HAS_INTERNAL_SDL True)
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   251
        set(SDL_LIBRARY
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   252
            ${SDLDIR}/lib/macosx/libSDL-1.2.0.dylib
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   253
            ${SDLDIR}/lib/macosx/libSDLmain-osx.a
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   254
        )
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   255
    endif (APPLE)
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   256
203
f0d0a6ab22c4 Fixed CMake detection of internal libs
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 199
diff changeset
   257
    if (WIN32)
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   258
        set(LUGARU_HAS_INTERNAL_SDL True)
224
1032a9cd8de0 Added in support for MSVC building for MSVC2005 and MSVC2008; Windows support is hopefully complete from the builsystem.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 218
diff changeset
   259
        if (MSVC80)
205
db67d0bf4548 Reverted internal SDL lib configuration modification, made the problem worse
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 204
diff changeset
   260
          set(SDL_LIBRARY
224
1032a9cd8de0 Added in support for MSVC building for MSVC2005 and MSVC2008; Windows support is hopefully complete from the builsystem.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 218
diff changeset
   261
              ${SDLDIR}/lib/win32/msvc2005/SDLmain.lib
1032a9cd8de0 Added in support for MSVC building for MSVC2005 and MSVC2008; Windows support is hopefully complete from the builsystem.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 218
diff changeset
   262
              ${SDLDIR}/lib/win32/msvc2005/SDL.lib
185
426ac9b86fcd Added win32 SDL libraries for MinGW and MSVC; Modified CMake scripts to properly install 'SDL.dll' to install prefix
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 182
diff changeset
   263
          )
224
1032a9cd8de0 Added in support for MSVC building for MSVC2005 and MSVC2008; Windows support is hopefully complete from the builsystem.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 218
diff changeset
   264
        endif (MSVC80)
1032a9cd8de0 Added in support for MSVC building for MSVC2005 and MSVC2008; Windows support is hopefully complete from the builsystem.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 218
diff changeset
   265
        if (MSVC90)
1032a9cd8de0 Added in support for MSVC building for MSVC2005 and MSVC2008; Windows support is hopefully complete from the builsystem.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 218
diff changeset
   266
          set(SDL_LIBRARY
1032a9cd8de0 Added in support for MSVC building for MSVC2005 and MSVC2008; Windows support is hopefully complete from the builsystem.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 218
diff changeset
   267
              ${SDLDIR}/lib/win32/msvc2008/SDLmain.lib
1032a9cd8de0 Added in support for MSVC building for MSVC2005 and MSVC2008; Windows support is hopefully complete from the builsystem.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 218
diff changeset
   268
              ${SDLDIR}/lib/win32/msvc2008/SDL.lib
1032a9cd8de0 Added in support for MSVC building for MSVC2005 and MSVC2008; Windows support is hopefully complete from the builsystem.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 218
diff changeset
   269
          )
1032a9cd8de0 Added in support for MSVC building for MSVC2005 and MSVC2008; Windows support is hopefully complete from the builsystem.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 218
diff changeset
   270
        endif (MSVC90)
185
426ac9b86fcd Added win32 SDL libraries for MinGW and MSVC; Modified CMake scripts to properly install 'SDL.dll' to install prefix
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 182
diff changeset
   271
        if (MINGW)
205
db67d0bf4548 Reverted internal SDL lib configuration modification, made the problem worse
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 204
diff changeset
   272
          set(SDL_LIBRARY
207
89228e8fc307 Fixed SDL linkage and internal libjpeg linkage breaks
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 205
diff changeset
   273
              "mingw32"
204
e257a4a37aad Modified internal SDL lib configuration to properly set up; Added #undef/#define to 'openal_wrapper.h' to fix building on Windows
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 203
diff changeset
   274
              ${SDLDIR}/lib/win32/mingw/libSDLmain.a
185
426ac9b86fcd Added win32 SDL libraries for MinGW and MSVC; Modified CMake scripts to properly install 'SDL.dll' to install prefix
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 182
diff changeset
   275
              ${SDLDIR}/lib/win32/mingw/libSDL.dll.a
207
89228e8fc307 Fixed SDL linkage and internal libjpeg linkage breaks
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 205
diff changeset
   276
              "-mwindows"
185
426ac9b86fcd Added win32 SDL libraries for MinGW and MSVC; Modified CMake scripts to properly install 'SDL.dll' to install prefix
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 182
diff changeset
   277
          )
426ac9b86fcd Added win32 SDL libraries for MinGW and MSVC; Modified CMake scripts to properly install 'SDL.dll' to install prefix
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 182
diff changeset
   278
        endif (MINGW)
203
f0d0a6ab22c4 Fixed CMake detection of internal libs
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 199
diff changeset
   279
    endif (WIN32)
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   280
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   281
    if (NOT LUGARU_HAS_INTERNAL_SDL)
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   282
        message(ERROR "We don't have a prebuilt SDL for this platform.")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   283
    endif (NOT LUGARU_HAS_INTERNAL_SDL)
182
20ef226ace70 Fixed dependencies, made them optional (so you can override system libs).
Ryan C. Gordon <icculus@icculus.org>
parents: 180
diff changeset
   284
endif (NOT SDL_FOUND)
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   285
182
20ef226ace70 Fixed dependencies, made them optional (so you can override system libs).
Ryan C. Gordon <icculus@icculus.org>
parents: 180
diff changeset
   286
option (LUGARU_FORCE_INTERNAL_PNG "Force internal libPNG, even if there's a system version" False)
20ef226ace70 Fixed dependencies, made them optional (so you can override system libs).
Ryan C. Gordon <icculus@icculus.org>
parents: 180
diff changeset
   287
if (NOT LUGARU_FORCE_INTERNAL_PNG)
20ef226ace70 Fixed dependencies, made them optional (so you can override system libs).
Ryan C. Gordon <icculus@icculus.org>
parents: 180
diff changeset
   288
    find_package(PNG)
197
f88b3d83e992 Fixed CMake so Force internal actually has a chance at working correctly
Harley Laue <losinggeneration@gmail.com>
parents: 190
diff changeset
   289
else(NOT LUGARU_FORCE_INTERNAL_PNG)
f88b3d83e992 Fixed CMake so Force internal actually has a chance at working correctly
Harley Laue <losinggeneration@gmail.com>
parents: 190
diff changeset
   290
	set(PNG_FOUND False)
182
20ef226ace70 Fixed dependencies, made them optional (so you can override system libs).
Ryan C. Gordon <icculus@icculus.org>
parents: 180
diff changeset
   291
endif (NOT LUGARU_FORCE_INTERNAL_PNG)
197
f88b3d83e992 Fixed CMake so Force internal actually has a chance at working correctly
Harley Laue <losinggeneration@gmail.com>
parents: 190
diff changeset
   292
182
20ef226ace70 Fixed dependencies, made them optional (so you can override system libs).
Ryan C. Gordon <icculus@icculus.org>
parents: 180
diff changeset
   293
if (NOT PNG_FOUND)
20ef226ace70 Fixed dependencies, made them optional (so you can override system libs).
Ryan C. Gordon <icculus@icculus.org>
parents: 180
diff changeset
   294
    message(STATUS "Using internal copy of libpng")
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   295
    set(LUGARU_MISSING_DEPS "${LUGARU_MISSING_DEPS} PNG")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   296
    set(PNGDIR "${DEPDIR}/libpng")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   297
    set(PNG_INCLUDE_DIR "${PNGDIR}")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   298
    set(PNG_LIBRARY "")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   299
    set(LUGARU_SRCS
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   300
        ${LUGARU_SRCS}
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   301
        ${PNGDIR}/png.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   302
        ${PNGDIR}/pngerror.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   303
        ${PNGDIR}/pngget.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   304
        ${PNGDIR}/pngmem.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   305
        ${PNGDIR}/pngpread.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   306
        ${PNGDIR}/pngread.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   307
        ${PNGDIR}/pngrio.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   308
        ${PNGDIR}/pngrtran.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   309
        ${PNGDIR}/pngrutil.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   310
        ${PNGDIR}/pngset.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   311
        ${PNGDIR}/pngtrans.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   312
        ${PNGDIR}/pngwio.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   313
        ${PNGDIR}/pngwrite.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   314
        ${PNGDIR}/pngwtran.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   315
        ${PNGDIR}/pngwutil.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   316
    )
182
20ef226ace70 Fixed dependencies, made them optional (so you can override system libs).
Ryan C. Gordon <icculus@icculus.org>
parents: 180
diff changeset
   317
endif (NOT PNG_FOUND)
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   318
182
20ef226ace70 Fixed dependencies, made them optional (so you can override system libs).
Ryan C. Gordon <icculus@icculus.org>
parents: 180
diff changeset
   319
option (LUGARU_FORCE_INTERNAL_JPEG "Force internal libJPEG, even if there's a system version" False)
20ef226ace70 Fixed dependencies, made them optional (so you can override system libs).
Ryan C. Gordon <icculus@icculus.org>
parents: 180
diff changeset
   320
if (NOT LUGARU_FORCE_INTERNAL_JPEG)
20ef226ace70 Fixed dependencies, made them optional (so you can override system libs).
Ryan C. Gordon <icculus@icculus.org>
parents: 180
diff changeset
   321
    find_package(JPEG)
197
f88b3d83e992 Fixed CMake so Force internal actually has a chance at working correctly
Harley Laue <losinggeneration@gmail.com>
parents: 190
diff changeset
   322
else(NOT LUGARU_FORCE_INTERNAL_JPEG)
f88b3d83e992 Fixed CMake so Force internal actually has a chance at working correctly
Harley Laue <losinggeneration@gmail.com>
parents: 190
diff changeset
   323
	set(JPEG_FOUND False)
182
20ef226ace70 Fixed dependencies, made them optional (so you can override system libs).
Ryan C. Gordon <icculus@icculus.org>
parents: 180
diff changeset
   324
endif (NOT LUGARU_FORCE_INTERNAL_JPEG)
197
f88b3d83e992 Fixed CMake so Force internal actually has a chance at working correctly
Harley Laue <losinggeneration@gmail.com>
parents: 190
diff changeset
   325
182
20ef226ace70 Fixed dependencies, made them optional (so you can override system libs).
Ryan C. Gordon <icculus@icculus.org>
parents: 180
diff changeset
   326
if (NOT JPEG_FOUND)
20ef226ace70 Fixed dependencies, made them optional (so you can override system libs).
Ryan C. Gordon <icculus@icculus.org>
parents: 180
diff changeset
   327
    message(STATUS "Using internal copy of libjpeg")
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   328
    set(LUGARU_MISSING_DEPS "${LUGARU_MISSING_DEPS} JPEG")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   329
    set(JPEGDIR "${DEPDIR}/libjpeg")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   330
    set(JPEG_INCLUDE_DIR "${JPEGDIR}")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   331
    set(JPEG_LIBRARY "")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   332
    set(LUGARU_SRCS
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   333
        ${LUGARU_SRCS}
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   334
        ${JPEGDIR}/jdapistd.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   335
        ${JPEGDIR}/jdmaster.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   336
        ${JPEGDIR}/jdapimin.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   337
        ${JPEGDIR}/jcapimin.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   338
        ${JPEGDIR}/jdmerge.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   339
        ${JPEGDIR}/jdatasrc.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   340
        ${JPEGDIR}/jdatadst.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   341
        ${JPEGDIR}/jdcoefct.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   342
        ${JPEGDIR}/jdcolor.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   343
        ${JPEGDIR}/jddctmgr.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   344
        ${JPEGDIR}/jdhuff.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   345
        ${JPEGDIR}/jdinput.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   346
        ${JPEGDIR}/jdmainct.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   347
        ${JPEGDIR}/jdmarker.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   348
        ${JPEGDIR}/jdpostct.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   349
        ${JPEGDIR}/jdsample.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   350
        ${JPEGDIR}/jdtrans.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   351
        ${JPEGDIR}/jerror.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   352
        ${JPEGDIR}/jidctflt.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   353
        ${JPEGDIR}/jidctfst.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   354
        ${JPEGDIR}/jidctint.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   355
        ${JPEGDIR}/jmemmgr.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   356
        ${JPEGDIR}/jutils.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   357
        ${JPEGDIR}/jmemnobs.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   358
        ${JPEGDIR}/jquant1.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   359
        ${JPEGDIR}/jquant2.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   360
        ${JPEGDIR}/jcomapi.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   361
        ${JPEGDIR}/jcmarker.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   362
        ${JPEGDIR}/jcapistd.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   363
        ${JPEGDIR}/jcparam.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   364
        ${JPEGDIR}/jcinit.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   365
        ${JPEGDIR}/jcdctmgr.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   366
        ${JPEGDIR}/jccoefct.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   367
        ${JPEGDIR}/jcmainct.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   368
        ${JPEGDIR}/jfdctflt.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   369
        ${JPEGDIR}/jfdctint.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   370
        ${JPEGDIR}/jfdctfst.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   371
        ${JPEGDIR}/jchuff.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   372
        ${JPEGDIR}/jcsample.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   373
        ${JPEGDIR}/jcmaster.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   374
        ${JPEGDIR}/jccolor.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   375
        ${JPEGDIR}/jcprepct.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   376
        ${JPEGDIR}/jcarith.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   377
        ${JPEGDIR}/jdarith.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   378
        ${JPEGDIR}/jaricom.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   379
    )
182
20ef226ace70 Fixed dependencies, made them optional (so you can override system libs).
Ryan C. Gordon <icculus@icculus.org>
parents: 180
diff changeset
   380
endif (NOT JPEG_FOUND)
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   381
182
20ef226ace70 Fixed dependencies, made them optional (so you can override system libs).
Ryan C. Gordon <icculus@icculus.org>
parents: 180
diff changeset
   382
option (LUGARU_FORCE_INTERNAL_ZLIB "Force internal zlib, even if there's a system version" False)
20ef226ace70 Fixed dependencies, made them optional (so you can override system libs).
Ryan C. Gordon <icculus@icculus.org>
parents: 180
diff changeset
   383
if (NOT LUGARU_FORCE_INTERNAL_ZLIB)
20ef226ace70 Fixed dependencies, made them optional (so you can override system libs).
Ryan C. Gordon <icculus@icculus.org>
parents: 180
diff changeset
   384
    find_package(ZLIB)
197
f88b3d83e992 Fixed CMake so Force internal actually has a chance at working correctly
Harley Laue <losinggeneration@gmail.com>
parents: 190
diff changeset
   385
else(NOT LUGARU_FORCE_INTERNAL_ZLIB)
f88b3d83e992 Fixed CMake so Force internal actually has a chance at working correctly
Harley Laue <losinggeneration@gmail.com>
parents: 190
diff changeset
   386
	set(ZLIB_FOUND False)
182
20ef226ace70 Fixed dependencies, made them optional (so you can override system libs).
Ryan C. Gordon <icculus@icculus.org>
parents: 180
diff changeset
   387
endif (NOT LUGARU_FORCE_INTERNAL_ZLIB)
197
f88b3d83e992 Fixed CMake so Force internal actually has a chance at working correctly
Harley Laue <losinggeneration@gmail.com>
parents: 190
diff changeset
   388
182
20ef226ace70 Fixed dependencies, made them optional (so you can override system libs).
Ryan C. Gordon <icculus@icculus.org>
parents: 180
diff changeset
   389
if (NOT ZLIB_FOUND)
20ef226ace70 Fixed dependencies, made them optional (so you can override system libs).
Ryan C. Gordon <icculus@icculus.org>
parents: 180
diff changeset
   390
    message(STATUS "Using internal copy of zlib")
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   391
    set(LUGARU_MISSING_DEPS "${LUGARU_MISSING_DEPS} ZLIB")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   392
    set(ZLIBDIR "${DEPDIR}/zlib")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   393
    set(ZLIB_INCLUDE_DIR "${ZLIBDIR}")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   394
    set(ZLIB_LIBRARIES "")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   395
    set(LUGARU_SRCS
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   396
        ${LUGARU_SRCS}
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   397
        ${ZLIBDIR}/adler32.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   398
        ${ZLIBDIR}/compress.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   399
        ${ZLIBDIR}/crc32.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   400
        ${ZLIBDIR}/deflate.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   401
        ${ZLIBDIR}/infback.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   402
        ${ZLIBDIR}/inffast.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   403
        ${ZLIBDIR}/inflate.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   404
        ${ZLIBDIR}/inftrees.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   405
        ${ZLIBDIR}/trees.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   406
        ${ZLIBDIR}/uncompr.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   407
        ${ZLIBDIR}/zutil.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   408
    )
182
20ef226ace70 Fixed dependencies, made them optional (so you can override system libs).
Ryan C. Gordon <icculus@icculus.org>
parents: 180
diff changeset
   409
endif (NOT ZLIB_FOUND)
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   410
182
20ef226ace70 Fixed dependencies, made them optional (so you can override system libs).
Ryan C. Gordon <icculus@icculus.org>
parents: 180
diff changeset
   411
option (LUGARU_FORCE_INTERNAL_GLU "Force internal libGLU, even if there's a system version" False)
197
f88b3d83e992 Fixed CMake so Force internal actually has a chance at working correctly
Harley Laue <losinggeneration@gmail.com>
parents: 190
diff changeset
   412
if (LUGARU_FORCE_INTERNAL_GLU)
f88b3d83e992 Fixed CMake so Force internal actually has a chance at working correctly
Harley Laue <losinggeneration@gmail.com>
parents: 190
diff changeset
   413
	set(OPENGL_GLU_FOUND False)
f88b3d83e992 Fixed CMake so Force internal actually has a chance at working correctly
Harley Laue <losinggeneration@gmail.com>
parents: 190
diff changeset
   414
endif (LUGARU_FORCE_INTERNAL_GLU)
f88b3d83e992 Fixed CMake so Force internal actually has a chance at working correctly
Harley Laue <losinggeneration@gmail.com>
parents: 190
diff changeset
   415
f88b3d83e992 Fixed CMake so Force internal actually has a chance at working correctly
Harley Laue <losinggeneration@gmail.com>
parents: 190
diff changeset
   416
if (NOT OPENGL_GLU_FOUND)
182
20ef226ace70 Fixed dependencies, made them optional (so you can override system libs).
Ryan C. Gordon <icculus@icculus.org>
parents: 180
diff changeset
   417
    message(STATUS "Using internal copy of libGLU")
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   418
    set(LUGARU_MISSING_DEPS "${LUGARU_MISSING_DEPS} GLU")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   419
    set(GLUDIR "${DEPDIR}/GLU")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   420
    set(GLU_INCLUDE_DIR "${GLUDIR}")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   421
    set(GLU_LIBRARY "")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   422
    set(LUGARU_SRCS
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   423
        ${LUGARU_SRCS}
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   424
        ${GLUDIR}/dict.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   425
        ${GLUDIR}/geom.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   426
        ${GLUDIR}/memalloc.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   427
        ${GLUDIR}/mesh.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   428
        ${GLUDIR}/mipmap.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   429
        ${GLUDIR}/normal.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   430
        ${GLUDIR}/priorityq.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   431
        ${GLUDIR}/render.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   432
        ${GLUDIR}/sweep.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   433
        ${GLUDIR}/tess.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   434
        ${GLUDIR}/tessmono.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   435
        ${GLUDIR}/util.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   436
    )
197
f88b3d83e992 Fixed CMake so Force internal actually has a chance at working correctly
Harley Laue <losinggeneration@gmail.com>
parents: 190
diff changeset
   437
endif (NOT OPENGL_GLU_FOUND)
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   438
182
20ef226ace70 Fixed dependencies, made them optional (so you can override system libs).
Ryan C. Gordon <icculus@icculus.org>
parents: 180
diff changeset
   439
option (LUGARU_FORCE_INTERNAL_VORBIS "Force internal Vorbis, even if there's a system version" False)
20ef226ace70 Fixed dependencies, made them optional (so you can override system libs).
Ryan C. Gordon <icculus@icculus.org>
parents: 180
diff changeset
   440
if (NOT LUGARU_FORCE_INTERNAL_VORBIS)
20ef226ace70 Fixed dependencies, made them optional (so you can override system libs).
Ryan C. Gordon <icculus@icculus.org>
parents: 180
diff changeset
   441
    find_package(OggVorbis)
197
f88b3d83e992 Fixed CMake so Force internal actually has a chance at working correctly
Harley Laue <losinggeneration@gmail.com>
parents: 190
diff changeset
   442
else(NOT LUGARU_FORCE_INTERNAL_VORBIS)
f88b3d83e992 Fixed CMake so Force internal actually has a chance at working correctly
Harley Laue <losinggeneration@gmail.com>
parents: 190
diff changeset
   443
	set(OGGVORBIS_FOUND False)
182
20ef226ace70 Fixed dependencies, made them optional (so you can override system libs).
Ryan C. Gordon <icculus@icculus.org>
parents: 180
diff changeset
   444
endif (NOT LUGARU_FORCE_INTERNAL_VORBIS)
197
f88b3d83e992 Fixed CMake so Force internal actually has a chance at working correctly
Harley Laue <losinggeneration@gmail.com>
parents: 190
diff changeset
   445
f88b3d83e992 Fixed CMake so Force internal actually has a chance at working correctly
Harley Laue <losinggeneration@gmail.com>
parents: 190
diff changeset
   446
if (NOT OGGVORBIS_FOUND)
182
20ef226ace70 Fixed dependencies, made them optional (so you can override system libs).
Ryan C. Gordon <icculus@icculus.org>
parents: 180
diff changeset
   447
    message(STATUS "Using internal copy of Ogg Vorbis")
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   448
    set(LUGARU_MISSING_DEPS "${LUGARU_MISSING_DEPS} OggVorbis")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   449
    set(OGGDIR "${DEPDIR}/libogg")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   450
    set(OGG_INCLUDE_DIR "${OGGDIR}/include")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   451
    set(OGG_LIBRARY "")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   452
    set(VORBISDIR "${DEPDIR}/libvorbis")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   453
    set(VORBISFILE_INCLUDE_DIR "${VORBISDIR}/include")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   454
    set(VORBISFILE_LIBRARY "")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   455
    set(LUGARU_SRCS
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   456
        ${LUGARU_SRCS}
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   457
        ${OGGDIR}/src/bitwise.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   458
        ${OGGDIR}/src/framing.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   459
        ${VORBISDIR}/lib/analysis.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   460
        ${VORBISDIR}/lib/bitrate.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   461
        ${VORBISDIR}/lib/block.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   462
        ${VORBISDIR}/lib/codebook.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   463
        ${VORBISDIR}/lib/envelope.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   464
        ${VORBISDIR}/lib/floor0.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   465
        ${VORBISDIR}/lib/floor1.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   466
        ${VORBISDIR}/lib/info.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   467
        ${VORBISDIR}/lib/lpc.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   468
        ${VORBISDIR}/lib/lsp.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   469
        ${VORBISDIR}/lib/mapping0.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   470
        ${VORBISDIR}/lib/mdct.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   471
        ${VORBISDIR}/lib/psy.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   472
        ${VORBISDIR}/lib/registry.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   473
        ${VORBISDIR}/lib/res0.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   474
        ${VORBISDIR}/lib/sharedbook.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   475
        ${VORBISDIR}/lib/smallft.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   476
        ${VORBISDIR}/lib/synthesis.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   477
        ${VORBISDIR}/lib/vorbisfile.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   478
        ${VORBISDIR}/lib/window.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   479
    )
197
f88b3d83e992 Fixed CMake so Force internal actually has a chance at working correctly
Harley Laue <losinggeneration@gmail.com>
parents: 190
diff changeset
   480
endif (NOT OGGVORBIS_FOUND)
103
e58c73e8c0f1 Quickly created CMake to build the source
Harley Laue <losinggeneration@gmail.com>
parents:
diff changeset
   481
e58c73e8c0f1 Quickly created CMake to build the source
Harley Laue <losinggeneration@gmail.com>
parents:
diff changeset
   482
include_directories(
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   483
    ${OPENAL_INCLUDE_DIR}
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   484
    ${JPEG_INCLUDE_DIR}
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   485
    ${PNG_INCLUDE_DIR}
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   486
    ${ZLIB_INCLUDE_DIR}
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   487
    ${OPENGL_INCLUDE_DIR}
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   488
    ${GLU_INCLUDE_DIR}
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   489
    ${SDL_INCLUDE_DIR}
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   490
    ${VORBISFILE_INCLUDE_DIR}
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   491
    ${OGG_INCLUDE_DIR}
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   492
    ${CMAKE_SOURCE_DIR}/Source
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   493
)
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   494
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   495
set(LUGARU_LIBS ${OPENAL_LIBRARY} ${PNG_LIBRARY} ${JPEG_LIBRARY} ${ZLIB_LIBRARIES} ${SDL_LIBRARY} ${GLU_LIBRARY} ${OPENGL_LIBRARY} ${VORBISFILE_LIBRARY} ${OGG_LIBRARY} ${PLATFORM_LIBS})
103
e58c73e8c0f1 Quickly created CMake to build the source
Harley Laue <losinggeneration@gmail.com>
parents:
diff changeset
   496
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   497
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   498
if(WIN32)
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   499
    add_executable(lugaru ${LUGARU_SRCS} ${LUGARU_H} lugaru_resource.obj)
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   500
else(WIN32)
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   501
    add_executable(lugaru ${LUGARU_SRCS} ${LUGARU_H})
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   502
endif(WIN32)
103
e58c73e8c0f1 Quickly created CMake to build the source
Harley Laue <losinggeneration@gmail.com>
parents:
diff changeset
   503
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   504
target_link_libraries(lugaru ${LUGARU_LIBS})
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   505
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   506
if(WIN32)
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   507
	add_definitions(-DUSE_OPENAL=1 -DUSE_SDL=1 -DBinIO_STDINT_HEADER=<stdint.h>)
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   508
else(WIN32)
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   509
	add_definitions(-DPLATFORM_LINUX=1 -DPLATFORM_UNIX=1 -DUSE_OPENAL=1 -DUSE_SDL=1 -DBinIO_STDINT_HEADER=<stdint.h>)
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   510
endif(WIN32)
108
5c75adc4301e Added support for 'make install' target in CMake scripts
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 106
diff changeset
   511
5c75adc4301e Added support for 'make install' target in CMake scripts
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 106
diff changeset
   512
# Install target
265
fb5be83391cc Made massive change to CMake scripts. Hopefully now CMake scripts will produce working Mac OS X Application bundles in the install step.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 264
diff changeset
   513
if(APPLE)
fb5be83391cc Made massive change to CMake scripts. Hopefully now CMake scripts will produce working Mac OS X Application bundles in the install step.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 264
diff changeset
   514
	set(APPS_ROOT "${CMAKE_INSTALL_PREFIX}/Lugaru.app")
fb5be83391cc Made massive change to CMake scripts. Hopefully now CMake scripts will produce working Mac OS X Application bundles in the install step.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 264
diff changeset
   515
	set(APPS_BIN "${APPS_ROOT}/Contents/MacOS")
fb5be83391cc Made massive change to CMake scripts. Hopefully now CMake scripts will produce working Mac OS X Application bundles in the install step.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 264
diff changeset
   516
	set(APPS_DATA "${APPS_ROOT}/Contents/Resources")
fb5be83391cc Made massive change to CMake scripts. Hopefully now CMake scripts will produce working Mac OS X Application bundles in the install step.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 264
diff changeset
   517
endif(APPLE)
fb5be83391cc Made massive change to CMake scripts. Hopefully now CMake scripts will produce working Mac OS X Application bundles in the install step.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 264
diff changeset
   518
108
5c75adc4301e Added support for 'make install' target in CMake scripts
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 106
diff changeset
   519
if(WIN32)
198
8558423199a2 Fixed install paths in CMake so that the compiled binary is properly installed
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 194
diff changeset
   520
	install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/lugaru.exe DESTINATION ${CMAKE_INSTALL_PREFIX})
224
1032a9cd8de0 Added in support for MSVC building for MSVC2005 and MSVC2008; Windows support is hopefully complete from the builsystem.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 218
diff changeset
   521
	if(MSVC80)
1032a9cd8de0 Added in support for MSVC building for MSVC2005 and MSVC2008; Windows support is hopefully complete from the builsystem.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 218
diff changeset
   522
		install(FILES ${SDLDIR}/lib/win32/msvc2005/SDL.dll DESTINATION ${CMAKE_INSTALL_PREFIX})
1032a9cd8de0 Added in support for MSVC building for MSVC2005 and MSVC2008; Windows support is hopefully complete from the builsystem.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 218
diff changeset
   523
		install(FILES ${OPENALDIR}/lib/win32/msvc2005/OpenAL32.dll DESTINATION ${CMAKE_INSTALL_PREFIX})
1032a9cd8de0 Added in support for MSVC building for MSVC2005 and MSVC2008; Windows support is hopefully complete from the builsystem.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 218
diff changeset
   524
	endif(MSVC80)
1032a9cd8de0 Added in support for MSVC building for MSVC2005 and MSVC2008; Windows support is hopefully complete from the builsystem.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 218
diff changeset
   525
	if(MSVC90)
1032a9cd8de0 Added in support for MSVC building for MSVC2005 and MSVC2008; Windows support is hopefully complete from the builsystem.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 218
diff changeset
   526
		install(FILES ${SDLDIR}/lib/win32/msvc2008/SDL.dll DESTINATION ${CMAKE_INSTALL_PREFIX})
1032a9cd8de0 Added in support for MSVC building for MSVC2005 and MSVC2008; Windows support is hopefully complete from the builsystem.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 218
diff changeset
   527
		install(FILES ${OPENALDIR}/lib/win32/msvc2008/OpenAL32.dll DESTINATION ${CMAKE_INSTALL_PREFIX})
1032a9cd8de0 Added in support for MSVC building for MSVC2005 and MSVC2008; Windows support is hopefully complete from the builsystem.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 218
diff changeset
   528
	endif(MSVC90)
185
426ac9b86fcd Added win32 SDL libraries for MinGW and MSVC; Modified CMake scripts to properly install 'SDL.dll' to install prefix
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 182
diff changeset
   529
	if(MINGW)
426ac9b86fcd Added win32 SDL libraries for MinGW and MSVC; Modified CMake scripts to properly install 'SDL.dll' to install prefix
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 182
diff changeset
   530
		install(FILES ${SDLDIR}/lib/win32/mingw/SDL.dll DESTINATION ${CMAKE_INSTALL_PREFIX})
188
de6bc7071b0c Added internal OpenAL libs for MinGW on Windows; MSVC internal libs to come soon
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 185
diff changeset
   531
		install(FILES ${OPENALDIR}/lib/win32/mingw/OpenAL32.dll DESTINATION ${CMAKE_INSTALL_PREFIX})
185
426ac9b86fcd Added win32 SDL libraries for MinGW and MSVC; Modified CMake scripts to properly install 'SDL.dll' to install prefix
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 182
diff changeset
   532
	endif(MINGW)
108
5c75adc4301e Added support for 'make install' target in CMake scripts
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 106
diff changeset
   533
else(WIN32)
265
fb5be83391cc Made massive change to CMake scripts. Hopefully now CMake scripts will produce working Mac OS X Application bundles in the install step.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 264
diff changeset
   534
	if(APPLE)
fb5be83391cc Made massive change to CMake scripts. Hopefully now CMake scripts will produce working Mac OS X Application bundles in the install step.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 264
diff changeset
   535
		set(CMAKE_INSTALL_PREFIX "${APPS_BIN}")
fb5be83391cc Made massive change to CMake scripts. Hopefully now CMake scripts will produce working Mac OS X Application bundles in the install step.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 264
diff changeset
   536
		install(FILES ${SRCDIR}/mac-res/lugaru.icns DESTINATION ${APPS_DATA})
fb5be83391cc Made massive change to CMake scripts. Hopefully now CMake scripts will produce working Mac OS X Application bundles in the install step.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 264
diff changeset
   537
		install(FILES ${SRCDIR}/mac-res/Info.plist DESTINATION ${APPS_ROOT}/Contents)
fb5be83391cc Made massive change to CMake scripts. Hopefully now CMake scripts will produce working Mac OS X Application bundles in the install step.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 264
diff changeset
   538
	endif(APPLE)
198
8558423199a2 Fixed install paths in CMake so that the compiled binary is properly installed
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 194
diff changeset
   539
	install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/lugaru DESTINATION ${CMAKE_INSTALL_PREFIX})
264
e147adc5e51c Whoops. Make sure CMake scripts copy SDL dylib only if it is being linked to it in the first place...
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 263
diff changeset
   540
	if(APPLE AND LUGARU_HAS_INTERNAL_SDL)
263
bdedf12c4f51 Looks like Windows users aren't the only ones that need to be handled carefully. Made CMake scripts copy SDL dylib as part of install build process on Mac OS X.
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 261
diff changeset
   541
		install(FILES ${SDLDIR}/lib/macosx/libSDL-1.2.0.dylib DESTINATION ${CMAKE_INSTALL_PREFIX})
264
e147adc5e51c Whoops. Make sure CMake scripts copy SDL dylib only if it is being linked to it in the first place...
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 263
diff changeset
   542
	endif(APPLE AND LUGARU_HAS_INTERNAL_SDL)
108
5c75adc4301e Added support for 'make install' target in CMake scripts
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 106
diff changeset
   543
endif(WIN32)
5c75adc4301e Added support for 'make install' target in CMake scripts
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 106
diff changeset
   544
269
efb1802850fa Fixed Data folder path for OSX bundles
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 268
diff changeset
   545
if(NOT APPLE)
108
5c75adc4301e Added support for 'make install' target in CMake scripts
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 106
diff changeset
   546
install(DIRECTORY ${CMAKE_SOURCE_DIR}/Data DESTINATION ${CMAKE_INSTALL_PREFIX})
269
efb1802850fa Fixed Data folder path for OSX bundles
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 268
diff changeset
   547
endif(NOT APPLE)
efb1802850fa Fixed Data folder path for OSX bundles
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 268
diff changeset
   548
efb1802850fa Fixed Data folder path for OSX bundles
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 268
diff changeset
   549
if(APPLE)
efb1802850fa Fixed Data folder path for OSX bundles
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 268
diff changeset
   550
install(DIRECTORY ${CMAKE_SOURCE_DIR}/Data DESTINATION ${APPS_ROOT})
efb1802850fa Fixed Data folder path for OSX bundles
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 268
diff changeset
   551
endif(APPLE)
108
5c75adc4301e Added support for 'make install' target in CMake scripts
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 106
diff changeset
   552
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   553
if (LUGARU_MISSING_DEPS)
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   554
    message(STATUS "Using our copy of these libs: ${LUGARU_MISSING_DEPS}")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   555
endif (LUGARU_MISSING_DEPS)
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   556