-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
49 lines (37 loc) · 1.51 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
cmake_minimum_required(VERSION 3.0)
# name of application. replace 'app' with desired app name
set(APP_NAME modelviewer)
project(${APP_NAME})
set(CMAKE_CXX_STANDARD 14)
# path to main source file
add_executable(${APP_NAME} src/main.cpp src/modelmanager.cpp)
# add allolib as a subdirectory to the project
add_subdirectory(allolib)
if (EXISTS ${CMAKE_CURRENT_LIST_DIR}/al_ext)
message("Buiding extensions in al_ext")
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/al_ext)
get_target_property(AL_EXT_LIBRARIES al_ext AL_EXT_LIBRARIES)
target_link_libraries(${APP_NAME} PRIVATE ${AL_EXT_LIBRARIES})
endif()
# link allolib to project
target_link_libraries(${APP_NAME} PRIVATE al)
# Additional compile flags
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(app_compile_flags
/bigobj /F2000000
)
endif()
# example line for find_package usage
# find_package(Qt5Core REQUIRED CONFIG PATHS "C:/Qt/5.12.0/msvc2017_64/lib" NO_DEFAULT_PATH)
# replace ${PATH_TO_INCLUDE_DIR} before including other libraries
# target_include_directories(${APP_NAME} PRIVATE ${PATH_TO_INCLUDE_DIR})
# replace ${PATH_TO_LIB_FILE} before linking other libraries
# target_link_libraries(${APP_NAME} PRIVATE ${PATH_TO_LIB_FILE})
# binaries are put into the ./bin directory by default
set_target_properties(${APP_NAME} PROPERTIES
CXX_STANDARD 14
CXX_STANDARD_REQUIRED ON
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/bin
RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_LIST_DIR}/bin
RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_CURRENT_LIST_DIR}/bin
)