-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
50 lines (38 loc) · 1.45 KB
/
CMakeLists.txt
File metadata and controls
50 lines (38 loc) · 1.45 KB
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
cmake_minimum_required(VERSION 3.10)
project(FastviewGener)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Create build directories for each external dependency
#CMAKE_BINARY_DIR: the project build DIR
set(BUILD_DIR ${CMAKE_BINARY_DIR})
set(LIBTIFF_INSTALL_DIR ${BUILD_DIR}/libtiff/install)
set(YAMLCPP_INSTALL_DIR ${BUILD_DIR}/yaml_cpp/install)
set(STBIMAGE_DIR ${CMAKE_SOURCE_DIR}/trd_party/stb)
set(LIBTIFF_DLL_DIR ${LIBTIFF_INSTALL_DIR}/bin)
add_executable(FastviewGener
core/src/main.cpp
core/src/Reader.cpp
core/src/Logger.cpp
core/src/Satellite.cpp
core/src/Stretch.cpp
)
# Add include directories for each external library
include_directories(
${LIBTIFF_INSTALL_DIR}/include
${CMAKE_SOURCE_DIR}/core/include
${YAMLCPP_INSTALL_DIR}/include
${STBIMAGE_DIR}
)
# Link the external libraries to the executable
find_package(TIFF REQUIRED PATHS ${LIBTIFF_INSTALL_DIR}/lib/cmake/tiff)
find_package(yaml-cpp REQUIRED PATHS ${YAMLCPP_INSTALL_DIR}/lib/cmake/yaml-cpp)
target_link_libraries(FastviewGener
${LIBTIFF_INSTALL_DIR}/lib/tiff.lib
${LIBTIFF_INSTALL_DIR}/lib/tiffxx.lib
${YAMLCPP_INSTALL_DIR}/lib/yaml-cpp.lib
)
add_custom_command(TARGET FastviewGener POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${LIBTIFF_DLL_DIR}/tiff.dll
$<TARGET_FILE_DIR:FastviewGener>/tiff.dll)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)