fixed cmakelists.txt
This commit is contained in:
@@ -6,7 +6,7 @@ set(DEFAULT_BUILD_TYPE Debug)
|
|||||||
set(CMAKE_CXX_STANDARD 17)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
|
|
||||||
# Boost configuration
|
# Boost configuration
|
||||||
set(BOOST_COMPONENTS program_options)
|
set(BOOST_COMPONENTS program_options thread timer chrono)
|
||||||
|
|
||||||
###################### START_CMAKE #######################
|
###################### START_CMAKE #######################
|
||||||
cmake_minimum_required(VERSION 3.9.1)
|
cmake_minimum_required(VERSION 3.9.1)
|
||||||
@@ -23,7 +23,7 @@ if(NOT CMAKE_BUILD_TYPE)
|
|||||||
endif(NOT CMAKE_BUILD_TYPE)
|
endif(NOT CMAKE_BUILD_TYPE)
|
||||||
|
|
||||||
option(BUILD_SHARED_LIB "Build a shared lib instead of a static." OFF)
|
option(BUILD_SHARED_LIB "Build a shared lib instead of a static." OFF)
|
||||||
option(ENABLE_TESTING "Enables testing." OFF)
|
option(ENABLE_TESTING "Enables testing." ON)
|
||||||
|
|
||||||
#################### Adding Library #####################
|
#################### Adding Library #####################
|
||||||
file(GLOB_RECURSE SOURCES src/*.cpp)
|
file(GLOB_RECURSE SOURCES src/*.cpp)
|
||||||
@@ -59,7 +59,21 @@ endif()
|
|||||||
|
|
||||||
target_link_libraries(${PROJECT_NAME} PUBLIC ${WIRING_PI})
|
target_link_libraries(${PROJECT_NAME} PUBLIC ${WIRING_PI})
|
||||||
|
|
||||||
|
## EASYLOGGING
|
||||||
|
set(EASYLOGGING_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/${LIB_DIR}/easylogging)
|
||||||
|
add_library(Easylogging STATIC ${EASYLOGGING_INCLUDE_DIR}/easylogging++.cc)
|
||||||
|
|
||||||
|
target_include_directories(${PROJECT_NAME} PRIVATE ${EASYLOGGING_INCLUDE_DIR})
|
||||||
|
target_link_libraries(${PROJECT_NAME} PUBLIC Easylogging)
|
||||||
|
|
||||||
|
## CATCH
|
||||||
|
set(CATCH_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/tests)
|
||||||
|
add_library(Catch INTERFACE)
|
||||||
|
target_include_directories(Catch INTERFACE ${CATCH_INCLUDE_DIR})
|
||||||
|
|
||||||
|
## THREAD
|
||||||
|
find_package(Threads REQUIRED)
|
||||||
|
target_link_libraries(${PROJECT_NAME} PRIVATE ${Threads_LIBRARIES})
|
||||||
if(ENABLE_TESTING)
|
if(ENABLE_TESTING)
|
||||||
add_subdirectory(tests)
|
add_subdirectory(tests)
|
||||||
endif(ENABLE_TESTING)
|
endif(ENABLE_TESTING)
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.9.1)
|
|||||||
project(FlippR-Driver-Tests VERSION 0.1.0 LANGUAGES CXX)
|
project(FlippR-Driver-Tests VERSION 0.1.0 LANGUAGES CXX)
|
||||||
|
|
||||||
# Compile tests to output_path/tests
|
# Compile tests to output_path/tests
|
||||||
set(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/${OUTPUT_PATH}/tests)
|
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/${OUTPUT_PATH}/tests)
|
||||||
|
|
||||||
|
|
||||||
file(GLOB_RECURSE SOURCES *.cpp)
|
file(GLOB_RECURSE SOURCES *.cpp)
|
||||||
|
|||||||
Reference in New Issue
Block a user