-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
60 lines (52 loc) · 1.58 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
cmake_minimum_required (VERSION 3.10)
project(plange)
enable_testing()
if (MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj") # MSVC++ fails without it
endif()
find_package(Git)
if (GIT_FOUND)
mark_as_advanced(
FORCE
git_executable
)
message(INFO " Initializing git submodules...")
execute_process(
COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
else()
message(WARNING " Git was not found. Uninitialized git submodules must be initialized manually.")
endif()
function(add_googletest)
set(BUILD_GMOCK OFF CACHE BOOL "")
set(BUILD_GTEST ON CACHE BOOL "")
set(INSTALL_GMOCK OFF CACHE BOOL "")
set(INSTALL_GTEST ON CACHE BOOL "")
set(gtest_force_shared_crt ON CACHE BOOL "Force gtest to used shared VC++ CRT")
add_subdirectory(source/googletest)
include_directories("${gtest_SOURCE_DIR}/include")
endfunction(add_googletest)
add_googletest()
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
if(NOT MSVC) # Remove condition once CMAKE supports this with Visual Studio 2017
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE)
endif()
add_subdirectory(source/utilities)
add_subdirectory(source/mpl)
add_subdirectory(source/collections)
add_subdirectory(source/parlex)
add_subdirectory(source/plc)
add_subdirectory(source/grammar_gen)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT plc)
mark_as_advanced(
FORCE
BUILD_GMOCK
BUILD_GTEST
BUILD_SHARED_LIBS
INSTALL_GTEST
gtest_build_samples
gtest_build_tests
gtest_disable_pthreads
gtest_force_shared_crt
gtest_hide_internal_symbols
)