-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
59 lines (41 loc) · 1.4 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
cmake_minimum_required(VERSION 3.1)
project(SimpleBeam)
set(BINARY_NAME ${CMAKE_PROJECT_NAME})
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
set(CMAKE_CXX_FLAGS "-Wall -Wextra")
set(CMAKE_CXX_FLAGS_DEBUG "-g")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
if(MSVC)
add_compile_options(/W4)
else()
add_compile_options(-Wall -Wextra -pedantic)
endif()
# Find BLAS and LAPACK libraries
find_package(BLAS REQUIRED)
find_package(LAPACK REQUIRED)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin)
include_directories(includes/utility)
add_executable(${BINARY_NAME} src/main.cpp src/Matrix.hpp src/Vector.hpp src/Node.hpp src/Material.hpp src/Element.cpp)
# Link BLAS and LAPACK libraries
# target_link_libraries(${BINARY_NAME} ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES})
target_link_libraries(${BINARY_NAME} ${LAPACK_LIBRARIES} lapacke)
# GoogleTest setup remains the same...
# Include GoogleTest
include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/5376968f6948923e2411081fd9372e71a59d8e77.zip
)
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) # For Windows
FetchContent_MakeAvailable(googletest)
include(CTest)
enable_testing()
# Only include test subdirectory if BUILD_TESTING is on
if (BUILD_TESTING)
add_subdirectory(tests)
endif()