-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
48 lines (36 loc) · 2.15 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
cmake_minimum_required(VERSION 3.10.2)
PROJECT(Milk)
SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)
message(STATUS "Windows平台")
FILE (GLOB HEADER_FILES
include/*.h
include/*.hpp
)
FILE (GLOB SOURCE_FILES
src/*.cpp
)
SOURCE_GROUP("Header Files" FILES ${HEADER_FILES})
SOURCE_GROUP("Source Files" FILES ${SOURCE_FILES})
ADD_EXECUTABLE(Prefilter ${HEADER_FILES} ${SOURCE_FILES})
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/include/)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/dependencies/include/)
set(FREEIMAGE_LIBRARIES "${PROJECT_SOURCE_DIR}/dependencies/lib/x64/FreeImage.lib")
TARGET_LINK_LIBRARIES(Prefilter ${FREEIMAGE_LIBRARIES})
set(FREEGLUT_LIBRARIES "${PROJECT_SOURCE_DIR}/dependencies/lib/x64/freeglutd.lib")
TARGET_LINK_LIBRARIES(Prefilter ${FREEGLUT_LIBRARIES})
set(FREEGLUT_LIBRARIES "${PROJECT_SOURCE_DIR}/dependencies/lib/x64/freeglut.lib")
TARGET_LINK_LIBRARIES(Prefilter ${FREEGLUT_LIBRARIES})
set(GLEW32_LIBRARIES "${PROJECT_SOURCE_DIR}/dependencies/lib/x64/glew32.lib")
TARGET_LINK_LIBRARIES(Prefilter ${GLEW32_LIBRARIES})
add_custom_command(TARGET Prefilter POST_BUILD # Adds a post-build event to MyTest
COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
"${PROJECT_SOURCE_DIR}/dependencies/bin/x64/freeglut.dll" # <--this is in-file
$<TARGET_FILE_DIR:Prefilter>) # <--this is out-file path
add_custom_command(TARGET Prefilter POST_BUILD # Adds a post-build event to MyTest
COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
"${PROJECT_SOURCE_DIR}/dependencies/bin/x64/glew32.dll" # <--this is in-file
$<TARGET_FILE_DIR:Prefilter>) # <--this is out-file path
add_custom_command(TARGET Prefilter POST_BUILD # Adds a post-build event to MyTest
COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
"${PROJECT_SOURCE_DIR}/dependencies/bin/x64/FreeImage.dll" # <--this is in-file
$<TARGET_FILE_DIR:Prefilter>) # <--this is out-file path