forked from WasmVM/WasmVM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
43 lines (36 loc) · 1.38 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 3.5)
project(WasmVM)
set(PROJECT_ROOT ${CMAKE_CURRENT_LIST_DIR})
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11")
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS_DEBUG} -std=c++11")
# pthread
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
find_package(Threads REQUIRED)
add_subdirectory(src)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(PROJECT_TEST_DIR ${CMAKE_CURRENT_LIST_DIR}/test)
include(CTest)
add_compile_options("-g")
include(ExternalProject)
set($ENV{SHELL} "/bin/bash")
find_package(SkyPat)
if(NOT (SKYPAT_INCLUDE_DIR AND SKYPAT_LIBRARY_DIR))
ExternalProject_Add(SkyPat
PREFIX SkyPat
GIT_REPOSITORY https://github.com/skymizer/SkyPat.git
GIT_TAG v3.1.1
CONFIGURE_COMMAND "<SOURCE_DIR>/configure" "--prefix=<INSTALL_DIR>"
)
ExternalProject_Add_Step(SkyPat autogen
COMMAND "<SOURCE_DIR>/autogen.sh"
DEPENDEES download
DEPENDERS configure
)
set(SKYPAT_INCLUDE_DIR ${PROJECT_BINARY_DIR}/SkyPat/include)
set(SKYPAT_LIBRARY_DIR ${PROJECT_BINARY_DIR}/SkyPat/lib)
endif(NOT (SKYPAT_INCLUDE_DIR AND SKYPAT_LIBRARY_DIR))
include_directories(${SKYPAT_INCLUDE_DIR})
link_directories(${SKYPAT_LIBRARY_DIR})
add_subdirectory(test)
endif(CMAKE_BUILD_TYPE STREQUAL "Debug")