-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add basic build environment using CMake
- Loading branch information
Andre Puschmann
committed
Jan 30, 2012
1 parent
4e00869
commit 02abf09
Showing
3 changed files
with
76 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 @@ | ||
build |
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,23 @@ | ||
######################################################################## | ||
# Prevent in-tree builds | ||
######################################################################## | ||
IF(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) | ||
MESSAGE(FATAL_ERROR "Prevented in-tree built. This is bad practice.") | ||
ENDIF(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) | ||
|
||
######################################################################## | ||
# Project setup | ||
####################################################################### | ||
CMAKE_MINIMUM_REQUIRED (VERSION 2.6) | ||
PROJECT (NEON_MATH) | ||
ENABLE_TESTING() | ||
LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules") | ||
|
||
ADD_SUBDIRECTORY (src) | ||
|
||
# Make sure the compiler can find include files | ||
include_directories (${NEON_MATH_SOURCE_DIR}/src) | ||
|
||
# Make sure the linker can find the library once it is built. | ||
link_directories (${NEON_MATH_BINARY_DIR}/src) | ||
|
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,52 @@ | ||
######################################################################## | ||
# Build the library from source files | ||
######################################################################## | ||
SET(math_neon_sources | ||
math_acosf.c | ||
math_asinf.c | ||
math_atan2f.c | ||
math_atanf.c | ||
math_ceilf.c | ||
math_cosf.c | ||
math_coshf.c | ||
math_expf.c | ||
math_fabsf.c | ||
math_floorf.c | ||
math_fmodf.c | ||
math_frexpf.c | ||
math_invsqrtf.c | ||
math_ldexpf.c | ||
math_log10f.c | ||
math_logf.c | ||
math_mat2.c | ||
math_mat3.c | ||
math_mat4.c | ||
math_modf.c | ||
math_powf.c | ||
math_runfast.c | ||
math_sincosf.c | ||
math_sinf.c | ||
math_sinfv.c | ||
math_sinhf.c | ||
math_sqrtf.c | ||
math_sqrtfv.c | ||
math_tanf.c | ||
math_tanhf.c | ||
math_vec2.c | ||
math_vec3.c | ||
math_vec4.c | ||
) | ||
|
||
set(CMAKE_CXX_COMPILER g++) | ||
set(CMAKE_C_COMPILER gcc) | ||
set(CMAKE_CXX_FLAGS "-std=gnu99 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp") | ||
set(CMAKE_C_FLAGS ${CMAKE_CXX_FLAGS}) #same flags for C sources | ||
|
||
# Static library (test code can link against this) | ||
ADD_LIBRARY(math_neon SHARED ${math_neon_sources}) | ||
|
||
######################################################################## | ||
# Add executables and link to libraries | ||
######################################################################## | ||
ADD_EXECUTABLE (math_debug math_debug.c) | ||
TARGET_LINK_LIBRARIES (math_debug math_neon m) |