Hello All,

I'm trying to use a custom module, but I can't get cmake to see it. I am on 
FreeBSD 9.3 (amd64) using cmake-3.3.2. I have read and tried everything I can 
find on the topic. I have verified the module path via the "MESSAGE" command, 
but no joy. I have included all relevant information below. Any help would be 
much appreciated.


BTW: I also tried putting the .cmake files in the cmake Modules directory.


Thanks,

-S


set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} 
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/")

MESSAGE( STATUS "CMAKE_MODULE_PATH:         " ${CMAKE_MODULE_PATH} )

find_package(NIM)


FindNIM.cmake
---------------------

include(CMakeParseArguments)

find_program(NIM_EXECUTABLE nimrod PATHS ENV PATH)
mark_as_advanced(NIM_EXECUTABLE)

# Determine the valac version
if(NIM_EXECUTABLE)
    execute_process(COMMAND ${NIM_EXECUTABLE} "--version"
        OUTPUT_VARIABLE NIM_VERSION
        OUTPUT_STRIP_TRAILING_WHITESPACE)
    STRING(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" NIM_VERSION ${NIM_VERSION})
endif(NIM_EXECUTABLE)

# Handle the QUIETLY and REQUIRED arguments, which may be given to the find call
.
# set NIM_FOUND to TRUE if Nimrod has been found

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Nim
    REQUIRED_VARS NIM_EXECUTABLE
    VERSION_VAR NIM_VERSION)

set(NIM_USE_FILE "${CMAKE_CURRENT_LIST_DIR}/UseNim.cmake")


UseNim.cmake
--------------------


include(CMakeParseArguments)

function(add_nim_executable )
    cmake_parse_arguments(ARGS "" "TARGET" "SOURCES" ${ARGN})

    # collect set of input source files
    set(in_files "")
    foreach(src ${ARGS_SOURCES} ${ARGS_UNPARSED_ARGUMENTS})
        list(APPEND in_files "${CMAKE_CURRENT_SOURCE_DIR}/${src}")
    endforeach(src ${ARGS_SOURCES} ${ARGS_UNPARSED_ARGUMENTS})

    # set the target binary and nim cache directory
    set(nim_target "${CMAKE_CURRENT_BINARY_DIR}/${ARGS_TARGET}")
    set(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/nimcache")

    # add target to trigger the nimrod compiler
    add_custom_target(
    nim ALL
    COMMAND
        ${NIM_EXECUTABLE} "c" "--nimcache:" ${DIRECTORY} "--out:" ${nim_
target} ${in_files}
    DEPENDS
        ${in_files}
endfunction(add_nim_executable)







-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to