forked from amzeratul/halley
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
55 lines (44 loc) · 2.27 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
54
55
cmake_minimum_required (VERSION 3.0)
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 (MSVC)
if(NOT "${CMAKE_GENERATOR}" MATCHES "(Win64|IA64)")
set(HALLEY_BIN "bin32")
set(HALLEY_LIB "lib32")
endif()
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}")
add_subdirectory(src)
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)
message("External dir will be ${EXTERNAL_BIN_DIR}-external")
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/../halley-external" "${EXTERNAL_BIN_DIR}-external")
endif()