CMakeLists.txt
author Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
Sat, 15 May 2010 22:04:10 -0500
changeset 267 dc53d2faef95
parent 265 fb5be83391cc
child 268 a55b16cc4ff9
permissions -rw-r--r--
Moved 'resource.h' inclusion in 'OpenGL_Windows.cpp' to only be included on Win32 platform
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)
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
    34
	set(CMAKE_OSX_ARCHITECTURES "ppc;i386" CACHE STRING "Build architectures for OSX" FORCE)
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 
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
    36
		"Minimum OS X version to target for deployment (at runtime); newer APIs weak linked. Set to empty string for default value" FORCE)
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 
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
    38
		"The product will be built against the headers and libraries located inside the indicated SDK." FORCE)
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
    39
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
    40
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
    41
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
    42
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    43
set(LUGARU_SRCS
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    44
	${SRCDIR}/Frustum.cpp
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    45
	${SRCDIR}/GameDraw.cpp
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    46
	${SRCDIR}/GameInitDispose.cpp
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    47
	${SRCDIR}/GameTick.cpp
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    48
	${SRCDIR}/Globals.cpp
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    49
	${SRCDIR}/Lights.cpp
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    50
	${SRCDIR}/Models.cpp
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    51
	${SRCDIR}/Objects.cpp
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    52
	${SRCDIR}/pack.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    53
	${SRCDIR}/pack_private.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    54
	${SRCDIR}/Person.cpp
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    55
	${SRCDIR}/private.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    56
	${SRCDIR}/Quaternions.cpp
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    57
	${SRCDIR}/Random.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    58
	${SRCDIR}/Skeleton.cpp
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    59
	${SRCDIR}/Skybox.cpp
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    60
	${SRCDIR}/Sprites.cpp
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    61
	${SRCDIR}/Terrain.cpp
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    62
	${SRCDIR}/Text.cpp
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    63
	${SRCDIR}/TGALoader.cpp
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    64
	${SRCDIR}/unpack.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    65
	${SRCDIR}/unpack_private.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    66
	${SRCDIR}/Weapons.cpp
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    67
	${SRCDIR}/OpenGL_Windows.cpp
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    68
	${SRCDIR}/openal_wrapper.cpp
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    69
	${SRCDIR}/WinInput.cpp
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    70
)
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    71
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    72
set(LUGARU_H
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    73
	${SRCDIR}/Constants.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    74
	${SRCDIR}/Frustum.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    75
	${SRCDIR}/Game.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    76
	${SRCDIR}/Lights.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    77
	${SRCDIR}/LinkedList.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    78
	${SRCDIR}/Models.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    79
	${SRCDIR}/Objects.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    80
	${SRCDIR}/Person.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    81
	${SRCDIR}/PhysicsMath.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    82
	${SRCDIR}/Pointer.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    83
	${SRCDIR}/Quaternions.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    84
	${SRCDIR}/Random.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    85
	${SRCDIR}/Skeleton.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    86
	${SRCDIR}/Skybox.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    87
	${SRCDIR}/Sprites.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    88
	${SRCDIR}/TGALoader.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    89
	${SRCDIR}/Terrain.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    90
	${SRCDIR}/Text.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    91
	${SRCDIR}/Weapons.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    92
	${SRCDIR}/WinInput.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    93
	${SRCDIR}/alstubs.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    94
	${SRCDIR}/binio.h
189
8f78a01a216f Forgot to update CMake... again...
Harley Laue <losinggeneration@gmail.com>
parents: 185
diff changeset
    95
	${SRCDIR}/openal_wrapper.h
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    96
	${SRCDIR}/gamegl.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    97
	${SRCDIR}/glstubs.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    98
	${SRCDIR}/mmgr.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
    99
	${SRCDIR}/nommgr.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   100
	${SRCDIR}/pack_private.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   101
	${SRCDIR}/private.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   102
	${SRCDIR}/unpack_private.h
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   103
)
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   104
258
2eb9569dd401 Don't force GL headers if the user doesn't want that
Harley Laue <losinggeneration@gmail.com>
parents: 236
diff changeset
   105
if(UNIX)
2eb9569dd401 Don't force GL headers if the user doesn't want that
Harley Laue <losinggeneration@gmail.com>
parents: 236
diff changeset
   106
	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
   107
		${LUGARU_SRCS}
2eb9569dd401 Don't force GL headers if the user doesn't want that
Harley Laue <losinggeneration@gmail.com>
parents: 236
diff changeset
   108
		${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
   109
	)
2eb9569dd401 Don't force GL headers if the user doesn't want that
Harley Laue <losinggeneration@gmail.com>
parents: 236
diff changeset
   110
	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
   111
		${LUGARU_H}
2eb9569dd401 Don't force GL headers if the user doesn't want that
Harley Laue <losinggeneration@gmail.com>
parents: 236
diff changeset
   112
		${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
   113
	)
2eb9569dd401 Don't force GL headers if the user doesn't want that
Harley Laue <losinggeneration@gmail.com>
parents: 236
diff changeset
   114
endif(UNIX)
2eb9569dd401 Don't force GL headers if the user doesn't want that
Harley Laue <losinggeneration@gmail.com>
parents: 236
diff changeset
   115
2eb9569dd401 Don't force GL headers if the user doesn't want that
Harley Laue <losinggeneration@gmail.com>
parents: 236
diff changeset
   116
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
   117
	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
   118
		${LUGARU_H}
2eb9569dd401 Don't force GL headers if the user doesn't want that
Harley Laue <losinggeneration@gmail.com>
parents: 236
diff changeset
   119
		${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
   120
		${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
   121
	)
2eb9569dd401 Don't force GL headers if the user doesn't want that
Harley Laue <losinggeneration@gmail.com>
parents: 236
diff changeset
   122
endif(MSVC)
2eb9569dd401 Don't force GL headers if the user doesn't want that
Harley Laue <losinggeneration@gmail.com>
parents: 236
diff changeset
   123
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   124
if(WIN32)
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   125
  if(CMAKE_CROSSCOMPILING)
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   126
    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
   127
						  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
   128
							  -I${SRCDIR}/win-res
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   129
							  -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
   130
							  -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
   131
					      DEPENDS ${SRCDIR}/win-res/Lugaru.rc
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   132
						  )
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   133
  endif(CMAKE_CROSSCOMPILING)
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   134
  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
   135
   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
   136
    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
   137
						  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
   138
							  -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
   139
							  -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
   140
							  ${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
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
   142
						  )
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
   143
   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
   144
   if(MINGW)
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   145
    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
   146
						  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
   147
							  -I${SRCDIR}/win-res
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   148
							  -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
   149
							  -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
   150
					      DEPENDS ${SRCDIR}/win-res/Lugaru.rc
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   151
						  )
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
   endif(MINGW)
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   153
  endif(NOT CMAKE_CROSSCOMPILING)
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   154
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   155
  # !!! FIXME: get rid of this.
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   156
  set(LUGARU_SRCS
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   157
	${LUGARU_SRCS}
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   158
	${SRCDIR}/WinDefs.cpp)
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   159
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   160
  set(LUGARU_H
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   161
	${LUGARU_H}
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   162
	${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
   163
	${SRCDIR}/win-res/resource.h)
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   164
endif(WIN32)
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   165
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   166
if (APPLE)
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   167
    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
   168
endif (APPLE)
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
# Deal with dependencies...
103
e58c73e8c0f1 Quickly created CMake to build the source
Harley Laue <losinggeneration@gmail.com>
parents:
diff changeset
   171
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
   172
# 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
   173
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
   174
	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
   175
	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
   176
		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
   177
	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
   178
endif(NOT WIN32)
67c209d05a9e Fix error on forcing inclusion of OpenGL headers on Windows
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 259
diff changeset
   179
67c209d05a9e Fix error on forcing inclusion of OpenGL headers on Windows
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 259
diff changeset
   180
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
   181
	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
   182
endif(WIN32)
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   183
192
17c5df59e083 Oops, forgot to actually pre-define the OpenAL internal library configuration
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 190
diff changeset
   184
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
   185
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
   186
	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
   187
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
   188
	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
   189
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
   190
258
2eb9569dd401 Don't force GL headers if the user doesn't want that
Harley Laue <losinggeneration@gmail.com>
parents: 236
diff changeset
   191
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
   192
    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
   193
    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
   194
    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
   195
    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
   196
    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
   197
203
f0d0a6ab22c4 Fixed CMake detection of internal libs
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 199
diff changeset
   198
    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
   199
        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
   200
        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
   201
            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
   202
                ${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
   203
            )
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
   204
        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
   205
        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
   206
            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
   207
                ${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
   208
            )
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
   209
        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
   210
        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
   211
            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
   212
                ${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
   213
            )
de6bc7071b0c Added internal OpenAL libs for MinGW on Windows; MSVC internal libs to come soon
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 185
diff changeset
   214
        endif (MINGW)
203
f0d0a6ab22c4 Fixed CMake detection of internal libs
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 199
diff changeset
   215
     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
   216
de6bc7071b0c Added internal OpenAL libs for MinGW on Windows; MSVC internal libs to come soon
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 185
diff changeset
   217
    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
   218
        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
   219
    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
   220
endif (NOT OPENAL_FOUND OR LUGARU_FORCE_INTERNAL_OPENAL)
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   221
182
20ef226ace70 Fixed dependencies, made them optional (so you can override system libs).
Ryan C. Gordon <icculus@icculus.org>
parents: 180
diff changeset
   222
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
   223
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
   224
    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
   225
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
   226
	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
   227
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
   228
182
20ef226ace70 Fixed dependencies, made them optional (so you can override system libs).
Ryan C. Gordon <icculus@icculus.org>
parents: 180
diff changeset
   229
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
   230
    message(STATUS "Using internal copy of SDL")
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   231
    set(LUGARU_MISSING_DEPS "${LUGARU_MISSING_DEPS} SDL")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   232
    set(SDLDIR "${DEPDIR}/SDL12")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   233
    set(SDL_INCLUDE_DIR "${SDLDIR}/include")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   234
    set(SDL_LIBRARY "")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   235
    if (APPLE)
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   236
        set(LUGARU_HAS_INTERNAL_SDL True)
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   237
        set(SDL_LIBRARY
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   238
            ${SDLDIR}/lib/macosx/libSDL-1.2.0.dylib
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   239
            ${SDLDIR}/lib/macosx/libSDLmain-osx.a
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   240
        )
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   241
    endif (APPLE)
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   242
203
f0d0a6ab22c4 Fixed CMake detection of internal libs
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 199
diff changeset
   243
    if (WIN32)
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   244
        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
   245
        if (MSVC80)
205
db67d0bf4548 Reverted internal SDL lib configuration modification, made the problem worse
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 204
diff changeset
   246
          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
   247
              ${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
   248
              ${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
   249
          )
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
   250
        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
   251
        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
   252
          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
   253
              ${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
   254
              ${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
   255
          )
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
   256
        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
   257
        if (MINGW)
205
db67d0bf4548 Reverted internal SDL lib configuration modification, made the problem worse
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 204
diff changeset
   258
          set(SDL_LIBRARY
207
89228e8fc307 Fixed SDL linkage and internal libjpeg linkage breaks
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 205
diff changeset
   259
              "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
   260
              ${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
   261
              ${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
   262
              "-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
   263
          )
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
   264
        endif (MINGW)
203
f0d0a6ab22c4 Fixed CMake detection of internal libs
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 199
diff changeset
   265
    endif (WIN32)
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   266
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   267
    if (NOT LUGARU_HAS_INTERNAL_SDL)
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   268
        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
   269
    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
   270
endif (NOT SDL_FOUND)
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   271
182
20ef226ace70 Fixed dependencies, made them optional (so you can override system libs).
Ryan C. Gordon <icculus@icculus.org>
parents: 180
diff changeset
   272
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
   273
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
   274
    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
   275
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
   276
	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
   277
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
   278
182
20ef226ace70 Fixed dependencies, made them optional (so you can override system libs).
Ryan C. Gordon <icculus@icculus.org>
parents: 180
diff changeset
   279
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
   280
    message(STATUS "Using internal copy of libpng")
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   281
    set(LUGARU_MISSING_DEPS "${LUGARU_MISSING_DEPS} PNG")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   282
    set(PNGDIR "${DEPDIR}/libpng")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   283
    set(PNG_INCLUDE_DIR "${PNGDIR}")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   284
    set(PNG_LIBRARY "")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   285
    set(LUGARU_SRCS
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   286
        ${LUGARU_SRCS}
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   287
        ${PNGDIR}/png.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   288
        ${PNGDIR}/pngerror.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   289
        ${PNGDIR}/pngget.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   290
        ${PNGDIR}/pngmem.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   291
        ${PNGDIR}/pngpread.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   292
        ${PNGDIR}/pngread.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   293
        ${PNGDIR}/pngrio.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   294
        ${PNGDIR}/pngrtran.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   295
        ${PNGDIR}/pngrutil.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   296
        ${PNGDIR}/pngset.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   297
        ${PNGDIR}/pngtrans.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   298
        ${PNGDIR}/pngwio.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   299
        ${PNGDIR}/pngwrite.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   300
        ${PNGDIR}/pngwtran.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   301
        ${PNGDIR}/pngwutil.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   302
    )
182
20ef226ace70 Fixed dependencies, made them optional (so you can override system libs).
Ryan C. Gordon <icculus@icculus.org>
parents: 180
diff changeset
   303
endif (NOT PNG_FOUND)
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   304
182
20ef226ace70 Fixed dependencies, made them optional (so you can override system libs).
Ryan C. Gordon <icculus@icculus.org>
parents: 180
diff changeset
   305
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
   306
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
   307
    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
   308
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
   309
	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
   310
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
   311
182
20ef226ace70 Fixed dependencies, made them optional (so you can override system libs).
Ryan C. Gordon <icculus@icculus.org>
parents: 180
diff changeset
   312
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
   313
    message(STATUS "Using internal copy of libjpeg")
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   314
    set(LUGARU_MISSING_DEPS "${LUGARU_MISSING_DEPS} JPEG")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   315
    set(JPEGDIR "${DEPDIR}/libjpeg")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   316
    set(JPEG_INCLUDE_DIR "${JPEGDIR}")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   317
    set(JPEG_LIBRARY "")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   318
    set(LUGARU_SRCS
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   319
        ${LUGARU_SRCS}
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   320
        ${JPEGDIR}/jdapistd.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   321
        ${JPEGDIR}/jdmaster.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   322
        ${JPEGDIR}/jdapimin.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   323
        ${JPEGDIR}/jcapimin.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   324
        ${JPEGDIR}/jdmerge.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   325
        ${JPEGDIR}/jdatasrc.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   326
        ${JPEGDIR}/jdatadst.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   327
        ${JPEGDIR}/jdcoefct.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   328
        ${JPEGDIR}/jdcolor.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   329
        ${JPEGDIR}/jddctmgr.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   330
        ${JPEGDIR}/jdhuff.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   331
        ${JPEGDIR}/jdinput.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   332
        ${JPEGDIR}/jdmainct.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   333
        ${JPEGDIR}/jdmarker.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   334
        ${JPEGDIR}/jdpostct.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   335
        ${JPEGDIR}/jdsample.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   336
        ${JPEGDIR}/jdtrans.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   337
        ${JPEGDIR}/jerror.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   338
        ${JPEGDIR}/jidctflt.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   339
        ${JPEGDIR}/jidctfst.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   340
        ${JPEGDIR}/jidctint.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   341
        ${JPEGDIR}/jmemmgr.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   342
        ${JPEGDIR}/jutils.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   343
        ${JPEGDIR}/jmemnobs.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   344
        ${JPEGDIR}/jquant1.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   345
        ${JPEGDIR}/jquant2.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   346
        ${JPEGDIR}/jcomapi.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   347
        ${JPEGDIR}/jcmarker.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   348
        ${JPEGDIR}/jcapistd.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   349
        ${JPEGDIR}/jcparam.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   350
        ${JPEGDIR}/jcinit.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   351
        ${JPEGDIR}/jcdctmgr.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   352
        ${JPEGDIR}/jccoefct.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   353
        ${JPEGDIR}/jcmainct.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   354
        ${JPEGDIR}/jfdctflt.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   355
        ${JPEGDIR}/jfdctint.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   356
        ${JPEGDIR}/jfdctfst.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   357
        ${JPEGDIR}/jchuff.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   358
        ${JPEGDIR}/jcsample.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   359
        ${JPEGDIR}/jcmaster.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   360
        ${JPEGDIR}/jccolor.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   361
        ${JPEGDIR}/jcprepct.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   362
        ${JPEGDIR}/jcarith.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   363
        ${JPEGDIR}/jdarith.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   364
        ${JPEGDIR}/jaricom.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   365
    )
182
20ef226ace70 Fixed dependencies, made them optional (so you can override system libs).
Ryan C. Gordon <icculus@icculus.org>
parents: 180
diff changeset
   366
endif (NOT JPEG_FOUND)
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   367
182
20ef226ace70 Fixed dependencies, made them optional (so you can override system libs).
Ryan C. Gordon <icculus@icculus.org>
parents: 180
diff changeset
   368
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
   369
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
   370
    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
   371
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
   372
	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
   373
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
   374
182
20ef226ace70 Fixed dependencies, made them optional (so you can override system libs).
Ryan C. Gordon <icculus@icculus.org>
parents: 180
diff changeset
   375
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
   376
    message(STATUS "Using internal copy of zlib")
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   377
    set(LUGARU_MISSING_DEPS "${LUGARU_MISSING_DEPS} ZLIB")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   378
    set(ZLIBDIR "${DEPDIR}/zlib")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   379
    set(ZLIB_INCLUDE_DIR "${ZLIBDIR}")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   380
    set(ZLIB_LIBRARIES "")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   381
    set(LUGARU_SRCS
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   382
        ${LUGARU_SRCS}
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   383
        ${ZLIBDIR}/adler32.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   384
        ${ZLIBDIR}/compress.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   385
        ${ZLIBDIR}/crc32.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   386
        ${ZLIBDIR}/deflate.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   387
        ${ZLIBDIR}/infback.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   388
        ${ZLIBDIR}/inffast.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   389
        ${ZLIBDIR}/inflate.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   390
        ${ZLIBDIR}/inftrees.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   391
        ${ZLIBDIR}/trees.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   392
        ${ZLIBDIR}/uncompr.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   393
        ${ZLIBDIR}/zutil.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   394
    )
182
20ef226ace70 Fixed dependencies, made them optional (so you can override system libs).
Ryan C. Gordon <icculus@icculus.org>
parents: 180
diff changeset
   395
endif (NOT ZLIB_FOUND)
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   396
182
20ef226ace70 Fixed dependencies, made them optional (so you can override system libs).
Ryan C. Gordon <icculus@icculus.org>
parents: 180
diff changeset
   397
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
   398
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
   399
	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
   400
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
   401
f88b3d83e992 Fixed CMake so Force internal actually has a chance at working correctly
Harley Laue <losinggeneration@gmail.com>
parents: 190
diff changeset
   402
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
   403
    message(STATUS "Using internal copy of libGLU")
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   404
    set(LUGARU_MISSING_DEPS "${LUGARU_MISSING_DEPS} GLU")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   405
    set(GLUDIR "${DEPDIR}/GLU")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   406
    set(GLU_INCLUDE_DIR "${GLUDIR}")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   407
    set(GLU_LIBRARY "")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   408
    set(LUGARU_SRCS
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   409
        ${LUGARU_SRCS}
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   410
        ${GLUDIR}/dict.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   411
        ${GLUDIR}/geom.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   412
        ${GLUDIR}/memalloc.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   413
        ${GLUDIR}/mesh.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   414
        ${GLUDIR}/mipmap.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   415
        ${GLUDIR}/normal.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   416
        ${GLUDIR}/priorityq.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   417
        ${GLUDIR}/render.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   418
        ${GLUDIR}/sweep.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   419
        ${GLUDIR}/tess.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   420
        ${GLUDIR}/tessmono.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   421
        ${GLUDIR}/util.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   422
    )
197
f88b3d83e992 Fixed CMake so Force internal actually has a chance at working correctly
Harley Laue <losinggeneration@gmail.com>
parents: 190
diff changeset
   423
endif (NOT OPENGL_GLU_FOUND)
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   424
182
20ef226ace70 Fixed dependencies, made them optional (so you can override system libs).
Ryan C. Gordon <icculus@icculus.org>
parents: 180
diff changeset
   425
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
   426
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
   427
    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
   428
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
   429
	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
   430
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
   431
f88b3d83e992 Fixed CMake so Force internal actually has a chance at working correctly
Harley Laue <losinggeneration@gmail.com>
parents: 190
diff changeset
   432
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
   433
    message(STATUS "Using internal copy of Ogg Vorbis")
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   434
    set(LUGARU_MISSING_DEPS "${LUGARU_MISSING_DEPS} OggVorbis")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   435
    set(OGGDIR "${DEPDIR}/libogg")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   436
    set(OGG_INCLUDE_DIR "${OGGDIR}/include")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   437
    set(OGG_LIBRARY "")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   438
    set(VORBISDIR "${DEPDIR}/libvorbis")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   439
    set(VORBISFILE_INCLUDE_DIR "${VORBISDIR}/include")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   440
    set(VORBISFILE_LIBRARY "")
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   441
    set(LUGARU_SRCS
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   442
        ${LUGARU_SRCS}
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   443
        ${OGGDIR}/src/bitwise.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   444
        ${OGGDIR}/src/framing.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   445
        ${VORBISDIR}/lib/analysis.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   446
        ${VORBISDIR}/lib/bitrate.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   447
        ${VORBISDIR}/lib/block.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   448
        ${VORBISDIR}/lib/codebook.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   449
        ${VORBISDIR}/lib/envelope.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   450
        ${VORBISDIR}/lib/floor0.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   451
        ${VORBISDIR}/lib/floor1.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   452
        ${VORBISDIR}/lib/info.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   453
        ${VORBISDIR}/lib/lpc.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   454
        ${VORBISDIR}/lib/lsp.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   455
        ${VORBISDIR}/lib/mapping0.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   456
        ${VORBISDIR}/lib/mdct.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   457
        ${VORBISDIR}/lib/psy.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   458
        ${VORBISDIR}/lib/registry.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   459
        ${VORBISDIR}/lib/res0.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   460
        ${VORBISDIR}/lib/sharedbook.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   461
        ${VORBISDIR}/lib/smallft.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   462
        ${VORBISDIR}/lib/synthesis.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   463
        ${VORBISDIR}/lib/vorbisfile.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   464
        ${VORBISDIR}/lib/window.c
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   465
    )
197
f88b3d83e992 Fixed CMake so Force internal actually has a chance at working correctly
Harley Laue <losinggeneration@gmail.com>
parents: 190
diff changeset
   466
endif (NOT OGGVORBIS_FOUND)
103
e58c73e8c0f1 Quickly created CMake to build the source
Harley Laue <losinggeneration@gmail.com>
parents:
diff changeset
   467
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
   468
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
   469
	# Save our sanity; Set all available libraries to internal by default
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
   470
	set(LUGARU_FORCE_INTERNAL_SDL True)
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
   471
	set(LUGARU_FORCE_INTERNAL_GLU True)
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
   472
	set(LUGARU_FORCE_INTERNAL_JPEG True)
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
   473
	set(LUGARU_FORCE_INTERNAL_PNG True)
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
   474
	set(LUGARU_FORCE_INTERNAL_VORBIS True)
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
   475
	set(LUGARU_FORCE_INTERNAL_ZLIB True)
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
   476
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
   477
103
e58c73e8c0f1 Quickly created CMake to build the source
Harley Laue <losinggeneration@gmail.com>
parents:
diff changeset
   478
include_directories(
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   479
    ${OPENAL_INCLUDE_DIR}
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   480
    ${JPEG_INCLUDE_DIR}
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   481
    ${PNG_INCLUDE_DIR}
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   482
    ${ZLIB_INCLUDE_DIR}
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   483
    ${OPENGL_INCLUDE_DIR}
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   484
    ${GLU_INCLUDE_DIR}
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   485
    ${SDL_INCLUDE_DIR}
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   486
    ${VORBISFILE_INCLUDE_DIR}
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   487
    ${OGG_INCLUDE_DIR}
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   488
    ${CMAKE_SOURCE_DIR}/Source
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   489
)
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   490
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   491
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
   492
180
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
if(WIN32)
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   495
    add_executable(lugaru ${LUGARU_SRCS} ${LUGARU_H} lugaru_resource.obj)
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   496
else(WIN32)
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   497
    add_executable(lugaru ${LUGARU_SRCS} ${LUGARU_H})
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   498
endif(WIN32)
103
e58c73e8c0f1 Quickly created CMake to build the source
Harley Laue <losinggeneration@gmail.com>
parents:
diff changeset
   499
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   500
target_link_libraries(lugaru ${LUGARU_LIBS})
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   501
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   502
if(WIN32)
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   503
	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
   504
else(WIN32)
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   505
	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
   506
endif(WIN32)
108
5c75adc4301e Added support for 'make install' target in CMake scripts
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 106
diff changeset
   507
5c75adc4301e Added support for 'make install' target in CMake scripts
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 106
diff changeset
   508
# 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
   509
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
   510
	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
   511
	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
   512
	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
   513
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
   514
108
5c75adc4301e Added support for 'make install' target in CMake scripts
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 106
diff changeset
   515
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
   516
	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
   517
	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
   518
		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
   519
		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
   520
	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
   521
	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
   522
		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
   523
		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
   524
	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
   525
	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
   526
		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
   527
		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
   528
	endif(MINGW)
108
5c75adc4301e Added support for 'make install' target in CMake scripts
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 106
diff changeset
   529
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
   530
	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
   531
		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
   532
		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
   533
		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
   534
	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
   535
	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
   536
	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
   537
		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
   538
	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
   539
endif(WIN32)
5c75adc4301e Added support for 'make install' target in CMake scripts
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 106
diff changeset
   540
5c75adc4301e Added support for 'make install' target in CMake scripts
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 106
diff changeset
   541
install(DIRECTORY ${CMAKE_SOURCE_DIR}/Data DESTINATION ${CMAKE_INSTALL_PREFIX})
5c75adc4301e Added support for 'make install' target in CMake scripts
Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
parents: 106
diff changeset
   542
180
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   543
if (LUGARU_MISSING_DEPS)
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   544
    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
   545
endif (LUGARU_MISSING_DEPS)
c2da3c58262a Reworked CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 169
diff changeset
   546