Mercurial > solar_system
diff CMakeLists.txt @ 2:c24af3462002
initial commit
author | Eris Caffee <discordia@eldalin.com> |
---|---|
date | Sat, 27 Apr 2013 13:22:17 -0500 |
parents | 9c54994a2635 |
children | 4f8b47ac2715 7ae4ee5c27f8 |
line diff
1.1 --- a/CMakeLists.txt Tue Mar 29 00:27:15 2011 -0500 1.2 +++ b/CMakeLists.txt Sat Apr 27 13:22:17 2013 -0500 1.3 @@ -66,7 +66,7 @@ 1.4 #set (CMAKE_VERBOSE_MAKEFILE ON) 1.5 1.6 # Name your program! 1.7 -set (App_Name "") 1.8 +set (App_Name "solar-system") 1.9 if (App_Name STREQUAL "") 1.10 message (FATAL_ERROR "You must set the App_Name variable!") 1.11 endif () 1.12 @@ -112,12 +112,12 @@ 1.13 1.14 ################################################################################ 1.15 # When using GCC turn on lots of warnings. 1.16 -# Some other options to consider: 1.17 -# C++ -Weffc++ 1.18 + # Some other options to consider: 1.19 +# C++ -Weffc++ -std=c++0x 1.20 # C -std=gnu99 -std=c99 1.21 1.22 if (CMAKE_COMPILER_IS_GNUCXX) 1.23 - add_definitions(-pedantic -Wall) 1.24 + add_definitions(-pedantic -Wall -std=c++0x) 1.25 endif () 1.26 1.27 1.28 @@ -133,8 +133,14 @@ 1.29 ################################################################################ 1.30 # The core project files 1.31 1.32 -file (GLOB SRCS src/*.c src/*.cpp) 1.33 -file (GLOB HDRS include/*.h include/*.hpp) 1.34 +file (GLOB SRCS src/*.c src/*.cpp 1.35 + /home/eris/gamedev/study/OpenGL_Superbible/work/Src/GLTools/src/* 1.36 +) 1.37 +file (GLOB HDRS include/*.h include/*.hpp 1.38 + /home/eris/gamedev/study/OpenGL_Superbible/work/Src/GLTools/include/* 1.39 + /home/eris/gamedev/study/OpenGL_Superbible/work/Src/GLTools/include/GL/* 1.40 + 1.41 +) 1.42 1.43 # The directories that contain the libraries we will be linking against. 1.44 # This must come before the ADD_EXECUTABLE directive. 1.45 @@ -145,6 +151,8 @@ 1.46 # This must come before the ADD_EXECUTABLE directive. 1.47 include_directories ( 1.48 ${CMAKE_SOURCE_DIR}/include 1.49 + /home/eris/gamedev/study/OpenGL_Superbible/work/Src/GLTools/include/ 1.50 + /home/eris/gamedev/study/OpenGL_Superbible/work/Src/GLTools/include/GL 1.51 ) 1.52 1.53 # Define the executable program file we are creating. We must list all of 1.54 @@ -155,6 +163,9 @@ 1.55 ${HDRS} 1.56 ) 1.57 else () 1.58 + # I should NOT have to define this symbol explictly. Why do I? 1.59 + add_definitions(-Dlinux) 1.60 + 1.61 add_executable (${App_Name} 1.62 ${SRCS} 1.63 ${HDRS} 1.64 @@ -400,14 +411,14 @@ 1.65 1.66 ################################################################################ 1.67 1.68 -option(Option_OpenGL_Dev "Build an OpenGL Application." OFF) 1.69 +option(Option_OpenGL_Dev "Build an OpenGL Application." ON) 1.70 1.71 if (Option_OpenGL_Dev) 1.72 1.73 find_package(OpenGL) 1.74 - if (NOT OPEN_FOUND) 1.75 + if (NOT OPENGL_FOUND) 1.76 message (FATAL_ERROR "OpenGL not found!") 1.77 - endif (NOT OPEN_FOUND) 1.78 + endif (NOT OPENGL_FOUND) 1.79 1.80 include_directories( 1.81 ${OPENGL_INCLUDE_DIR} 1.82 @@ -419,6 +430,27 @@ 1.83 ${TARGET_LINK_LIBRARIES} 1.84 ) 1.85 1.86 + option(Option_GLUT_Dev "Build a GLUT Application." ON) 1.87 + 1.88 + if (Option_GLUT_Dev) 1.89 + 1.90 + find_package(GLUT) 1.91 + if (NOT GLUT_FOUND) 1.92 + message (FATAL_ERROR "GLUT not found!") 1.93 + endif() 1.94 + 1.95 + include_directories( 1.96 + ${GLUT_INCLUDE_DIR} 1.97 + ${INCLUDE_DIRECTORIES} 1.98 + ) 1.99 + 1.100 + target_link_libraries(${App_Name} 1.101 + ${GLUT_LIBRARIES} 1.102 + ${TARGET_LINK_LIBRARIES} 1.103 + ) 1.104 + 1.105 + endif() 1.106 + 1.107 endif () 1.108 1.109 ################################################################################ 1.110 @@ -445,3 +477,4 @@ 1.111 endif () 1.112 1.113 ################################################################################ 1.114 +