speed-dreams-code/cmake/FindNSIS.cmake
beaglejoe 89bc5be2f2 Added OPTION_PACKAGING to control custom packaging (WIP)
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@6669 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 9200871e0e429b1d8103da1458d43562d13c698a
Former-commit-id: 543947e5437cec8cdfcb8d2e7e358450f1643e70
2019-06-04 00:55:22 +00:00

19 lines
605 B
CMake

# CMake does not allow for braces in $ENV{}, so a temporary variable must be used.
set(PROGRAMFILES_X86 "ProgramFiles(x86)")
set(NSIS_INET_PLUGIN )
find_program(NSIS_MAKE_EXE
NAMES makensis
PATHS $ENV{PROGRAMFILES}/NSIS $ENV{${PROGRAMFILES_X86}}/NSIS
)
if(NSIS_MAKE_EXE)
get_filename_component(NSIS_LOCATION ${NSIS_MAKE_EXE} DIRECTORY)
Message(STATUS "NSIS_LOCATION = ${NSIS_LOCATION}")
find_file(NSIS_INET_PLUGIN INetC.dll PATHS ${NSIS_LOCATION} PATH_SUFFIXES Plugins)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(NSIS DEFAULT_MSG NSIS_MAKE_EXE)