-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
mykaralw
committed
Jan 31, 2018
1 parent
b2221e1
commit 5e2111a
Showing
6 changed files
with
5,027 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
0.20171011 | ||
|
||
work version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
cmake_minimum_required(VERSION 2.8) | ||
project(libiio) | ||
|
||
# The build type "Release" adds some optimizations | ||
if (NOT CMAKE_BUILD_TYPE) | ||
set (CMAKE_BUILD_TYPE "Release") | ||
endif () | ||
|
||
# GCC on MacOs needs this option to use the clang assembler | ||
if ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (APPLE)) | ||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wa,-q") | ||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wa,-q") | ||
set (CMAKE_INCLUDE_SYSTEM_FLAG_C "-isystem") | ||
set (CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-isystem") | ||
endif () | ||
|
||
# Optimize to the current CPU and enable warnings | ||
if ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR | ||
(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR | ||
(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")) | ||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=native -Wall -Wextra") | ||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -Wall -Wextra") | ||
endif () | ||
|
||
# Enable C99 | ||
if (CMAKE_VERSION VERSION_LESS "3.1") | ||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99") | ||
else () | ||
set (CMAKE_C_STANDARD 99) | ||
endif () | ||
|
||
# Enable C++11 | ||
if (CMAKE_VERSION VERSION_LESS "3.1") | ||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11") | ||
else () | ||
set (CMAKE_CXX_STANDARD 11) | ||
endif () | ||
|
||
# Enable OpenMP | ||
find_package (OpenMP) | ||
if(OPENMP_FOUND) | ||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") | ||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") | ||
endif() | ||
|
||
# Link LibTIFF, LibJPEG, LibPNG, OpenMP | ||
find_package (TIFF REQUIRED) | ||
find_package (JPEG REQUIRED) | ||
find_package (PNG REQUIRED) | ||
include_directories (SYSTEM ${TIFF_INCLUDE_DIR} ${JPEG_INCLUDE_DIR} ${PNG_INCLUDE_DIRS}) | ||
link_libraries (${TIFF_LIBRARIES} ${JPEG_LIBRARIES} ${PNG_LIBRARIES}) | ||
|
||
set(SOURCE_FILES | ||
iio.c | ||
iio.h | ||
) | ||
|
||
set_property(SOURCE iio.c PROPERTY COMPILE_FLAGS "-Wno-unused-variable -Wno-unused-parameter -Wno-pointer-sign -Wno-parentheses -Wno-deprecated-declarations -Wno-unused-function") | ||
|
||
add_library(iio SHARED ${SOURCE_FILES}) | ||
set_target_properties(iio PROPERTIES VERSION 0.20171011 SOVERSION 0) |
Oops, something went wrong.