-
-
Notifications
You must be signed in to change notification settings - Fork 29
/
CMakeLists.txt
39 lines (30 loc) · 1.02 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
CMAKE_MINIMUM_REQUIRED (VERSION 3.1)
PROJECT (ojudge)
set(Boost_NO_BOOST_CMAKE ON)
FIND_PACKAGE (Wt REQUIRED Wt HTTP )
FIND_PACKAGE (Boost COMPONENTS filesystem program_options REQUIRED)
FIND_PACKAGE (PkgConfig REQUIRED)
pkg_check_modules(OATH REQUIRED IMPORTED_TARGET liboath)
pkg_check_modules(GRAPHICSMAGICK REQUIRED IMPORTED_TARGET GraphicsMagick++)
SET (CMAKE_CXX_FLAGS "-O2 -std=c++17 -g")
SET(CMAKE_BINARY_DIR ${CMAKE_BINARY_DIR}/build)
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
SET (OJUDGE_VERSION_MAJOR 0)
SET (OJUDGE_VERSION_MINOR 3)
SET (OJUDGE_VERSION_RELEASE 1)
add_custom_command (
OUTPUT version.h
DEPENDS genversion.sh
COMMAND ./genversion.sh ${OJUDGE_VERSION_MAJOR} ${OJUDGE_VERSION_MINOR} ${OJUDGE_VERSION_RELEASE}
)
add_custom_target (
do_generateversion ALL
DEPENDS version.h
)
add_subdirectory (lib)
add_executable (ojudgeapp ojudge.cpp)
add_dependencies (ojudgeapp do_generateversion)
TARGET_LINK_LIBRARIES (ojudgeapp
ojudge
)