Hi Eric,
I have the same behavior from command line and GUI.
The orig. project setup was: project(ftplibcpp)
with project(ftplibcpp CXX) it works:
claus-kleins-macbook-pro:build clausklein$ /opt/local/bin/cmake -
DCMAKE_TOOLCHAIN_FILE=/Users/clausklein/Toolchain-cross-mingw32-
linux.cmake ..
-- The CXX compiler identification is GNU 3.4.5
-- Check for working CXX compiler: /opt/local/bin/i386-mingw32-g++
-- Check for working CXX compiler: /opt/local/bin/i386-mingw32-g++ --
works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/clausklein/Workspace/cpp/
ftplibpp-2.0.2/build
claus-kleins-macbook-pro:build clausklein$ rm -rf *
with language not set it fails:
claus-kleins-macbook-pro:build clausklein$ /opt/local/bin/cmake -
DCMAKE_TOOLCHAIN_FILE=/Users/clausklein/Toolchain-cross-mingw32-
linux.cmake ..
-- The C compiler identification is GNU 3.4.5
-- The CXX compiler identification is GNU 3.4.5
CMake Error at /Applications/CMake 2.8-8.app/Contents/share/cmake-2.8/
Modules/CMakeFindBinUtils.cmake:71 (MESSAGE):
Could not find install_name_tool, please check your installation.
Call Stack (most recent call first):
/Applications/CMake 2.8-8.app/Contents/share/cmake-2.8/Modules/
CMakeDetermineCXXCompiler.cmake:177 (INCLUDE)
CMakeLists.txt:3 (project)
CMake Error: Error required internal CMake variable not set, cmake may
be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER_ENV_VAR
CMake Error: Could not find cmake module file:/Users/clausklein/
Workspace/cpp/ftplibpp-2.0.2/build/CMakeFiles/CMakeCXXCompiler.cmake
-- Configuring incomplete, errors occurred!
claus-kleins-macbook-pro:build clausklein$
#--------------------------------------------------------
The interesting this is that this works too without language setting:
/opt/local/bin/cmake -G "Unix Makefiles" \
-DCMAKE_SYSTEM_NAME=Windows -DCMAKE_INSTALL_PREFIX="C:/usr" \
-DCMAKE_RC_COMPILER:FILEPATH=/opt/local/bin/i386-mingw32-windres \
-DCMAKE_CXX_COMPILER=/opt/local/bin/i386-mingw32-g++ \
-DCMAKE_C_COMPILER=/opt/local/bin/i386-mingw32-gcc \
-DCMAKE_FIND_ROOT_PATH=/opt/local/i386-mingw32/bin \
--check-system-vars \
..
Thank you for help :))
Claus
cmake_minimum_required(VERSION 2.8.5)
project(ftplibcpp CXX)
###FIXME project(ftplibcpp)
option(BUILD_SHARED_LIBS "Build shared libraries" off)
add_definitions(-DNOLFS)
add_definitions(-DNOSSL)
# Where to put all the LIBRARY targets when built. This variable is used to
# initialize the LIBRARY_OUTPUT_DIRECTORY property on all the targets.
#FIXME set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
# Make sure the linker can find the ftpcpp library once it is built.
link_directories(${LIBRARY_OUTPUT_PATH})
# Where to put all the RUNTIME targets when built. This variable is used to
# initialize the RUNTIME_OUTPUT_DIRECTORY property on all the targets.
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
# Tell CMake to build a library from ftplib.cpp and fetchurl.cpp
add_library(ftpcpp ftplib.cpp fetchurl.cpp)
set_target_properties(ftpcpp PROPERTIES DEBUG_POSTFIX D)
if (NOT MSVC AND NOT MINGW )
if (NOT BUILD_SHARED_LIBS)
# Create ftpcpp executable with NO dynamic dependency at all:
# or for all execuatables: LDFLAGS=-static cmake ..
set_target_properties(ftpcpp PROPERTIES LINK_FLAGS "-static")
endif (NOT BUILD_SHARED_LIBS)
else ()
set(LIBS wsock32)
if (BUILD_SHARED_LIBS)
target_link_libraries(ftpcpp ${LIBS})
endif (BUILD_SHARED_LIBS)
endif ()
# install the lib
install(TARGETS ftpcpp DESTINATION lib)
# use the lib to build bin
add_executable(ftpList ftpList.cpp)
target_link_libraries(ftpList ftpcpp ${LIBS})
add_executable(ftpGet ftpGet.cpp)
target_link_libraries(ftpGet ftpcpp ${LIBS})
add_executable(ftpPut ftpPut.cpp)
target_link_libraries(ftpPut ftpcpp ${LIBS})
# install the bin
install(TARGETS ftpPut ftpGet ftpList DESTINATION bin)
On 14.07.2012, at 12:22, Eric Noulard wrote:
2012/7/13 Claus Klein <[email protected]>:
Can anyone please help?
Thanks in advance
Best Regards
Claus
With this CMAKE_TOOLCHAIN_FILE it just works, but there is always
an error
the first time cmake configure step is started from GUI:
Do you have the same error with command line cmake?
[...]
# FIXME on APPLE this is needed too? (CmakeFindBinUtils.cmke)
set(CMAKE_INSTALL_NAME_TOOL ${USER_ROOT_PATH}/install_name_tool)
FindBinUtils should find this one on his own as soon as C or C++
compiler
has been found (this is not working for fortran, see:
http://public.kitware.com/Bug/view.php?id=13379)
# CMake Error at /Applications/CMake
2.8-8.app/Contents/share/cmake-2.8/Modules/CMakeFindBinUtils.cmake:71
(MESSAGE):
# Could not find install_name_tool, please check your installation.
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
# Call Stack (most recent call first):
# /Applications/CMake
2.8-8.app/Contents/share/cmake-2.8/Modules/
CMakeDetermineCXXCompiler.cmake:177
(INCLUDE)
# CMakeLists.txt:3 (project)
if it works on the second run then may be you didn't enable C or C++
language in your project
what is the project statement you use in your CMakeLists.txt
is it project(Blah NONE) ?
is it project(Blah Fortran)
in any case could you try
project(Blah C)?
--
Erk
Le gouvernement représentatif n'est pas la démocratie --
http://www.le-message.org
--
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake