Initial upload
This commit is contained in:
32
CMakeLists.txt
Normal file
32
CMakeLists.txt
Normal file
@@ -0,0 +1,32 @@
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
|
||||
set(PROJECT_NAME SimpleRayTracer)
|
||||
|
||||
project(${PROJECT_NAME} LANGUAGES C)
|
||||
|
||||
find_package(OpenMP REQUIRED)
|
||||
|
||||
set(EXTERNAL_DIR "${CMAKE_SOURCE_DIR}/external/")
|
||||
set(SOURCE_DIR "${CMAKE_SOURCE_DIR}/source/")
|
||||
set(HEADER_DIR "${CMAKE_SOURCE_DIR}/header/")
|
||||
|
||||
# Recursively find all .c files in the Sources directory
|
||||
file(GLOB_RECURSE SOURCES "${SOURCE_DIR}/*.c")
|
||||
|
||||
# Define the executable instead of a library
|
||||
add_executable(${PROJECT_NAME} ${SOURCES})
|
||||
|
||||
# Include directories
|
||||
target_include_directories(${PROJECT_NAME} PRIVATE ${EXTERNAL_DIR})
|
||||
target_include_directories(${PROJECT_NAME} PRIVATE ${HEADER_DIR})
|
||||
|
||||
if(OpenMP_C_FOUND)
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE OpenMP::OpenMP_C)
|
||||
endif()
|
||||
|
||||
|
||||
# Specify the output directory for the EXE file
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES
|
||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
|
||||
)
|
||||
Reference in New Issue
Block a user