-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
49 lines (36 loc) · 1.14 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
CMAKE_MINIMUM_REQUIRED(VERSION 3.25.1)
PROJECT(pujobot LANGUAGES C)
set(VERSION_MAJOR 0)
set(VERSION_MINOR 1)
set(VERSION_PATCH 0)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
find_package(OpenMP)
if (OPENMP_FOUND)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
endif()
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
set(CMAKE_C_FLAGS_DEBUG "-g")
set(CMAKE_C_FLAGS_RELEASE "-O3")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra")
SET(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin")
SET(LIBRARY_OUTPUT_PATH "${CMAKE_BINARY_DIR}/lib")
INCLUDE_DIRECTORIES(
"${CMAKE_CURRENT_SOURCE_DIR}/include"
"${CMAKE_CURRENT_SOURCE_DIR}/api"
"${CMAKE_CURRENT_SOURCE_DIR}/jkiss/include"
)
LINK_DIRECTORIES(${LIBRARY_OUTPUT_PATH})
ADD_SUBDIRECTORY(jkiss/src)
ADD_SUBDIRECTORY(src)
ENABLE_TESTING()
ADD_SUBDIRECTORY(test)
ADD_EXECUTABLE(demo demo.c)
TARGET_LINK_LIBRARIES(demo jkiss pujobot)
CONFIGURE_FILE (api/pujo.h.in ${CMAKE_CURRENT_SOURCE_DIR}/api/pujo.h @ONLY)
ADD_LIBRARY(pujo SHARED lib.c)
SET_TARGET_PROPERTIES(pujo PROPERTIES
SOVERSION 1
PUBLIC_HEADER api/pujo.h)
TARGET_LINK_LIBRARIES(pujo jkiss pujobot)