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
54
|
cmake_minimum_required (VERSION 2.8)
project(SuperSimpleTypeSystem)
option (DEBUG "Enable debug flags and macros in project" TRUE)
if (WIN32)
if (MINGW)
message ("Compiling on Windows is undested.")
# THIS IS UNTESTED.
# On Wine (and, presumably ReactOS) (Using MingW) we need to pass -gdwarf-2
# to ba able to get traceback information. This is not ideal.
# On Windows we need to use cv2pdb (https://github.com/rainers/cv2pdb) to
# provide debug information.
# This can not be tested using cross-compile methods with MingW and Wine.
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 -Wall -gdwarf-2")
set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -std=c11 -Wall -g -gdwarf-2")
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -std=c11 -Wall -gdwarf-2")
elseif (MSVC)
message ("MSVC is not supported, Yet. Patches welcome!")
endif ()
else ()
# We need -rdynamic to get the traceback information on *nix.
# This may not work on all non-windows targets. FIXME.
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 -Wall -rdynamic")
set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -std=c11 -Wall -g -rdynamic")
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -std=c11 -Wall -rdynamic")
endif ()
# add a target to generate API documentation with Doxygen
find_package(Doxygen)
if(DOXYGEN_FOUND)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
add_custom_target(doc
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen" VERBATIM
)
endif(DOXYGEN_FOUND)
add_subdirectory (src)
include_directories (${CMAKE_SOURCE_DIR}/src/)
add_subdirectory (tests)
add_library (ssts SHARED ${SSTS_SRC})
enable_testing()
add_test (test tests/ssts_test)
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --extra-verbose)
|