-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
31 lines (29 loc) · 1.22 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
cmake_minimum_required(VERSION 3.12)
project(VRPARSER LANGUAGES CXX)
add_subdirectory(parser)
set(TEST_EXECUTABLE vrtest)
set(MEX_NAME vrwrapper)
set(PARSER_LIB parser)
set(PARSER_INCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/parser/include)
set(PARSER_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/parser/source)
option(ADD_MATLAB "compile matlab mex" OFF)
include_directories(${PARSER_INCLUDE} ${PARSER_SOURCE})
aux_source_directory(${PROJECT_SOURCE_DIR}/test/source TEST_DIR)
add_executable(${TEST_EXECUTABLE} ${TEST_DIR})
target_link_libraries(${TEST_EXECUTABLE} PRIVATE ${PARSER_LIB})
set_target_properties(${TEST_EXECUTABLE} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${PARSER_LIB})
if(ADD_MATLAB)
find_package(Matlab REQUIRED)
include_directories(${Matlab_INCLUDE_DIRS})
add_subdirectory(parser/wrappers/matlab)
#target_link_libraries(${TEST_EXECUTABLE} PUBLIC ${MEX_NAME})
endif()
if(MSVC)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
set(BUILD_SHARED_LIBS TRUE)
endif()
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
target_link_libraries(${TEST_EXECUTABLE} PRIVATE Threads::Threads)
set_property(TARGET ${PARSER_LIB} PROPERTY CXX_STANDARD 17)
set_property(TARGET ${TEST_EXECUTABLE} PROPERTY CXX_STANDARD 17)