INITIALIZATION
[QNQ.git] / CMakeLists.txt
blob968f899b56477f285b91104f396559c2dc9766fe
1 # The name of our project is "QNQ". CMakeLists file in this project can
2 # refer to the root source directory of the project as ${QNQ_SOURCE_DIR}
3 # and to the root binary directory of the project as ${QNQ_BINARY_DIR}.
5 # Guarantee the version of CMake is 2.6 at least.
6 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
7 PROJECT(QNQ)
9 #This option used to tell the complier wether to debug it.
10 OPTION(DEFINE_DEBUG
11   "Build the project using debugging code"
12   OFF)
13 IF(DEFINE_DEBUG)
14   MESSAGE("Adding Debug flag...")
15   ADD_DEFINITIONS(-DDEBUG)
16   SET(CMAKE_BUILD_TYPE Debug)
17   MESSAGE("Build type is " ${CMAKE_BUILD_TYPE})
18 ENDIF(DEFINE_DEBUG)
20 #Distinguish the different system.
21 IF(WIN32)
22   MESSAGE(STATUS "The current os is M$-Win, a bad os!")
23   ADD_DEFINITIONS(-DWIN32)
24 ELSE(WIN32)
25   MESSAGE(STATUS "The current os is *nix")
26   ADD_DEFINITIONS(-DUNIX)
27 ENDIF(WIN32)
29 if(UNIX)
30   INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/FreeRecite DESTINATION /usr/share)
31 ENDIF(UNIX)
33 ADD_SUBDIRECTORY(src)
35 CONFIGURE_FILE(
36   "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
37   "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
38   IMMEDIATE @ONLY)
40 ADD_CUSTOM_TARGET(uninstall
41   "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")