Skip to content

Commit 0f854fb

Browse files
committed
CMake include files
1 parent fc08c26 commit 0f854fb

File tree

5 files changed

+13
-2
lines changed

5 files changed

+13
-2
lines changed

CMakeLists.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ cmake_minimum_required (VERSION 3.21.0)
33
set(CMAKE_CXX_STANDARD 17)
44
set(CMAKE_CXX_STANDARD_REQUIRED True)
55

6-
project (crowd-simulation)
6+
project(crowd-simulation)
7+
78
set(CMAKE_C_COMPILER /home/sami/sycl_workspace/llvm/build/bin/clang)
89
set(CMAKE_CXX_COMPILER /home/sami/sycl_workspace/llvm/build/bin/clang++)
910

@@ -12,4 +13,10 @@ include_directories(${SDL2_INCLUDE_DIRS})
1213

1314
add_executable(crowdsim src/main.cpp)
1415
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsycl")
15-
target_link_libraries(crowdsim ${SDL2_LIBRARIES})
16+
17+
add_subdirectory(include)
18+
19+
target_link_libraries(crowdsim PUBLIC ${SDL2_LIBRARIES} include)
20+
target_include_directories(crowdsim PUBLIC "${PROJECT_BINARY_DIR}" "${PROJECT_SOURCE_DIR}/include")
21+
22+
File renamed without changes.
File renamed without changes.

include/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
add_library(include Actor.cpp)

src/main.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include <CL/sycl.hpp>
22
#include <SDL2/SDL.h>
3+
#include "Actor.hpp"
34
#include <iostream>
45
using namespace std;
56

@@ -33,6 +34,8 @@ int main() {
3334

3435
draw();
3536

37+
Actor test = Actor({0, 2}, {3, 4}, {5,6}, 12, 3);
38+
3639
bool isQuit = false;
3740
SDL_Event event;
3841

0 commit comments

Comments
 (0)