forked from wisk/medusa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
76 lines (59 loc) · 2.19 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_minimum_required(VERSION 2.8)
# We only need Debug and Release configuration types
set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING
"only Debug and Release configurations are available" FORCE)
# project name
project(Medusa)
# medusa version
set(VERSION_MAJOR 0)
set(VERSION_MINOR 2)
set(VERSION_PATCH 0)
# We need boost
set(Boost_USE_STATIC_LIBS OFF) # We want to link boost dynamically
if (MSVC)
add_definitions(-DBOOST_ALL_DYN_LINK)
endif()
find_package(Boost 1.46 COMPONENTS system filesystem thread date_time REQUIRED)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin)
# add include directory
include_directories(
${CMAKE_SOURCE_DIR}/inc
${Boost_INCLUDE_DIRS}
)
link_directories(
${Boost_LIBRARY_DIRS}
)
# Found it in CMakeLists.txt from keepassx project
if("${CMAKE_CXX_COMPILER}" MATCHES "clang(\\+\\+)?$" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(CMAKE_COMPILER_IS_CLANGXX 1)
endif()
if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX)
add_definitions("-std=c++11")
endif()
# add source directory
add_subdirectory(src)
# add packaging directory
add_subdirectory(package)
find_package(Doxygen)
if (DOXYGEN_FOUND)
message("Doxygen found, I'll generate documentations for you")
set(DOCROOT ${CMAKE_SOURCE_DIR}/doc/api)
configure_file(${DOCROOT}/Doxyfile.in ${DOCROOT}/Doxyfile @ONLY)
set(DOC_TARGET_NAME "doc")
if (MSVC_IDE)
set(DOC_TARGET_NAME "DOCUMENTATION")
endif()
add_custom_target(${DOC_TARGET_NAME}
${DOXYGEN_EXECUTABLE} ${DOCROOT}/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with doxygen" VERBATIM
)
endif()