forked from H-uru/libhsplasma
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
47 lines (38 loc) · 1.55 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
project(libhsplasma)
cmake_minimum_required(VERSION 2.8.9)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
set(CMAKE_C_FLAGS_DEBUG "-DDEBUG ${CMAKE_C_FLAGS_DEBUG}")
set(CMAKE_CXX_FLAGS_DEBUG "-DDEBUG ${CMAKE_CXX_FLAGS_DEBUG}")
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR
CMAKE_CXX_COMPILER_ID MATCHES ".*Clang")
set(WARNING_FLAGS "-Wall -Wextra -Wno-unused-parameter")
set(CMAKE_CXX_FLAGS "-std=c++0x ${WARNING_FLAGS} ${CMAKE_CXX_FLAGS}")
set(CMAKE_C_FLAGS "${WARNING_FLAGS} ${CMAKE_C_FLAGS}")
endif()
if(APPLE)
add_definitions("-DMACOSX")
set(CMAKE_CXX_FLAGS "-stdlib=libc++ ${CMAKE_CXX_FLAGS}")
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11")
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
endif()
if(MSVC)
add_definitions("-D_CRT_SECURE_NO_WARNINGS")
set(CMAKE_CXX_FLAGS "/wd4996 /wd4244 /wd4251 ${CMAKE_CXX_FLAGS}")
set(CMAKE_C_FLAGS "/wd4996 /wd4244 /wd4251 ${CMAKE_C_FLAGS}")
endif()
# Python is disabled by default because most projects don't need it
# Tools are still enabled because they're fast and occasionally useful
option(DISABLE_PYTHON "Don't build HSPlasma Python integration" ON)
option(DISABLE_TOOLS "Don't build the HSPlasma tools" OFF)
option(DISABLE_NET "Don't build HSPlasmaNet" OFF)
add_subdirectory(core)
if(NOT DISABLE_PYTHON)
add_subdirectory(Python)
endif()
if(NOT DISABLE_TOOLS)
add_subdirectory(Tools)
endif()
if(NOT DISABLE_NET)
add_subdirectory(net)
endif()
install(EXPORT HSPlasma-targets DESTINATION share/cmake/HSPlasma)