-
Notifications
You must be signed in to change notification settings - Fork 13
/
CMakeLists.txt
67 lines (47 loc) · 2.24 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
56
57
58
59
60
61
62
63
64
65
66
67
cmake_minimum_required(VERSION 3.13.0)
# --[ Alif version ] ---------------------------------------------------------------
project(AlifProject VERSION 3.0.33 DESCRIPTION "Alif Programming Language - Compiler.")
message("-- [ Alif version ${CMAKE_PROJECT_VERSION} ]")
# --[ Uninstall ] ------------------------------------------------------------------
if(TARGET uninstall)
message("[!] By default, CMake does not provide the 'uninstall' target.")
message("[!] If you want to uninstall your project You need to delete the files listed in 'install_manifest.txt' file.")
return()
endif()
# --[ C++ Compiler ] ---------------------------------------------------------------
if (WIN32)
if(EXISTS "C:/Alif3/")
# Windows - MinGW64 - Boost
message("[*] Switch default compiler to 'C:/Alif3/gcc'")
set(CMAKE_C_COMPILER "C:/Alif3/gcc/bin/gcc.exe")
set(CMAKE_C_COMPILER:FILEPATH "C:/Alif3/gcc/bin/gcc.exe")
set(CMAKE_CXX_COMPILER "C:/Alif3/gcc/bin/g++.exe")
set(CMAKE_CXX_COMPILER:FILEPATH "C:/Alif3/gcc/bin/g++.exe")
endif()
endif()
# --[ Boost ] ----------------------------------------------------------------------
set(Boost_Version_Needed "1.74.0")
if (WIN32)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
IF(EXISTS "C:/Alif3/")
# Windows - MinGW64 - Boost
set(Boost_Root "C:/Alif3/boost/include")
set(Boost_Lib "C:/Alif3/boost/lib")
endif()
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# Remove this line to force building Alif compiler using MSVC.
message("[!] Sorry. Alif don't support Microsoft C++ compiler on Windows, Please use MinGW64.")
return()
IF(EXISTS "C:/Alif3/")
# Windows - Microsoft C++ - Boost
set(Boost_Root "C:/Alif3/boost/include")
set(Boost_Lib "C:/Alif3/boost/lib")
endif()
endif()
endif()
# --[ C++ ] ------------------------------------------------------------------------
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# --[ Directories ] ----------------------------------------------------------------
# Alif Compiler Source Code
add_subdirectory(${AlifProject_SOURCE_DIR}/src Alif)