-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
66 lines (50 loc) · 1.98 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
cmake_minimum_required(VERSION 2.8)
project( Moniteor )
set(EXE_NAME Moniteor)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/")
message("CMAKE_MODULE_PATH : " ${CMAKE_MODULE_PATH})
message("PROJECT_SOURCE_DIR : ${PROJECT_SOURCE_DIR}" )
macro(GroupSources curdir relativePath)
file(GLOB children RELATIVE
${PROJECT_SOURCE_DIR}/${relativePath}/${curdir}
${PROJECT_SOURCE_DIR}/${relativePath}${curdir}/*)
foreach(child ${children})
if(IS_DIRECTORY ${PROJECT_SOURCE_DIR}/${relativePath}/${curdir}/${child})
GroupSources(${curdir}/${child} ${relativePath})
else()
string(REPLACE "/" "\\" groupname ${curdir})
source_group(${groupname} FILES
${PROJECT_SOURCE_DIR}/${relativePath}/${curdir}/${child})
endif()
endforeach()
endmacro()
# Sources.
file(
GLOB_RECURSE
SRC_FILES
src/*
)
GroupSources(src "//")
# Exclude ZERO_CHECK project
SET(CMAKE_SUPPRESS_REGENERATION TRUE)
# Set C++11
set (CMAKE_CXX_STANDARD 11)
# FIND REQUIRED PACKAGES
find_package(wxWidgets REQUIRED)
message("wxWidgets_LIB_DIR : ${wxWidgets_LIB_DIR}" )
message("wxWidgets_ROOT_DIR : ${wxWidgets_ROOT_DIR}" )
link_directories(${wxWidgets_LIB_DIR})
include_directories(${wxWidgets_ROOT_DIR}/include)
include_directories(${wxWidgets_ROOT_DIR}/include/msvc)
#http://stackoverflow.com/questions/33400777/error-lnk2019-unresolved-external-symbol-main-referenced-in-function-int-cde
# force Unicode over Multi-byte
add_definitions(-DUNICODE -D_UNICODE)
#wxwidget seems to use some depracated functions : disable warnings on visual studio about it
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
add_executable(${EXE_NAME} ${SRC_FILES})
#set(LIBS)
#target_link_libraries(${EXE_NAME} ${LIBS})
set_target_properties(${EXE_NAME} PROPERTIES LINK_FLAGS_RELEASE "/SUBSYSTEM:WINDOWS")
set_target_properties(${EXE_NAME} PROPERTIES LINK_FLAGS_DEBUG "/SUBSYSTEM:WINDOWS")
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT Moniteor)