forked from manojgudi/PMC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
51 lines (45 loc) · 1.57 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
########################################################################
# Project setup
########################################################################
cmake_minimum_required(VERSION 2.6)
project(PMC CXX C)
enable_testing()
set(PMC_VERSION "0.0.0")
set(PMC_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(PMC_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
set(PMC_INCLUDE_DIRS ${PMC_SOURCE_DIR}/include)
set(PMC_LIBRARIES pmc)
list(APPEND CMAKE_MODULE_PATH ${PMC_SOURCE_DIR}/cmake/Modules)
include(CMakeDefsHelper)
include(CheckTypeSize)
enable_language(C)
check_type_size("void*[8]" SIZEOF_CPU BUILTIN_TYPES_ONLY)
if(CMAKE_COMPILER_IS_GNUCXX AND ${SIZEOF_CPU} EQUAL 64)
add_definitions(-fPIC)
endif()
if(CMAKE_COMPILER_IS_GNUCXX)
add_definitions(-Wall)
add_definitions(-Wunused)
add_definitions(-fvisibility=hidden)
add_definitions(-fvisibility-inlines-hidden)
endif()
########################################################################
# Component names for install rules
########################################################################
if (NOT DEFINED PMC_COMP_DEVEL)
set(PMC_COMP_DEVEL "devel")
endif()
if (NOT DEFINED PMC_COMP_RUNTIME)
set(PMC_COMP_RUNTIME "runtime")
endif()
if (NOT DEFINED PMC_COMP_PYTHON)
set(PMC_COMP_PYTHON "python")
endif()
########################################################################
# Setup cmake subdirs
########################################################################
include_directories(include)
add_subdirectory(include/PMC)
add_subdirectory(lib)
add_subdirectory(python/PMC)
add_subdirectory(tests)