Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/Tutorial/CMakeLists.txt @ 77

Last change on this file since 77 was 49, checked in by nicolasc, 17 years ago

additional comments in CML

File size: 1.6 KB
Line 
1PROJECT(Tutorial)
2
3#force-set the compile on tardis machines, as default points to g++-3.3
4# only run this test on a lunix/unix machine
5IF (UNIX)
6  FIND_PROGRAM(UNAME_CMD "uname"
7        PATHS "/usr/bin /bin")
8  IF(NOT UNAME_CMD)
9        MESSAGE("Unable to find uname. Tardis-Check cannot be done.")
10  ENDIF(NOT UNAME_CMD)
11  EXECUTE_PROCESS(
12        COMMAND "${UNAME_CMD}" "-n"
13        RESULT_VARIABLE UNAME_RV
14        ERROR_VARIABLE UNAME_EV
15        OUTPUT_VARIABLE UNAME_OV)
16#MESSAGE("Print: UNAME_RV ${UNAME_RV}")
17  IF (NOT "${UNAME_RV}" STREQUAL "0")
18        MESSAGE("ERROR: uname terminated unclean.")
19  ENDIF (NOT "${UNAME_RV}" STREQUAL "0")
20  # check wheter we are on a tardis machine
21  IF ("${UNAME_OV}" MATCHES "tardis")
22    SET (IS_TARDIS "tardis")
23  ENDIF ("${UNAME_OV}" MATCHES "tardis")
24  # if on tardis change compiler
25  IF (IS_TARDIS)
26  MESSAGE("System is a TARDIS: Setting Compiler to g++-3.4.3")
27  SET(CMAKE_CXX_COMPILER "g++-3.4.3")
28  ENDIF(IS_TARDIS)
29ENDIF (UNIX)
30
31# create a few variables to simplify life
32SET(SRC_FILES src/main.cpp)
33SET(INC_FILES src/ExampleApplication.h  src/ExampleFrameListener.h  src/ExampleLoadingBar.h)
34
35#This sets where to look for "Find*.cmake" files
36SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
37#Performs the search and sets the variables
38FIND_PACKAGE(OGRE)
39FIND_PACKAGE(OIS)
40
41#Sets the search paths for the linking
42LINK_DIRECTORIES(${OGRE_LIB_DIR} ${OIS_LIB_DIR})
43#Sets the search path for include files
44INCLUDE_DIRECTORIES(${OGRE_INCLUDE_DIR} ${OIS_INCLUDE_DIR})
45
46#Creates an executable
47ADD_EXECUTABLE(main ${SRC_FILES} ${INC_FILES})
48#Links the executable against OGRE and OIS
49TARGET_LINK_LIBRARIES(main ${OGRE_LIBRARIES} ${OIS_LIBRARIES})
50
Note: See TracBrowser for help on using the repository browser.