-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
43 lines (33 loc) · 1.6 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
CMAKE_MINIMUM_REQUIRED (VERSION 2.6)
project(math CXX)
set(CMAKE_MACOSX_RPATH 1)
if (MINGW)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static-libgcc")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libstdc++ -static-libgcc")
set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS} -static-libgcc")
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS} -static-libstdc++")
endif()
if(DEFINED ENV{COVERAGE} AND NOT ENV{COVERAGE} STREQUAL "0")
message("Enabling code coverage")
set(GCC_COVERAGE_COMPILE_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage")
set(GCC_COVERAGE_LINK_FLAGS "-lgcov --coverage")
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS}" )
set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GCC_COVERAGE_LINK_FLAGS}" )
endif()
set(CMAKE_SHARED_LIBRARY_PREFIX "")
set(CMAKE_STATIC_LIBRARY_PREFIX "")
set(CMAKE_IMPORT_LIBRARY_PREFIX "")
set(LIBSASS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/.." CACHE PATH "Path to libsass directory")
set(LIBSASS_LIBRARY_DIR "${LIBSASS_DIR}/lib" CACHE PATH "Path to libsass libraries")
set(LIBSASS_INCLUDE_DIR "${LIBSASS_DIR}/include" CACHE PATH "Path to libsass includes")
link_directories("${LIBSASS_LIBRARY_DIR}")
include_directories("${LIBSASS_INCLUDE_DIR}")
find_library(SASS_LIBRARY NAMES sass
HINTS "${CMAKE_CURRENT_SOURCE_DIR}/../lib"
)
add_library(math SHARED src/math.cpp)
target_link_libraries(math LINK_PUBLIC sass)
# errors wrongly sometimes?
# if(NOT SASS_LIBRARY)
# message( FATAL_ERROR "sass library was not found" )
# endif()