forked from Embroidermodder/libembroidery
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
71 lines (59 loc) · 1.61 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
66
67
68
69
70
71
cmake_minimum_required(VERSION 3.5)
#include(GNUInstallDirs)
project(libembroidery VERSION 1.0.0 LANGUAGES C CXX)
set(CMAKE_C_STANDARD 90)
set(CMAKE_C_STANDARD_REQUIRED True)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(LIBRARY_SOURCE_FILES libembroidery.c)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic -Wall -O2")
add_library(embroidery_static STATIC
${LIBRARY_SOURCE_FILES}
)
#compile SWIG if requested
add_subdirectory(experimental)
add_library(embroidery SHARED
${LIBRARY_SOURCE_FILES}
)
target_include_directories(embroidery
INTERFACE
$<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
PRIVATE
include
)
target_compile_definitions(embroidery PUBLIC LIBEMBROIDERY_SHARED)
target_include_directories(embroidery_static
INTERFACE
$<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
PRIVATE
include
)
add_executable(embroider
embroider-main.c
)
target_include_directories(embroider
INTERFACE
$<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
PRIVATE
include
)
# These link against the static libraries
# so we know that it is the current build that they're
# linked against.
if(WIN32)
target_link_libraries(embroider PRIVATE embroidery_static)
else(WIN32)
target_link_libraries(embroider PRIVATE embroidery_static m)
endif(WIN32)
install(
TARGETS
embroidery
embroidery_static
embroider
LIBRARY DESTINATION /usr/lib
ARCHIVE DESTINATION /usr/lib
RUNTIME DESTINATION /usr/bin/env
)