-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
46 lines (36 loc) · 1.42 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
cmake_minimum_required(VERSION 3.0)
project(crystal-viewer)
# name of application. replace 'app' with desired app name
set(APP_NAME crystal-viewer)
# path to main source file
add_executable(${APP_NAME}
src/main.cpp
src/CrystalViewer.hpp
src/Lattice.hpp
src/Slice.hpp
src/Node.hpp
)
# 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)
# 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
)