-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
65 lines (50 loc) · 1.64 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
cmake_minimum_required(VERSION 2.6)
project(tictactoy CXX)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif()
if(UNIX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W -Wall -pedantic -fno-rtti")
message(STATUS "CMAKE_CXX_COMPILER_VERSION = ${CMAKE_CXX_COMPILER_VERSION}")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG ")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -DNDEBUG")
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
elseif(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3 /wd4503 /wd4307 /EHsc /D_CRT_SECURE_NO_WARNINGS /D_SCL_SECURE_NO_WARNINGS")
set(CMAKE_CXX_FLAGS_RELEASE "/O2 /DNDEBUG")
set(CMAKE_CXX_FLAGS_DEBUG "/Od /D_DEBUG")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/Yd /O2 /DNDEBUG")
else(UNIX)
endif(UNIX)
add_subdirectory(faslib)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/faslib)
add_executable(tictactoe_its tictactoe_its.cpp)
add_executable(tictactoe tictactoe.cpp)
set( level_sh "${CMAKE_CURRENT_SOURCE_DIR}/level.sh")
set( board_sh "${CMAKE_CURRENT_SOURCE_DIR}/board.sh")
set( rand_sh "${CMAKE_CURRENT_SOURCE_DIR}/rand.sh")
if (WIN32)
set( level_sh "${CMAKE_CURRENT_SOURCE_DIR}/level.cmd")
set( board_sh "${CMAKE_CURRENT_SOURCE_DIR}/board.cmd")
set( rand_sh "${CMAKE_CURRENT_SOURCE_DIR}/rand.cmd")
endif()
add_custom_target(
rand
COMMAND
${rand_sh}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_custom_target(
board
COMMAND
${board_sh}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_custom_target(
level
COMMAND
${level_sh}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_dependencies(tictactoe rand level board)
add_dependencies(tictactoe_its rand level board)