[CMake] <Package>Config.cmake <=> FIND_PACKAGE
Micha Renner
Micha.Renner at t-online.de
Wed Sep 17 09:37:05 EDT 2008
Hallo,
I have two CMAKE-Module files (FindMAX.cmake & intlConfig.cmake) Both
are located in a separate directory (please, see the script below)
FIND_PACKAGE can find MAX with no problems, but it comes in trouble
looking for intl.
It changes the name correctly to intlConfig.cmake, but it cannot
localize the file.
Resulting error:
CMake Error: intl_DIR is not set. It must be set to the directory
containing intlConfig.cmake in order to use intl.
Obviously, FIND_PACKAGE cannot find the module-file with the NAMES
option.
So, where is my error?
Greetings
Micha
PROJECT(TD)
SET(CMAKE_MODULE_PATH /usr/local/share/CMake)
FIND_PACKAGE(MAX REQUIRED)
INCLUDE_DIRECTORIES(${MAX_INCLUDE_DIR})
FIND_PACKAGE(intl REQUIRED NAMES intl)
INCLUDE_DIRECTORIES(${INTL_INCLUDE_DIR})
SET(_src sayhallo.c)
ADD_EXECUTABLE(ULS ${_src})
TARGET_LINK_LIBRARIES(ULS ${INTL_LIBRARY} ${MAX_LIBRARY})
More information about the CMake
mailing list