-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
53 lines (43 loc) · 1.62 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
# OSIOEvents cmake build script.
cmake_minimum_required(VERSION 2.8)
project(OSIOEvents C)
# Check the build type
if (CMAKE_BUILD_TYPE STREQUAL "")
# CMake defaults to leaving CMAKE_BUILD_TYPE empty. This screws up
# differentiation between debug and release builds.
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build, options are: None (CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." FORCE)
endif ()
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Output paths.
set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/dist")
set(OSIOEvents_DATA_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/dist/data")
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/;${CMAKE_MODULE_PATH}")
if(APPLE)
set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64")
endif()
# Turn warnings and use C99.
if (${CMAKE_C_COMPILER_ID} STREQUAL MSVC)
# using Visual Studio
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4")
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
if(UNIX)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread")
endif()
# Export symbols from applications.
#set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--export-dynamic")
endif()
# Perform platform checks
include(${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake)
include(${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake)
include(${CMAKE_ROOT}/Modules/CheckLibraryExists.cmake)
# Set output dir.
set(EXECUTABLE_OUTPUT_PATH "${OSIOEvents_BINARY_DIR}/dist")
set(LIBRARY_OUTPUT_PATH "${OSIOEvents_BINARY_DIR}/dist")
# Add the current directory.
include_directories(
.
"${PROJECT_SOURCE_DIR}/include"
)
# Build the library
add_subdirectory(lib)