-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
48 lines (40 loc) · 1.27 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
cmake_minimum_required(VERSION 2.6.4)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/cotire)
include(cotire)
project (LightBulb)
if(MSVC)
# Force to always compile with W4
if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
string(REGEX REPLACE "/W[0-4]" "/W0" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
else()
add_definitions(/W0)
endif()
option(EnablePCH "EnablePCH" ON)
elseif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
# Update if necessary
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w")
option(EnablePCH "EnablePCH" OFF)
endif()
option(BUILD_SHARED_LIBS "BUILD_SHARED_LIBS" OFF)
option(EnableLightBulbApp "EnableLightBulbApp" ON)
option(EnableLightBulbExample "EnableLightBulbExample" ON)
option(EnableUnitTests "EnableUnitTests" OFF)
option(CMAKE_BUILD_TYPE "CMAKE_BUILD_TYPE" Release)
if(NOT CMAKE_DEBUG_POSTFIX)
set(CMAKE_DEBUG_POSTFIX d)
endif()
if(BUILD_SHARED_LIBS)
set(wxWidgets_CONFIG_OPTIONS --static=no)
else()
set(wxWidgets_CONFIG_OPTIONS --static=yes)
endif()
add_subdirectory(src/LightBulb)
if(EnableLightBulbApp)
add_subdirectory(src/LightBulbApp)
endif()
if(EnableLightBulbApp AND EnableLightBulbExample)
add_subdirectory(example/LightBulbExample)
endif()
if(EnableLightBulbApp AND EnableUnitTests)
add_subdirectory(tests/UnitTests)
endif()