forked from possan/csid-mod
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
24 lines (20 loc) · 1.09 KB
/
CMakeLists.txt
File metadata and controls
24 lines (20 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
cmake_minimum_required(VERSION 3.0.2)
project(cppsid)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_EXTENSIONS NO)
find_package(SDL2 CONFIG REQUIRED)
# ix buggy sdl2: https://stackoverflow.com/questions/45730098/cmake-leading-or-trailing-whitespace-policy-cmp0004
string(STRIP ${SDL2_LIBRARIES} SDL2_LIBRARIES)
add_library(cppsid STATIC ${CMAKE_SOURCE_DIR}/src/libcsidlight.c ${CMAKE_SOURCE_DIR}/src/cppsid.cpp)
target_link_libraries(cppsid PRIVATE ${SDL2_LIBRARIES})
include_directories(${SDL2_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/include)
#include_directories(${CMAKE_SOURCE_DIR}/include)
# c++ example using cppsid wrapper library
add_executable(player ${CMAKE_SOURCE_DIR}/examples/player.cpp)
target_link_libraries(player cppsid)
# original c examples
add_executable(csidl ${CMAKE_SOURCE_DIR}/examples/csid.c ${CMAKE_SOURCE_DIR}/src/libcsidlight.c)
add_executable(csid ${CMAKE_SOURCE_DIR}/examples/csid.c ${CMAKE_SOURCE_DIR}/src/libcsidfull.c)
set_target_properties(csid PROPERTIES EXCLUDE_FROM_ALL TRUE)
target_link_libraries(csidl PRIVATE ${SDL2_LIBRARIES} m)
target_link_libraries(csid PRIVATE ${SDL2_LIBRARIES} m)