Skip to content

Commit

Permalink
Add CMakeLists
Browse files Browse the repository at this point in the history
  • Loading branch information
ValentinV95 authored Nov 21, 2022
1 parent 199cefc commit c4c52c7
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
cmake_minimum_required(VERSION 2.8)

include_directories(include gtest)

# BUILD
add_subdirectory(samples)
add_subdirectory(test)
add_subdirectory(gtest)
11 changes: 11 additions & 0 deletions gtest/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
set(target "gtest")

add_library(${target} STATIC gtest-all.cc)

if((${CMAKE_CXX_COMPILER_ID} MATCHES "GNU" OR
${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") AND
(${CMAKE_SYSTEM_NAME} MATCHES "Linux"))
set(pthread "-pthread")
endif()

target_link_libraries(${target} ${pthread})
4 changes: 4 additions & 0 deletions samples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
file(GLOB hdrs "*.h*" "../include/*.h")
file(GLOB srcs "*.cpp")

add_executable(matrix ${srcs} ${hdrs})
8 changes: 8 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
set(target test_matrix)

#file(GLOB hdrs "*.h*" "../include/*.h" "../gtest/*.h")
file(GLOB hdrs "*.h*")
file(GLOB srcs "*.cpp")

add_executable(${target} ${srcs} ${hdrs})
target_link_libraries(${target} gtest)

0 comments on commit c4c52c7

Please sign in to comment.