@@ -124,6 +124,11 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
124
124
configure_file ("${CMAKE_SOURCE_DIR} /cmake/cpack/${CMAKE_PROJECT_NAME} .desktop.in"
125
125
"${CMAKE_BINARY_DIR} /${CMAKE_PROJECT_NAME} .desktop" @ONLY)
126
126
127
+ elseif (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" )
128
+ set (FREEBSD TRUE )
129
+ configure_file ("${CMAKE_SOURCE_DIR} /cmake/cpack/${CMAKE_PROJECT_NAME} .desktop.in"
130
+ "${CMAKE_BINARY_DIR} /${CMAKE_PROJECT_NAME} .desktop" @ONLY)
131
+
127
132
elseif (APPLE )
128
133
if ("${CMAKE_OSX_DEPLOYMENT_TARGET} " STREQUAL "" )
129
134
message (STATUS "Build for macOS target: local version" )
@@ -177,10 +182,14 @@ if (C_CLANG OR C_GCC)
177
182
# It might go back in someday when I have more patience to clean up all the warnings.
178
183
#
179
184
###set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wvla -ffast-math -ftree-vectorize -D_XOPEN_SOURCE=600 -D_DEFAULT_SOURCE ${EXTRA_FLAGS}")
180
- set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wvla -ffast-math -ftree-vectorize -D_GNU_SOURCE ${EXTRA_FLAGS} " )
185
+ if (FREEBSD)
186
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wvla -ffast-math -ftree-vectorize -D_DEFAULT_SOURCE ${EXTRA_FLAGS} " )
187
+ else ()
188
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wvla -ffast-math -ftree-vectorize -D_GNU_SOURCE ${EXTRA_FLAGS} " )
189
+ endif ()
181
190
#
182
191
#
183
- # -lm is needed for functins in math.h
192
+ # -lm is needed for functions in math.h
184
193
if (LINUX)
185
194
# We have another problem with CentOS 6. clock_gettime() is in librt so we need -lrt.
186
195
# The clock_* functions were moved into gnu libc for version 2.17.
@@ -214,7 +223,11 @@ else()
214
223
set (INSTALL_DOC_DIR "share/doc/${CMAKE_PROJECT_NAME} " )
215
224
set (INSTALL_CONF_DIR "${INSTALL_DOC_DIR} /conf" )
216
225
set (INSTALL_SCRIPTS_DIR "${INSTALL_DOC_DIR} /scripts" )
217
- set (INSTALL_MAN_DIR "share/man/man1" )
226
+ if (FREEBSD)
227
+ set (INSTALL_MAN_DIR "man/man1" )
228
+ else ()
229
+ set (INSTALL_MAN_DIR "share/man/man1" )
230
+ endif ()
218
231
set (INSTALL_DATA_DIR "share/${PROJECT_NAME} " )
219
232
endif (WIN32 OR CYGWIN )
220
233
@@ -297,7 +310,7 @@ add_subdirectory(doc)
297
310
add_subdirectory (man)
298
311
299
312
# install desktop link
300
- if (LINUX)
313
+ if (LINUX OR FREEBSD )
301
314
install (FILES ${CMAKE_BINARY_DIR} /${CMAKE_PROJECT_NAME} .desktop DESTINATION share/applications)
302
315
install (FILES ${CMAKE_SOURCE_DIR} /cmake/cpack/${CMAKE_PROJECT_NAME} _icon.png DESTINATION share/pixmaps)
303
316
endif ()
0 commit comments