-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
44 lines (36 loc) · 1.33 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
cmake_minimum_required(VERSION 3.7)
project(GenerativeArt)
set(CMAKE_CXX_STANDARD 14)
# production
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -fpermissive -std=c++14 -O3 -Wall -Wextra -pedantic -Wno-unused-parameter")
# search for pkg-config
include (FindPkgConfig)
if(NOT PKG_CONFIG_FOUND)
message (FATAL_ERROR "pkg-config not found")
endif()
# check for libpng
pkg_check_modules (LIBPNG libpng12 REQUIRED)
if (NOT LIBPNG_FOUND)
message(FATAL_ERROR "You don't seem to have libpng16 development libraries installed")
else()
include_directories (${LIBPNG_INCLUDE_DIRS})
link_directories (${LIBPNG_LIBRARY_DIRS})
link_libraries (${LIBPNG_LIBRARIES})
endif()
include(FindOpenMP)
if(NOT OPENMP_FOUND)
message("OpenMP not found. Trying '-fopenmp=libiomp5'")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp=libiomp5")
else()
message("OpenMP found: ${OpenMP_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif()
include_directories(${PROJECT_SOURCE_DIR}/includes
${PROJECT_SOURCE_DIR}/CLI11
${PROJECT_SOURCE_DIR}/png++
/opt/Vc/include/)
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
set(CMAKE_EXE_LINKER_FLAGS "-static-libstdc++ -static-libgcc")
endif()
set(SOURCES sources/main.cpp sources/FunctionPool.cpp)
add_executable(GenerativeArt ${SOURCES} ${LIBPNG_LINK_FLAGS})