CMakeLists.txt 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462
  1. # PhysicsFS; a portable, flexible file i/o abstraction.
  2. #
  3. # Please see the file LICENSE.txt in the source's root directory.
  4. # The CMake project file is meant to get this compiling on all sorts of
  5. # platforms quickly, and serve as the way Unix platforms and Linux distros
  6. # package up official builds, but you don't _need_ to use this; we have
  7. # built PhysicsFS to (hopefully) be able to drop into your project and
  8. # compile, using preprocessor checks for platform-specific bits instead of
  9. # testing in here.
  10. set(PHYSFS_VERSION 3.3.0)
  11. cmake_minimum_required(VERSION 3.5...4.0)
  12. project(PhysicsFS VERSION ${PHYSFS_VERSION} LANGUAGES C )
  13. include(CMakeDependentOption)
  14. include(GNUInstallDirs)
  15. include("${PROJECT_SOURCE_DIR}/cmake/GetGitRevisionDescription.cmake")
  16. include("${PROJECT_SOURCE_DIR}/cmake/PrivateSdlFunctions.cmake")
  17. include("${PROJECT_SOURCE_DIR}/cmake/sdlmanpages.cmake")
  18. # Increment this if/when we break backwards compatibility.
  19. set(PHYSFS_SOVERSION 1)
  20. set(PC_PRIVATE_REQUIRES "")
  21. set(PHYSFS_M_SRCS)
  22. set(PHYSFS_CPP_SRCS)
  23. option(PHYSFS_WERROR "Treat warnings as errors" OFF)
  24. if(WIN32)
  25. list(APPEND OPTIONAL_LIBRARY_LIBS advapi32 shell32)
  26. endif()
  27. if(APPLE)
  28. set(OTHER_LDFLAGS ${OTHER_LDFLAGS} "-framework IOKit -framework Foundation")
  29. list(APPEND PHYSFS_M_SRCS src/physfs_platform_apple.m)
  30. endif()
  31. if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
  32. add_compile_options(-Wall)
  33. endif()
  34. if(CMAKE_C_COMPILER_ID STREQUAL "SunPro")
  35. add_definitions(-erroff=E_EMPTY_TRANSLATION_UNIT)
  36. add_definitions(-xldscope=hidden)
  37. endif()
  38. if(HAIKU)
  39. # We add this explicitly, since we don't want CMake to think this
  40. # is a C++ project unless we're on Haiku.
  41. list(APPEND PHYSFS_CPP_SRCS src/physfs_platform_haiku.cpp)
  42. find_library(BE_LIBRARY be)
  43. find_library(ROOT_LIBRARY root)
  44. list(APPEND OPTIONAL_LIBRARY_LIBS ${BE_LIBRARY} ${ROOT_LIBRARY})
  45. endif()
  46. if(CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
  47. set(WINRT TRUE)
  48. endif()
  49. if(WINRT)
  50. list(APPEND PHYSFS_CPP_SRCS src/physfs_platform_winrt.cpp)
  51. endif()
  52. if(UNIX AND NOT WIN32 AND NOT APPLE) # (MingW and such might be UNIX _and_ WINDOWS!)
  53. find_library(PTHREAD_LIBRARY pthread)
  54. if(PTHREAD_LIBRARY)
  55. list(APPEND OPTIONAL_LIBRARY_LIBS ${PTHREAD_LIBRARY})
  56. endif()
  57. endif()
  58. if(PHYSFS_CPP_SRCS)
  59. enable_language(CXX)
  60. endif()
  61. # Almost everything is "compiled" here, but things that don't apply to the
  62. # build are #ifdef'd out. This is to make it easy to embed PhysicsFS into
  63. # another project or bring up a new build system: just compile all the source
  64. # code and #define the things you want.
  65. set(PHYSFS_SRCS
  66. src/physfs.c
  67. src/physfs_byteorder.c
  68. src/physfs_unicode.c
  69. src/physfs_platform_cafe.c
  70. src/physfs_platform_ctr.c
  71. src/physfs_platform_dos.c
  72. src/physfs_platform_emscripten.c
  73. src/physfs_platform_posix.c
  74. src/physfs_platform_sdl3.c
  75. src/physfs_platform_unix.c
  76. src/physfs_platform_windows.c
  77. src/physfs_platform_ogc.c
  78. src/physfs_platform_os2.c
  79. src/physfs_platform_qnx.c
  80. src/physfs_platform_android.c
  81. src/physfs_platform_libretro.c
  82. src/physfs_platform_playdate.c
  83. src/physfs_platform_vita.c
  84. src/physfs_archiver_dir.c
  85. src/physfs_archiver_unpacked.c
  86. src/physfs_archiver_grp.c
  87. src/physfs_archiver_hog.c
  88. src/physfs_archiver_7z.c
  89. src/physfs_archiver_mvl.c
  90. src/physfs_archiver_qpak.c
  91. src/physfs_archiver_rofs.c
  92. src/physfs_archiver_wad.c
  93. src/physfs_archiver_csm.c
  94. src/physfs_archiver_zip.c
  95. src/physfs_archiver_slb.c
  96. src/physfs_archiver_iso9660.c
  97. src/physfs_archiver_vdf.c
  98. src/physfs_archiver_lec3d.c
  99. src/physfs_archiver_pod.c
  100. src/physfs_version.rc
  101. ${PHYSFS_CPP_SRCS}
  102. ${PHYSFS_M_SRCS}
  103. )
  104. # Archivers ...
  105. # These are (mostly) on by default now, so these options are only useful for
  106. # disabling them.
  107. option(PHYSFS_ARCHIVE_ZIP "Enable ZIP support" TRUE)
  108. if(NOT PHYSFS_ARCHIVE_ZIP)
  109. add_definitions(-DPHYSFS_SUPPORTS_ZIP=0)
  110. endif()
  111. option(PHYSFS_ARCHIVE_7Z "Enable 7zip support" TRUE)
  112. if(NOT PHYSFS_ARCHIVE_7Z)
  113. add_definitions(-DPHYSFS_SUPPORTS_7Z=0)
  114. endif()
  115. option(PHYSFS_ARCHIVE_GRP "Enable Build Engine GRP support" TRUE)
  116. if(NOT PHYSFS_ARCHIVE_GRP)
  117. add_definitions(-DPHYSFS_SUPPORTS_GRP=0)
  118. endif()
  119. option(PHYSFS_ARCHIVE_WAD "Enable Doom WAD support" TRUE)
  120. if(NOT PHYSFS_ARCHIVE_WAD)
  121. add_definitions(-DPHYSFS_SUPPORTS_WAD=0)
  122. endif()
  123. option(PHYSFS_ARCHIVE_CSM "Enable Chasm: The Rift CSM.BIN support" TRUE)
  124. if(NOT PHYSFS_ARCHIVE_CSM)
  125. add_definitions(-DPHYSFS_SUPPORTS_CSM=0)
  126. endif()
  127. option(PHYSFS_ARCHIVE_HOG "Enable Descent I/II HOG support" TRUE)
  128. if(NOT PHYSFS_ARCHIVE_HOG)
  129. add_definitions(-DPHYSFS_SUPPORTS_HOG=0)
  130. endif()
  131. option(PHYSFS_ARCHIVE_MVL "Enable Descent I/II MVL support" TRUE)
  132. if(NOT PHYSFS_ARCHIVE_MVL)
  133. add_definitions(-DPHYSFS_SUPPORTS_MVL=0)
  134. endif()
  135. option(PHYSFS_ARCHIVE_QPAK "Enable Quake I/II QPAK support" TRUE)
  136. if(NOT PHYSFS_ARCHIVE_QPAK)
  137. add_definitions(-DPHYSFS_SUPPORTS_QPAK=0)
  138. endif()
  139. option(PHYSFS_ARCHIVE_ROFS "Enable Resident Evil 3 ROFS support" TRUE)
  140. if(NOT PHYSFS_ARCHIVE_ROFS)
  141. add_definitions(-DPHYSFS_SUPPORTS_ROFS=0)
  142. endif()
  143. option(PHYSFS_ARCHIVE_SLB "Enable I-War / Independence War SLB support" TRUE)
  144. if(NOT PHYSFS_ARCHIVE_SLB)
  145. add_definitions(-DPHYSFS_SUPPORTS_SLB=0)
  146. endif()
  147. option(PHYSFS_ARCHIVE_ISO9660 "Enable ISO9660 support" TRUE)
  148. if(NOT PHYSFS_ARCHIVE_ISO9660)
  149. add_definitions(-DPHYSFS_SUPPORTS_ISO9660=0)
  150. endif()
  151. option(PHYSFS_ARCHIVE_VDF "Enable Gothic I/II VDF archive support" TRUE)
  152. if(NOT PHYSFS_ARCHIVE_VDF)
  153. add_definitions(-DPHYSFS_SUPPORTS_VDF=0)
  154. endif()
  155. option(PHYSFS_ARCHIVE_LECARCHIVES "Enable LucasArts GOB/LAB/LFD Archive support" TRUE)
  156. if(NOT PHYSFS_ARCHIVE_LECARCHIVES)
  157. add_definitions(-DPHYSFS_SUPPORTS_LECARCHIVES=0)
  158. endif()
  159. option(PHYSFS_ARCHIVE_POD "Enable Terminal Reality POD Archive support" TRUE)
  160. if(NOT PHYSFS_ARCHIVE_POD)
  161. add_definitions(-DPHYSFS_SUPPORTS_POD=0)
  162. endif()
  163. option(PHYSFS_PLATFORM_SDL3 "Enable building for the SDL3 file system" FALSE)
  164. if(PHYSFS_PLATFORM_SDL3)
  165. find_package(SDL3 REQUIRED CONFIG REQUIRED COMPONENTS Headers SDL3)
  166. list(APPEND PC_PRIVATE_REQUIRES "sdl3")
  167. endif()
  168. if(EMSCRIPTEN)
  169. set(PHYSFS_EMSCRIPTEN_STORAGE_PATH "" CACHE STRING "Specify a path for prefdir on Emscripten")
  170. if(NOT PHYSFS_EMSCRIPTEN_STORAGE_PATH STREQUAL "")
  171. add_definitions(-DPHYSFS_EMSCRIPTEN_STORAGE_PATH="${PHYSFS_EMSCRIPTEN_STORAGE_PATH}")
  172. endif()
  173. endif()
  174. option(PHYSFS_BUILD_STATIC "Build static library" TRUE)
  175. if(PHYSFS_BUILD_STATIC)
  176. add_library(physfs-static STATIC ${PHYSFS_SRCS})
  177. add_library(PhysFS::PhysFS-static ALIAS physfs-static)
  178. sdl_add_warning_options(physfs-static WARNING_AS_ERROR ${PHYSFS_WERROR})
  179. set_property(TARGET physfs-static PROPERTY EXPORT_NAME PhysFS-static)
  180. # Don't rename this on Windows, since DLLs will also produce an import
  181. # library named "physfs.lib" which would conflict; Unix tend to like the
  182. # same library name with a different extension for static libs, but
  183. # Windows can just have a separate name.
  184. if(NOT MSVC)
  185. set_property(TARGET physfs-static PROPERTY OUTPUT_NAME "physfs")
  186. endif()
  187. if(WINRT)
  188. # Ignore LNK4264 warnings; we don't author any WinRT components, just consume them, so we're okay in a static library.
  189. set_property(TARGET physfs-static PROPERTY VS_WINRT_COMPONENT TRUE)
  190. set_property(TARGET physfs-static PROPERTY STATIC_LIBRARY_FLAGS "/ignore:4264")
  191. endif()
  192. if(WIN32 OR WINRT OR OS2)
  193. # no dll exports from the static library
  194. target_compile_definitions(physfs-static PRIVATE "PHYSFS_STATIC")
  195. endif()
  196. if(PHYSFS_PLATFORM_SDL3)
  197. target_compile_definitions(physfs-static PRIVATE PHYSFS_PLATFORM_SDL3=1)
  198. target_link_libraries(physfs-static PUBLIC SDL3::Headers)
  199. endif()
  200. target_include_directories(physfs-static PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>")
  201. target_link_libraries(physfs-static PRIVATE ${OPTIONAL_LIBRARY_LIBS} ${OTHER_LDFLAGS})
  202. list(APPEND PHYSFS_INSTALL_TARGETS "physfs-static")
  203. endif()
  204. if (NOT DOS AND NOT EMSCRIPTEN)
  205. option(PHYSFS_BUILD_SHARED "Build shared library" TRUE)
  206. endif()
  207. if(PHYSFS_BUILD_SHARED)
  208. add_library(physfs-shared SHARED ${PHYSFS_SRCS})
  209. add_library(PhysFS::PhysFS-shared ALIAS physfs-shared)
  210. sdl_add_warning_options(physfs-shared WARNING_AS_ERROR ${PHYSFS_WERROR})
  211. set_property(TARGET physfs-shared PROPERTY OUTPUT_NAME "physfs")
  212. set_property(TARGET physfs-shared PROPERTY MACOSX_RPATH 1)
  213. set_property(TARGET physfs-shared PROPERTY VERSION ${PHYSFS_VERSION})
  214. set_property(TARGET physfs-shared PROPERTY SOVERSION ${PHYSFS_SOVERSION})
  215. set_property(TARGET physfs-shared PROPERTY EXPORT_NAME PhysFS-shared)
  216. if(WIN32)
  217. set_property(TARGET physfs-shared PROPERTY PREFIX "")
  218. endif()
  219. if(MINGW)
  220. target_link_options(physfs-shared PRIVATE -static-libgcc)
  221. endif()
  222. if(WINRT)
  223. set_property(TARGET physfs-shared PROPERTY VS_WINRT_COMPONENT TRUE)
  224. endif()
  225. if(PHYSFS_PLATFORM_SDL3)
  226. target_compile_definitions(physfs-shared PRIVATE PHYSFS_PLATFORM_SDL3=1)
  227. target_link_libraries(physfs-shared PUBLIC SDL3::Headers)
  228. target_link_libraries(physfs-shared PRIVATE SDL3::SDL3-shared)
  229. endif()
  230. target_include_directories(physfs-shared PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>")
  231. target_link_libraries(physfs-shared PRIVATE ${OPTIONAL_LIBRARY_LIBS} ${OTHER_LDFLAGS})
  232. list(APPEND PHYSFS_INSTALL_TARGETS "physfs-shared")
  233. endif()
  234. if(NOT PHYSFS_BUILD_SHARED AND NOT PHYSFS_BUILD_STATIC)
  235. message(FATAL "Both shared and static libraries are disabled!")
  236. endif()
  237. if(TARGET physfs-shared)
  238. add_library(PhysFS::PhysFS ALIAS physfs-shared)
  239. elseif(TARGET PhysFS::PhysFS-static)
  240. add_library(PhysFS::PhysFS ALIAS physfs-static)
  241. endif()
  242. option(PHYSFS_BUILD_TEST "Build stdio test program." TRUE)
  243. mark_as_advanced(PHYSFS_BUILD_TEST)
  244. if(PHYSFS_BUILD_TEST)
  245. add_executable(test_physfs test/test_physfs.c)
  246. target_link_libraries(test_physfs PRIVATE PhysFS::PhysFS)
  247. sdl_add_warning_options(test_physfs WARNING_AS_ERROR ${PHYSFS_WERROR})
  248. if(DOS)
  249. set_target_properties(test_physfs PROPERTIES OUTPUT_NAME "TESTPHYS") # 8.3 file names!
  250. endif()
  251. find_path(READLINE_H readline/readline.h)
  252. find_path(HISTORY_H readline/history.h)
  253. find_library(READLINE_LIBRARY readline)
  254. find_package(Curses)
  255. if(READLINE_H AND HISTORY_H AND READLINE_LIBRARY AND CURSES_FOUND)
  256. set(HAVE_SYSTEM_READLINE TRUE)
  257. target_link_libraries(test_physfs PRIVATE ${READLINE_LIBRARY} ${CURSES_LIBRARIES})
  258. target_include_directories(test_physfs SYSTEM PRIVATE ${READLINE_H} ${HISTORY_H})
  259. target_compile_definitions(test_physfs PRIVATE PHYSFS_HAVE_READLINE=1)
  260. endif()
  261. list(APPEND PHYSFS_INSTALL_TARGETS test_physfs)
  262. if(UNIX)
  263. add_executable(physfshttpd extras/physfshttpd.c)
  264. target_link_libraries(physfshttpd PRIVATE PhysFS::PhysFS)
  265. sdl_add_warning_options(physfshttpd WARNING_AS_ERROR ${PHYSFS_WERROR})
  266. endif()
  267. endif()
  268. option(PHYSFS_INSTALL "Enable PhysFS installation" ON)
  269. cmake_dependent_option(PHYSFS_INSTALL_MAN "Install man pages for PhysicsFS" OFF "PHYSFS_INSTALL" OFF)
  270. if(PHYSFS_INSTALL)
  271. if(MSVC)
  272. set(PHYSFS_INSTALL_CMAKEDIR "cmake")
  273. else()
  274. set(PHYSFS_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/PhysFS")
  275. endif()
  276. if(TARGET physfs-shared)
  277. install(TARGETS physfs-shared EXPORT physfs-shared-exports
  278. RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
  279. LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
  280. ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
  281. INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
  282. install(EXPORT physfs-shared-exports
  283. DESTINATION "${PHYSFS_INSTALL_CMAKEDIR}"
  284. FILE PhysFS-shared-targets.cmake
  285. NAMESPACE PhysFS::
  286. )
  287. export(TARGETS physfs-shared NAMESPACE PhysFS:: FILE PhysFS-shared-targets.cmake)
  288. if(MSVC)
  289. SDL_install_pdb(physfs-shared "${CMAKE_INSTALL_BINDIR}")
  290. endif()
  291. endif()
  292. if(TARGET physfs-static)
  293. install(TARGETS physfs-static EXPORT physfs-static-exports
  294. RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
  295. LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
  296. ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
  297. INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
  298. install(EXPORT physfs-static-exports
  299. DESTINATION "${PHYSFS_INSTALL_CMAKEDIR}"
  300. FILE PhysFS-static-targets.cmake
  301. NAMESPACE PhysFS::
  302. )
  303. export(TARGETS physfs-static NAMESPACE PhysFS:: FILE PhysFS-static-targets.cmake)
  304. if(MSVC)
  305. SDL_install_pdb(physfs-static "${CMAKE_INSTALL_LIBDIR}")
  306. endif()
  307. endif()
  308. if(TARGET test_physfs)
  309. install(TARGETS test_physfs RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
  310. endif()
  311. install(FILES src/physfs.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
  312. include(CMakePackageConfigHelpers)
  313. configure_package_config_file(cmake/PhysFSConfig.cmake.in PhysFSConfig.cmake
  314. NO_SET_AND_CHECK_MACRO
  315. PATH_VARS CMAKE_INSTALL_PREFIX
  316. INSTALL_DESTINATION "${PHYSFS_INSTALL_CMAKEDIR}"
  317. )
  318. write_basic_package_version_file(PhysFSConfigVersion.cmake
  319. COMPATIBILITY SameMajorVersion
  320. )
  321. install(FILES
  322. "${CMAKE_CURRENT_BINARY_DIR}/PhysFSConfig.cmake"
  323. "${CMAKE_CURRENT_BINARY_DIR}/PhysFSConfigVersion.cmake"
  324. DESTINATION "${PHYSFS_INSTALL_CMAKEDIR}"
  325. )
  326. install(FILES LICENSE.txt
  327. DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/licenses/PhysicsFS${PROJECT_VERSION_MAJOR}")
  328. string(REPLACE ";" " " PC_PRIVATE_REQUIRES "${PC_PRIVATE_REQUIRES}")
  329. configure_file(cmake/cmake_uninstall.cmake.in cmake_uninstall.cmake IMMEDIATE @ONLY)
  330. add_custom_target(uninstall-physfs
  331. COMMAND ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
  332. if(NOT MSVC)
  333. configure_file(cmake/physfs.pc.in physfs.pc @ONLY)
  334. install(
  335. FILES "${CMAKE_CURRENT_BINARY_DIR}/physfs.pc"
  336. DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig"
  337. )
  338. endif()
  339. if(PHYSFS_INSTALL_MAN)
  340. sdl_get_git_revision_hash(PHYSFS_REVISION)
  341. SDL_generate_manpages(
  342. HEADERS_DIR "${PROJECT_SOURCE_DIR}/src/physfs.h"
  343. SYMBOL "PHYSFS_init"
  344. WIKIHEADERS_PL_PATH "${PROJECT_SOURCE_DIR}/build-scripts/wikiheaders.pl"
  345. REVISION "${PHYSFS_REVISION}"
  346. )
  347. endif()
  348. endif()
  349. option(PHYSFS_BUILD_DOCS "Build doxygen based documentation" TRUE)
  350. if(PHYSFS_BUILD_DOCS)
  351. find_package(Doxygen)
  352. if(DOXYGEN_FOUND)
  353. set(PHYSFS_OUTPUT_DOXYFILE "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile")
  354. configure_file(
  355. "${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile"
  356. "${PHYSFS_OUTPUT_DOXYFILE}"
  357. COPYONLY
  358. )
  359. file(APPEND "${PHYSFS_OUTPUT_DOXYFILE}" "\n\n# Below auto-generated by cmake...\n\n")
  360. file(APPEND "${PHYSFS_OUTPUT_DOXYFILE}" "PROJECT_NUMBER = \"${PHYSFS_VERSION}\"\n")
  361. file(APPEND "${PHYSFS_OUTPUT_DOXYFILE}" "OUTPUT_DIRECTORY = \"${CMAKE_CURRENT_BINARY_DIR}/docs\"\n")
  362. file(APPEND "${PHYSFS_OUTPUT_DOXYFILE}" "\n# End auto-generated section.\n\n")
  363. set(PHYSFS_TARGETNAME_DOCS "docs" CACHE STRING "Name of 'docs' build target")
  364. add_custom_target(
  365. ${PHYSFS_TARGETNAME_DOCS}
  366. ${DOXYGEN_EXECUTABLE} "${PHYSFS_OUTPUT_DOXYFILE}"
  367. WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
  368. COMMENT "Building documentation in 'docs' directory..."
  369. )
  370. else()
  371. message(STATUS "Doxygen not found. You won't be able to build documentation.")
  372. endif()
  373. endif()
  374. macro(message_bool_option _NAME _VALUE)
  375. if(${_VALUE})
  376. message(STATUS " ${_NAME}: enabled")
  377. else()
  378. message(STATUS " ${_NAME}: disabled")
  379. endif()
  380. endmacro()
  381. message(STATUS "PhysicsFS will build with the following options:")
  382. message_bool_option("ZIP support" PHYSFS_ARCHIVE_ZIP)
  383. message_bool_option("7zip support" PHYSFS_ARCHIVE_7Z)
  384. message_bool_option("GRP support" PHYSFS_ARCHIVE_GRP)
  385. message_bool_option("WAD support" PHYSFS_ARCHIVE_WAD)
  386. message_bool_option("CSM support" PHYSFS_ARCHIVE_CSM)
  387. message_bool_option("HOG support" PHYSFS_ARCHIVE_HOG)
  388. message_bool_option("MVL support" PHYSFS_ARCHIVE_MVL)
  389. message_bool_option("QPAK support" PHYSFS_ARCHIVE_QPAK)
  390. message_bool_option("ROFS support" PHYSFS_ARCHIVE_ROFS)
  391. message_bool_option("SLB support" PHYSFS_ARCHIVE_SLB)
  392. message_bool_option("VDF support" PHYSFS_ARCHIVE_VDF)
  393. message_bool_option("ISO9660 support" PHYSFS_ARCHIVE_ISO9660)
  394. message_bool_option("GOB/LAB/LFD support" PHYSFS_ARCHIVE_LECARCHIVES)
  395. message_bool_option("POD support" PHYSFS_ARCHIVE_POD)
  396. message_bool_option("SDL3 filesystem support" PHYSFS_PLATFORM_SDL3)
  397. message_bool_option("Build static library" PHYSFS_BUILD_STATIC)
  398. message_bool_option("Build shared library" PHYSFS_BUILD_SHARED)
  399. message_bool_option("Build stdio test program" PHYSFS_BUILD_TEST)
  400. message_bool_option("Build Doxygen documentation" PHYSFS_BUILD_DOCS)
  401. if(PHYSFS_BUILD_TEST)
  402. message_bool_option(" Use readline in test program" HAVE_SYSTEM_READLINE)
  403. endif()
  404. # end of CMakeLists.txt ...