woof/docs/WoofInstall.cmake.in
Alex Mayfield b13b8fc415
CMake Build System (#48)
* First stab at CMake

It builds on Linux, and cross-compiles to Windows as well using the
provided toolchain files.  convert-icon is also fixed up with argument
count checking and modern format strings, along with all flake8 warnings
fixed.

* Fix Visual Studio compilation

* Add a newline to gitignore

* Build system updates

- Add documentation.
- Add options for defines.
- Automatically copy DLL files to binary directory.
- Add preliminary CPack support which packages the binary plus docs and
  DLL files.

* Fix SDL2_FILES conditional

* Build Windows and Linux packages

We use our own Python script instead of unix2dos.  Also, a few other
random fixes came along for the ride.

* Fix up warnings and defines on MSVC

* Update Travis to use CMake

* Remove automake and autoconf files

* Yet more build system updates

- Add docs, examples, and desktop stuff to binary packages.
- Get rid of HAVE_CONFIG_H.
- Change HAVE_DLOPEN to something more CMake-like.
- Add optional targets for most of the tools.

* Ignore files for source package

* Add to README file

* Get rid of BETA, DOGS, and fix another Automake straggler

* Prevent in-tree builds

Fixes #21
2020-02-03 12:11:31 +01:00

29 lines
933 B
CMake

# This script is stamped out by CMake and run by `make install`.
set(PROJECT_SOURCE_DIR "@PROJECT_SOURCE_DIR@")
set(CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@")
set(CMAKE_CURRENT_BINARY_DIR "@CMAKE_CURRENT_BINARY_DIR@")
set(Python3_EXECUTABLE "@Python3_EXECUTABLE@")
set(WIN32 "@WIN32@")
set(WOOF_TEXTS "@WOOF_DOCS_TEXTS@")
function(win_textfile SOURCE DESTINATION)
execute_process(COMMAND
"${Python3_EXECUTABLE}" "${PROJECT_SOURCE_DIR}/win-textfile"
"${SOURCE}" "${DESTINATION}")
endfunction()
if(WIN32)
if(NOT Python3_EXECUTABLE)
message(FATAL_ERROR "Python 3 not found, can't run install scripts.")
endif()
# Convert text files to a format Windows Notepad can read without issue.
foreach(WOOF_TEXT ${WOOF_TEXTS})
win_textfile(
"${CMAKE_CURRENT_SOURCE_DIR}/${WOOF_TEXT}"
"${CMAKE_CURRENT_BINARY_DIR}/${WOOF_TEXT}")
endforeach()
endif()