diff --git a/Sources/CMakeLists.txt b/Sources/CMakeLists.txt index 30e7290..c5cc838 100644 --- a/Sources/CMakeLists.txt +++ b/Sources/CMakeLists.txt @@ -28,6 +28,9 @@ endif() if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME MATCHES "GNU|kFreeBSD") SET(LINUX TRUE) endif() +if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") + SET(FREEBSD TRUE) +endif() if(APPLE) SET(MACOSX TRUE) endif() @@ -71,6 +74,16 @@ if(LINUX) add_definitions(-DPRAGMA_ONCE=1) endif() +if(FREEBSD) + set(CMAKE_SKIP_RPATH ON CACHE BOOL "Skip RPATH" FORCE) + add_definitions(-DPLATFORM_UNIX=1) + add_definitions(-DPLATFORM_FREEBSD=1) + add_definitions(-D_FILE_OFFSET_BITS=64) + add_definitions(-D_LARGEFILE_SOURCE=1) + add_definitions(-DPRAGMA_ONCE=1) + include_directories("/usr/local/include") +endif() + if(MACOSX) add_definitions(-DPLATFORM_UNIX=1) add_definitions(-DPLATFORM_MACOSX=1) @@ -826,6 +839,19 @@ if(LINUX) endif() endif() +if(FREEBSD) + set_target_properties(ssam PROPERTIES LINK_FLAGS "-Wl,-rpath,$ORIGIN") + target_link_libraries(ssam "m") + target_link_libraries(ssam "pthread") + target_link_libraries(ssam ${SDL2_LIBRARY}) + if(BUILD_DEDICATED_SERVER) + set_target_properties(SeriousSamDedicated PROPERTIES LINK_FLAGS "-Wl,-rpath,$ORIGIN") + target_link_libraries(SeriousSamDedicated "m") + target_link_libraries(SeriousSamDedicated "pthread") + target_link_libraries(SeriousSamDedicated ${SDL2_LIBRARY}) + endif() +endif() + if(TFE) set_target_properties(ssam PROPERTIES OUTPUT_NAME "ssam-tfe") endif()