annotate OrthancStone/Resources/CMake/GlewConfiguration.cmake @ 1574:fb5e620430ae

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 21 Sep 2020 18:29:53 +0200
parents 244ad1e4e76a
children f9e3a9c21c0f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
613
412a2d01a189 automatic initialization of glew
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 # Stone of Orthanc
412a2d01a189 automatic initialization of glew
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
412a2d01a189 automatic initialization of glew
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 # Department, University Hospital of Liege, Belgium
1270
2d8ab34c8c91 upgrade to year 2020
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 613
diff changeset
4 # Copyright (C) 2017-2020 Osimis S.A., Belgium
613
412a2d01a189 automatic initialization of glew
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5 #
412a2d01a189 automatic initialization of glew
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 # This program is free software: you can redistribute it and/or
412a2d01a189 automatic initialization of glew
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 # modify it under the terms of the GNU Affero General Public License
412a2d01a189 automatic initialization of glew
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 # as published by the Free Software Foundation, either version 3 of
412a2d01a189 automatic initialization of glew
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 # the License, or (at your option) any later version.
412a2d01a189 automatic initialization of glew
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 #
412a2d01a189 automatic initialization of glew
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 # This program is distributed in the hope that it will be useful, but
412a2d01a189 automatic initialization of glew
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
412a2d01a189 automatic initialization of glew
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
412a2d01a189 automatic initialization of glew
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 # Affero General Public License for more details.
412a2d01a189 automatic initialization of glew
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 #
412a2d01a189 automatic initialization of glew
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 # You should have received a copy of the GNU Affero General Public License
412a2d01a189 automatic initialization of glew
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
412a2d01a189 automatic initialization of glew
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18
412a2d01a189 automatic initialization of glew
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19
412a2d01a189 automatic initialization of glew
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 if (STATIC_BUILD OR NOT USE_SYSTEM_GLEW)
412a2d01a189 automatic initialization of glew
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 SET(GLEW_SOURCES_DIR ${CMAKE_BINARY_DIR}/glew-2.1.0)
412a2d01a189 automatic initialization of glew
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 SET(GLEW_URL "http://orthanc.osimis.io/ThirdPartyDownloads/glew-2.1.0.tgz")
412a2d01a189 automatic initialization of glew
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 SET(GLEW_MD5 "b2ab12331033ddfaa50dc39345343980")
412a2d01a189 automatic initialization of glew
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 DownloadPackage(${GLEW_MD5} ${GLEW_URL} "${GLEW_SOURCES_DIR}")
412a2d01a189 automatic initialization of glew
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25
412a2d01a189 automatic initialization of glew
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 set(GLEW_SOURCES
412a2d01a189 automatic initialization of glew
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 ${GLEW_SOURCES_DIR}/src/glew.c
412a2d01a189 automatic initialization of glew
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 )
412a2d01a189 automatic initialization of glew
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29
412a2d01a189 automatic initialization of glew
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 include_directories(${GLEW_SOURCES_DIR}/include)
412a2d01a189 automatic initialization of glew
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31
412a2d01a189 automatic initialization of glew
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 add_definitions(
412a2d01a189 automatic initialization of glew
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 -DGLEW_STATIC=1
412a2d01a189 automatic initialization of glew
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 )
412a2d01a189 automatic initialization of glew
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35
412a2d01a189 automatic initialization of glew
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 else()
412a2d01a189 automatic initialization of glew
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 include(FindGLEW)
412a2d01a189 automatic initialization of glew
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 if (NOT GLEW_FOUND)
412a2d01a189 automatic initialization of glew
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 message(FATAL_ERROR "Please install the libglew-dev package")
412a2d01a189 automatic initialization of glew
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 endif()
412a2d01a189 automatic initialization of glew
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41
412a2d01a189 automatic initialization of glew
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 include_directories(${GLEW_INCLUDE_DIRS})
412a2d01a189 automatic initialization of glew
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 link_libraries(${GLEW_LIBRARIES})
412a2d01a189 automatic initialization of glew
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 endif()