forked from lvandeve/lodepng
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
31 lines (24 loc) · 1000 Bytes
/
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
cmake_minimum_required(VERSION 2.8)
project(lodepng)
find_package(SDL)
set(CMAKE_CXX_FLAGS "-W -Wall -Wextra -ansi -pedantic")
set(CMAKE_CXX_FLAGS_DEBUG "-g")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
include_directories(.)
add_library(lodepng STATIC lodepng.cpp)
set_target_properties(lodepng PROPERTIES PUBLIC_HEADER lodepng.h)
install(TARGETS lodepng PUBLIC_HEADER)
add_executable(unittest lodepng_util.cpp lodepng_unittest.cpp)
target_link_libraries(unittest lodepng)
add_executable(pngdetail lodepng_util.cpp pngdetail.cpp)
target_link_libraries(pngdetail lodepng)
install(TARGETS pngdetail)
if (SDL_FOUND)
add_executable(benchmark lodepng_benchmark.cpp)
target_include_directories(benchmark PRIVATE ${SDL_INCLUDE_DIRS})
target_link_libraries(benchmark lodepng ${SDL_LIBRARY})
add_executable(showpng examples/example_sdl.cpp)
target_include_directories(benchmark PRIVATE ${SDL_INCLUDE_DIRS})
target_link_libraries(showpng lodepng ${SDL_LIBRARY})
install(TARGETS showpng)
endif(SDL_FOUND)