This repository has been archived by the owner on Jun 6, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathCMakeLists.txt
76 lines (54 loc) · 2.38 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
72
73
74
75
76
######################################################################################
# CMake directives
######################################################################################
#Require 2.6 or higher.
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0 FATAL_ERROR)
INCLUDE( ${CMAKE_SOURCE_DIR}/BuildSysCMakeLib.cmake )
#setting link directory policy
IF(COMMAND cmake_policy)
CMAKE_POLICY(SET CMP0003 NEW)
ENDIF(COMMAND cmake_policy)
######################################################################################
# Project declaration and options
######################################################################################
#Project declaration
PROJECT(LIBLIGHTSTONE)
INITIALIZE_BUILD()
#Common Options
OPTION_LIBRARY_BUILD_STATIC(ON)
OPTION_LIBRARY_BUILD_SHARED(ON)
#Project specific options
OPTION(BUILD_EXAMPLES "Build liblightstone examples" ON)
######################################################################################
# Project specific package finding
######################################################################################
IF(NOT WIN32)
FIND_PACKAGE(libusb-1.0 REQUIRED)
INCLUDE_DIRECTORIES(${LIBUSB_1_INCLUDE_DIRS})
SET(LIBLIGHTSTONE_DEP_LIBS ${LIBUSB_1_LIBRARIES})
ELSE()
SET(WDK_PATH CACHE PATH "Path to WDK Installation")
INCLUDE_DIRECTORIES(${WDK_PATH}/inc/api ${WDK_PATH}/inc/crt ${WDK_PATH}/inc)
LINK_DIRECTORIES(${WDK_PATH}/lib/wxp/i386)
SET(LIBLIGHTSTONE_DEP_LIBS "hid.lib" "setupapi.lib")
ENDIF()
######################################################################################
# Project specific globals
######################################################################################
#library definitions
SET(LIBLIGHTSTONE_MAJOR_VERSION 1)
SET(LIBLIGHTSTONE_MINOR_VERSION 5)
SET(LIBLIGHTSTONE_BUILD_VERSION 0)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
SET(LIBLIGHTSTONE_VERSION ${LIBLIGHTSTONE_MAJOR_VERSION}.${LIBLIGHTSTONE_MINOR_VERSION}.${LIBLIGHTSTONE_BUILD_VERSION})
#library name definitions
CREATE_LIBRARY_LINK_NAME(lightstone)
INCLUDE_DIRECTORIES(${LIBLIGHTSTONE_INCLUDE_DIR})
LINK_DIRECTORIES(${LIBRARY_OUTPUT_PATH})
#If we build libusb staticly on apple, we need the proper frameworks
IF(BUILD_STATIC AND APPLE)
LIST(APPEND LIBLIGHTSTONE_DEP_LIBS "-framework IOKit" "-framework CoreFoundation")
ENDIF(BUILD_STATIC AND APPLE)
ADD_SUBDIRECTORY(include)
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(examples)