CMakeLists.txt 880 Bytes
Newer Older
1
2
3
4
cmake_minimum_required(VERSION 3.5)
project(DPsimExample)

# library configuration etc.
Markus Mirz's avatar
Markus Mirz committed
5
6
if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../Libraries/eigen)
	set(EIGEN3_INCLUDE_DIR ../../Libraries/eigen)
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
else()
	find_package(Eigen3 REQUIRED)
endif()

include_directories(${EIGEN3_INCLUDE_DIR} "../../Source")

if (NOT WIN32)
	# needed so CIMParser and arabica (which are first compiled into static libs)
	# can be included in the .so
	set(CMAKE_CXX_FLAGS "-fPIC")
	# we use PyArg_ParseTupleAndKeywords several times, which erroneously accepts
	# a char* array instead of a const char* array
	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-write-strings")
endif()

# enable C++11 support
set(CMAKE_CXX_STANDARD 11)

set(CMAKE_INCLUDE_CURRENT_DIR ON)

# add files
file(GLOB SOURCES *.cpp)

# targets
add_executable(${PROJECT_NAME} ${SOURCES})

target_link_libraries(DPsimExample dpsim)