Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/tutorial/Tutorial/CMakeLists.txt @ 88

Last change on this file since 88 was 42, checked in by nicolasc, 17 years ago

updated cml to detect tardis

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