-
Notifications
You must be signed in to change notification settings - Fork 163
/
CMakeLists.txt
53 lines (42 loc) · 2.19 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
44
45
46
47
48
49
50
51
52
53
cmake_minimum_required (VERSION 3.16)
project (halley)
if (NOT HALLEY_PROJECT_EMBED)
set(HALLEY_PATH ${CMAKE_CURRENT_SOURCE_DIR})
set(BUILD_HALLEY_TOOLS 1 CACHE BOOL "Build editor and commandline tools")
set(BUILD_HALLEY_TESTS 1 CACHE BOOL "Build tests")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${HALLEY_PATH}/cmake/")
include(HalleyProject)
endif ()
set(HALLEY_BIN "bin")
set(HALLEY_LIB "lib")
if(CMAKE_SIZEOF_VOID_P EQUAL 4) # 32-bit build
set(HALLEY_BIN "bin32")
set(HALLEY_LIB "lib32")
endif()
include_directories(src/contrib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${HALLEY_BIN})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_CURRENT_SOURCE_DIR}/${HALLEY_BIN})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_SOURCE_DIR}/${HALLEY_BIN})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${CMAKE_CURRENT_SOURCE_DIR}/${HALLEY_BIN})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${HALLEY_BIN})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_CURRENT_SOURCE_DIR}/${HALLEY_BIN})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_SOURCE_DIR}/${HALLEY_BIN})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO ${CMAKE_CURRENT_SOURCE_DIR}/${HALLEY_BIN})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${HALLEY_LIB})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_CURRENT_SOURCE_DIR}/${HALLEY_LIB})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_SOURCE_DIR}/${HALLEY_LIB})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELWITHDEBINFO ${CMAKE_CURRENT_SOURCE_DIR}/${HALLEY_LIB})
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
SET(HALLEY_VERSION_MAJOR "2")
SET(HALLEY_VERSION_MINOR "0")
SET(HALLEY_VERSION_PATCH "0")
SET(HALLEY_VERSION "${HALLEY_VERSION_MAJOR}.${HALLEY_VERSION_MINOR}.${HALLEY_VERSION_PATCH}")
if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../halley-external")
set(BIN_DIR_LEN 0)
string(LENGTH "${CMAKE_BINARY_DIR}" BIN_DIR_LEN)
#math(EXPR BIN_DIR_LEN "${BIN_DIR_LEN} - 1")
string(SUBSTRING "${CMAKE_BINARY_DIR}" 0 "${BIN_DIR_LEN}" EXTERNAL_BIN_DIR)
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/../halley-external" "${EXTERNAL_BIN_DIR}-external")
endif()
add_subdirectory(deps)
add_subdirectory(src)