Re: [CMake] help using try_run with custom build type
Hi All, On Wed, Jul 8, 2009 at 2:29 AM, Denis Scherbakovdenis_scherba...@yahoo.com wrote: It appears to fail because the compiler options do not make it in when creating the executable ... is there something silly I have missed? Also, I was wondering why TRY_RUN doesn't use the default flags defined from CMAKE_BUILD_TYPE ? Is this a bug or am I not using TRY_RUN correctly? I am not sure that I understood correctly, but once I had a problem passing compiler flags to TRY_COMPILE. I solved it by stuffing compile flags into CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MY_COMPILE_FLAGS} I think TRY_RUN is the same. What's the difference between, TRY_RUN( ... COMPILE_DEFINITIONS ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE}} ... ) and TRY_RUN( .. CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE}} ...) I realize the latter is passed as a command line option, but, Is the first definition only supposed to contain [-/]D compiler macros, while the latter can contain actual compiler flags? TIA, George ___ 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
Re: [CMake] help using try_run with custom build type
Hi Denis, On Wed, Jul 8, 2009 at 2:29 AM, Denis Scherbakovdenis_scherba...@yahoo.com wrote: It appears to fail because the compiler options do not make it in when creating the executable ... is there something silly I have missed? Also, I was wondering why TRY_RUN doesn't use the default flags defined from CMAKE_BUILD_TYPE ? Is this a bug or am I not using TRY_RUN correctly? I am not sure that I understood correctly, but once I had a problem passing compiler flags to TRY_COMPILE. I solved it by stuffing compile flags into CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MY_COMPILE_FLAGS} I think TRY_RUN is the same. I'll give that a swing. I guess I expected when I passed -DCMAKE_BUILD_TYPE:STRING=my build type on the command line ... the compilation flags for that build type would be used in the TRY_* calls and anything passed in via COMPILE_DEFINITIONS would just be additional flags. Apparently that's not the case! :) Thanks much, George ___ 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
Re: [CMake] help using try_run with custom build type
Hi all, On Mon, Jun 29, 2009 at 10:15 PM, George Neillgeor...@neillnet.com wrote: Hi folks, I apologize for the long email, but, I am having some troubles with try_run (cmake 2.6.4/sun gcc/Solaris 10). I have created my own CMAKE_BUILD_TYPE called TEST and have set CMAKE_C_FLAGS_TEST to -m64 -std=c99. Here's the .c code I am testing with, -bash-3.00$ cat !$ cat ../platform/HAVE_ISFINITE.c #include math.h int main(){ float f = 1.3; return isfinite(f); } Here's the CMake script. -bash-3.00$ cat ../CMakeLists.txt cmake_minimum_required(VERSION 2.6) project(test C) macro(MY_C_COMPILE_AND_RUN_CHECK _var) message(STATUS Compiling ${_var}) if(CMAKE_REQUIRED_LIBRARIES) set(USING_THESE_LIBS -DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}) else(CMAKE_REQUIRED_LIBRARIES) set(USING_THESE_LIBS) endif(CMAKE_REQUIRED_LIBRARIES) try_run(${_var} ${_var}_COMPILE ${test_BINARY_DIR} ${test_SOURCE_DIR}/platform/${_var}.c COMPILE_DEFINITIONS ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE}} ${CMAKE_REQUIRED_DEFINITIONS} CMAKE_FLAGS ${USING_THESE_LIBS} OUTPUT_VARIABLE ${_var}_OUTPUT ) message(STATUS CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE}: ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE}}) message(STATUS ${_var} : ${${_var}}) message(STATUS ${_var}_COMPILE : ${${_var}_COMPILE}) message(STATUS ${_var}_OUTPUT : ${${_var}_OUTPUT}) if(${${_var}}) set(${_var} 1) message(STATUS Compiling ${_var} - found) else(${${_var}}) set(${_var}) message(STATUS Compiling ${_var} - not found) endif(${${_var}}) endmacro(MY_C_COMPILE_AND_RUN_CHECK _var) set(CMAKE_C_FLAGS_TEST -m64 -std=c99) # do the compile test SET(CMAKE_REQUIRED_LIBRARIES -lm) MY_C_COMPILE_AND_RUN_CHECK(HAVE_ISFINITE) SET(CMAKE_REQUIRED_LIBRARIES) MESSAGE(STATUS HAVE_ISFINITE: ${HAVE_ISFINITE}) Here's an execution of the cmake script (above) ... -bash-3.00$ !cmake cmake -DCMAKE_BUILD_TYPE=TEST ../ -- The C compiler identification is GNU -- Check for working C compiler: /opt/gcc/bin/gcc -- Check for working C compiler: /opt/gcc/bin/gcc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Compiling HAVE_ISFINITE -- CMAKE_C_FLAGS_TEST: -m64 -std=c99 -- HAVE_ISFINITE : -- HAVE_ISFINITE_COMPILE : FALSE -- HAVE_ISFINITE_OUTPUT : Change Dir: /export/home/gneill/cmake/build/CMakeFiles/CMakeTmp Run Build Command:/usr/ccs/bin/make cmTryCompileExec/fast /usr/ccs/bin/make -f CMakeFiles/cmTryCompileExec.dir/build.make CMakeFiles/cmTryCompileExec.dir/build /opt/cmake-2.6.4-SunOS-sparc/bin/cmake -E cmake_progress_report /export/home/gneill/cmake/build/CMakeFiles/CMakeTmp/CMakeFiles 1 Building C object CMakeFiles/cmTryCompileExec.dir/HAVE_ISFINITE.c.o /opt/gcc/bin/gcc -m64 -std=c99 -o CMakeFiles/cmTryCompileExec.dir/HAVE_ISFINITE.c.o -c /export/home/gneill/cmake/platform/HAVE_ISFINITE.c Linking C executable cmTryCompileExec /opt/cmake-2.6.4-SunOS-sparc/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec.dir/link.txt --verbose=1 /opt/gcc/bin/gcc -fPIC CMakeFiles/cmTryCompileExec.dir/HAVE_ISFINITE.c.o -o cmTryCompileExec -lm ld: fatal: file CMakeFiles/cmTryCompileExec.dir/HAVE_ISFINITE.c.o: wrong ELF class: ELFCLASS64 ld: fatal: File processing errors. No output written to cmTryCompileExec collect2: ld returned 1 exit status *** Error code 1 make: Fatal error: Command failed for target `cmTryCompileExec' Current working directory /export/home/gneill/cmake/build/CMakeFiles/CMakeTmp *** Error code 1 make: Fatal error: Command failed for target `cmTryCompileExec/fast' -- Compiling HAVE_ISFINITE - not found -- HAVE_ISFINITE: -- Configuring done -- Generating done -- Build files have been written to: /export/home/gneill/cmake/build It appears to fail because the compiler options do not make it in when creating the executable ... is there something silly I have missed? Also, I was wondering why TRY_RUN doesn't use the default flags defined from CMAKE_BUILD_TYPE ? Is this a bug or am I not using TRY_RUN correctly? Thanks, George. ___ 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
Re: [CMake] FW: Cmake on Sun?
Bill, On Thu, Apr 16, 2009 at 1:03 PM, Bill Hoffman bill.hoff...@kitware.com wrote: indig...@blogistan.co.uk wrote: Quoting Bartlett, Roscoe A raba...@sandia.gov: Hello, An associate of mine tried to build CMake 2.6.2 on a Sun machine and got lots of errors (see the attached). Does CMake work in the Sun? What platforms is CMake supposed to support? We also have a nasty IBM AIX machine that we have to support. It is critical that CMake port to nearly every platform that we support and it is a pretty hard list of platforms. Which compiler is he using? The code quoted is C++, and GCC is less strict in its implementation of C++ standards than other compilers, particularly Sun Studio (e.g. allowing the dimensioning of arrays using variables, as in int d=6; int v[d]; - that is not valid C++ but would compile in GCC). . The Qt people found this out when trying to port Qt to Sun, and have been revising Qt to make sure the proprietary compilers can compile it. The problem seems to be in the boostrap script. Undefined first referenced symbol in file bool cmELF::ReadBytes(unsigned long,unsigned long,char*)const cmSystemTools.o That should only happen if CMAKE_USE_ELF_PARSER is defined: #if defined(CMAKE_USE_ELF_PARSER) # include cmELF.h #endif In 2.6.2 that is not defined during bootstrap. BTW, int d=6; int v[d] is invalid C++ and gcc is wrong... But, this is not a compiler issue, it is some odd issue with the boostrap script. Another option would be to get the binary cmake from www.cmake.org for the sun, and use that to bootstrap cmake and avoid the boostrap script. I seem to remember running in to this issue when trying to build cmake on SS10/Solari10. If I recall correctly, it turned out being an environment issue. A conflict with GNU ld/SUN ld? (but I may have lost some memory cells since then!) Later, George ___ 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
Re: [CMake] FW: Cmake on Sun?
On Thu, Apr 16, 2009 at 1:31 PM, Bill Hoffman bill.hoff...@kitware.com wrote: George Neill wrote: I seem to remember running in to this issue when trying to build cmake on SS10/Solari10. If I recall correctly, it turned out being an environment issue. A conflict with GNU ld/SUN ld? (but I may have lost some memory cells since then!) The boostrap cmake should not use any symbols from cmELF. So, I really don't think it is an ld issue. I was able to recreate this situation by prepending /usr/sfw/bin in my path and exporting -bash-3.00$ env | grep CC CXX=/opt/SUNWspro/bin/CC CC=/opt/SUNWspro/bin/cc then running, ./bootstrap --no-qt-gui --prefix=/tmp/cmake (note without setting CC and CXX, it picked up the gnu stuff and bootstrapped fine) So there is certainly a conflict somewhere. Later, George ___ 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
Re: [CMake] FW: Cmake on Sun?
On Thu, Apr 16, 2009 at 2:47 PM, Bill Hoffman bill.hoff...@kitware.com wrote: George Neill wrote: On Thu, Apr 16, 2009 at 1:31 PM, Bill Hoffman bill.hoff...@kitware.com wrote: George Neill wrote: I seem to remember running in to this issue when trying to build cmake on SS10/Solari10. If I recall correctly, it turned out being an environment issue. A conflict with GNU ld/SUN ld? (but I may have lost some memory cells since then!) The boostrap cmake should not use any symbols from cmELF. So, I really don't think it is an ld issue. I was able to recreate this situation by prepending /usr/sfw/bin in my path and exporting -bash-3.00$ env | grep CC CXX=/opt/SUNWspro/bin/CC CC=/opt/SUNWspro/bin/cc then running, ./bootstrap --no-qt-gui --prefix=/tmp/cmake (note without setting CC and CXX, it picked up the gnu stuff and bootstrapped fine) So there is certainly a conflict somewhere. Can you run nm on cmSystemTools.o | grep cmELF in the bootstrap directory? -bash-3.00$ /usr/ccs/bin/nm ./Bootstrap.cmk/cmSystemTools.o | grep cmELF [127] | 0| 0|FUNC |GLOB |0|UNDEF |__1cFcmELF2t6Mpkc_v_ [124] | 0| 0|FUNC |GLOB |0|UNDEF |__1cFcmELF2T6M_v_ [126] | 0| 0|FUNC |GLOB |0|UNDEF |__1cFcmELFFValid6kM_b_ [117] | 0| 0|FUNC |GLOB |0|UNDEF |__1cFcmELFIGetRPath6M_pkn0ALStringEntry__ [125] | 0| 0|FUNC |GLOB |0|UNDEF |__1cFcmELFJGetSOName6MrnDstdMbasic_string4Ccn0BLchar_traits4Cc__n0BJallocator4Cc_b_ [104] | 0| 0|FUNC |GLOB |0|UNDEF |__1cFcmELFJReadBytes6kMLLpc_b_ [116] | 0| 0|FUNC |GLOB |0|UNDEF |__1cFcmELFKGetRunPath6M_pkn0ALStringEntry__ [107] | 0| 0|FUNC |GLOB |0|UNDEF |__1cFcmELFUGetDynamicEntryCount6kM_I_ [106] | 0| 0|FUNC |GLOB |0|UNDEF |__1cFcmELFXGetDynamicEntryPosition6kMi_L_ HTH, George. ___ 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
Re: [CMake] FW: Cmake on Sun?
On Thu, Apr 16, 2009 at 3:36 PM, Bill Hoffman bill.hoff...@kitware.com wrote: George Neill wrote: On Thu, Apr 16, 2009 at 2:47 PM, Bill Hoffman bill.hoff...@kitware.com wrote: George Neill wrote: On Thu, Apr 16, 2009 at 1:31 PM, Bill Hoffman bill.hoff...@kitware.com wrote: George Neill wrote: I seem to remember running in to this issue when trying to build cmake on SS10/Solari10. If I recall correctly, it turned out being an environment issue. A conflict with GNU ld/SUN ld? (but I may have lost some memory cells since then!) The boostrap cmake should not use any symbols from cmELF. So, I really don't think it is an ld issue. I was able to recreate this situation by prepending /usr/sfw/bin in my path and exporting -bash-3.00$ env | grep CC CXX=/opt/SUNWspro/bin/CC CC=/opt/SUNWspro/bin/cc then running, ./bootstrap --no-qt-gui --prefix=/tmp/cmake (note without setting CC and CXX, it picked up the gnu stuff and bootstrapped fine) So there is certainly a conflict somewhere. Can you run nm on cmSystemTools.o | grep cmELF in the bootstrap directory? -bash-3.00$ /usr/ccs/bin/nm ./Bootstrap.cmk/cmSystemTools.o | grep cmELF [127] | 0| 0|FUNC |GLOB |0 |UNDEF |__1cFcmELF2t6Mpkc_v_ [124] | 0| 0|FUNC |GLOB |0 |UNDEF |__1cFcmELF2T6M_v_ [126] | 0| 0|FUNC |GLOB |0 |UNDEF |__1cFcmELFFValid6kM_b_ [117] | 0| 0|FUNC |GLOB |0 |UNDEF |__1cFcmELFIGetRPath6M_pkn0ALStringEntry__ [125] | 0| 0|FUNC |GLOB |0 |UNDEF |__1cFcmELFJGetSOName6MrnDstdMbasic_string4Ccn0BLchar_traits4Cc__n0BJallocator4Cc_b_ [104] | 0| 0|FUNC |GLOB |0 |UNDEF |__1cFcmELFJReadBytes6kMLLpc_b_ [116] | 0| 0|FUNC |GLOB |0 |UNDEF |__1cFcmELFKGetRunPath6M_pkn0ALStringEntry__ [107] | 0| 0|FUNC |GLOB |0 |UNDEF |__1cFcmELFUGetDynamicEntryCount6kM_I_ [106] | 0| 0|FUNC |GLOB |0 |UNDEF |__1cFcmELFXGetDynamicEntryPosition6kMi_L_ HTH, George. OK, can you try this... When can you remove cmSystemTools.o from the bootstrap directory. Then copy the compiler line and add a -E to the compiler link for cmSystemTools.o compile. That will show what the preprocessed output is. I will try later tonight. When I reproduced this error earlier today ... I was doing an in-source bootstrap. I ran the bootstrap twice, the first was using gnu toolset and the second with SS10 tools. Rechecking out the source and doing an out-of-source bootstrap I seemingly cannot reproduce the issue. So it might just be a keyboard operator issue!! I'll let you know what I find. Thanks, George ___ 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
Re: [CMake] FW: Cmake on Sun?
Bill, On Thu, Apr 16, 2009 at 10:46 PM, Bill Hoffman bill.hoff...@kitware.com wrote: George Neill wrote: I will try later tonight. When I reproduced this error earlier today ... I was doing an in-source bootstrap. I ran the bootstrap twice, the first was using gnu toolset and the second with SS10 tools. Rechecking out the source and doing an out-of-source bootstrap I seemingly cannot reproduce the issue. So it might just be a keyboard operator issue!! I'll let you know what I find. No, I think you found it... Good deal. I just reproduced the issue on a linux box. If you do this: 1. run bootstrap in source 2. rm Bootstrap.cmk/*.o 3. run bootstrap again I did a 'gmake clean' where your #2 is. I was looking for a dist-clean target, but doesn't exist :) The problem is the the cmConfigure.h gets put into the build/source tree, and it is configured for elf support. The next time bootstrap is run it picks up the cmConfigure.h from the Source tree and tries to build with elf support configured to be on, and you get the error. I guess this could happen if you were building a CVS CMake, and did an in-source bootstrap, then a cvs update, then an in-source bootstrap again. Makes sense. So from your point of view is this just a deal that needs documented or a bug which needs to be fixed? Thanks, George ___ 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
[CMake] CMAKE_INSTALL_PREFIX
Hi All, On windows, I pass CMAKE_INSTALL_PREFIX on the command line e.g. -DCMAKE_INSTALL_PREFIX=c:\some\path. In my cmake code I use variable which contain the suffixes /lib, /man/man1 etc... The install commands end up looking like this, C:\some\path/man/man1/some_man_file In 2.4 this appears to work, in 2.6 it throws an error about invalid escape sequences. I have tried to use FILE(TO_CMAKE_PATH ${CMAKE_INSTALL_PREFIX} TEMP_PREFIX) SET(CMAKE_INSTALL_PREFIX ${TEMP_PREFIX} CACHE INTERNAL my prefix) But that doesn't seem to stick, I suspect it's because I am passing it in on the command line. What is the best way to deal with this? TIA, George ___ 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
Re: [CMake] CMAKE_INSTALL_PREFIX
John, On Wed, Mar 18, 2009 at 12:57 PM, John Drescher dresche...@gmail.com wrote: Here is what I do for Program Files string (REPLACE \\ / PGM_FILES $ENV{PROGRAMFILES}) then I use PGM_FILES and there is no complaint about bad escape sequences. BTW, here is the whole section: IF(WIN32) #The following command changes \ to / in the Program Files Path so CMake will not complain #about bad escape sequences. string (REPLACE \\ / PGM_FILES $ENV{PROGRAMFILES}) SET (CMAKE_INSTALL_PREFIX ${PGM_FILES}/UPMC/${CMAKE_PROJECT_NAME} CACHE STRING Default Install Path FORCE) ENDIF(WIN32) .. and even if you pass in as a command line option -DCMAKE_INSTALL_PREFIX= ? I couldn't get FORCE to work either. Possibly because I was using INTERNAL and not STRING. It seems the following works (at least the cmake_install.cmake commands appear to get generated appropriately). FILE(TO_CMAKE_PATH ${CMAKE_INSTALL_PREFIX} CMAKE_INSTALL_PREFIX) Is there a CMP policy which deals with this which I have missed? Thanks, George. ___ 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
Re: [CMake] Fwd: CMAKE_INSTALL_PREFIX
On Wed, Mar 18, 2009 at 2:50 PM, John Drescher dresche...@gmail.com wrote: -- Forwarded message -- Please remember to send this to the cmake list as well. There are experts who should be better help than me.. My apologies, I thought I was! Thanks, George. ___ 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
[CMake] typedef vs. macro
Hi All, I have ran in to some third party header code which looks like this (shortened for this example) #ifdef OPTION #define SOMETYPE int #else typedef int SOMETYPE; #endif Here is what I have come up with, CHECK_SYMBOL_EXISTS(SOMETYPE type.h HAVE_SOMETYPE_DEFINE) CHECK_TYPE_SIZE(SOMETYPE SOMETYPE_TYPEDEF) IF(HAVE_SOMETYPE_DEFINE OR HAVE_SOMETYPE_TYPEDEF) SET(HAVE_SOMETYPE 1) ENDIF(HAVE_SOMETYPE_DEFINE OR HAVE_SOMETYPE_TYPEDEF) Is there a better way to deal with this? TIA, George. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] typedef vs. macro
On Tue, Feb 3, 2009 at 1:33 AM, George Neill geor...@neillnet.com wrote: Hi All, I have ran in to some third party header code which looks like this (shortened for this example) #ifdef OPTION #define SOMETYPE int #else typedef int SOMETYPE; #endif Here is what I have come up with, CHECK_SYMBOL_EXISTS(SOMETYPE type.h HAVE_SOMETYPE_DEFINE) CHECK_TYPE_SIZE(SOMETYPE SOMETYPE_TYPEDEF) IF(HAVE_SOMETYPE_DEFINE OR HAVE_SOMETYPE_TYPEDEF) SET(HAVE_SOMETYPE 1) ENDIF(HAVE_SOMETYPE_DEFINE OR HAVE_SOMETYPE_TYPEDEF) Is there a better way to deal with this? Of course, as soon as I hit send .. I realized I can probably just do the CHECK_TYPE_SIZE check and drop the CHECK_SYMBOL_EXISTS check; since I know it's a type. Later, George. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] Proper way to write a FIND_PACKAGE
All, Is this the recommended recipe to write FIND_PACKAGE() cmake scripts? http://vtk.org/Wiki/CMake:How_To_Find_Libraries#Writing_find_modules TIA, George. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] cmake and sun workshop compiler.
Bill, On Tue, Dec 9, 2008 at 7:02 AM, Bill Hoffman [EMAIL PROTECTED] wrote: George Neill wrote: Hi CMakers, I'd like to use cmake with the Sun cc/CC compiler on linux. What do I need to change to make this work? Put them in your PATH. Then set CC=cc, CXX=CC and run cmake. It looks like it's picking up the gcc/g++ flags. [EMAIL PROTECTED]:~/test$ cat CMakeLists.txt PROJECT(test) ADD_EXECUTABLE(test1 t.c) ADD_EXECUTABLE(test2 t.cpp) [EMAIL PROTECTED]:~/test$ cmake . -- Check for working C compiler: /home/gneill/Desktop/sse/sunstudioceres/bin/cc -- Check for working C compiler: /home/gneill/Desktop/sse/sunstudioceres/bin/cc -- works -- Check size of void* -- Check size of void* - done -- Check for working CXX compiler: /home/gneill/Desktop/sse/sunstudioceres/bin/CC -- Check for working CXX compiler: /home/gneill/Desktop/sse/sunstudioceres/bin/CC -- broken CMake Error: The C++ compiler /home/gneill/Desktop/sse/sunstudioceres/bin/CC is not able to compile a simple test program. It fails with the following output: /usr/bin/make -f CMakeFiles/cmTryCompileExec.dir/build.make CMakeFiles/cmTryCompileExec.dir/build make[1]: Entering directory `/home/gneill/test/CMakeFiles/CMakeTmp' /usr/bin/cmake -E cmake_progress_report /home/gneill/test/CMakeFiles/CMakeTmp/CMakeFiles 1 Building CXX object CMakeFiles/cmTryCompileExec.dir/testCXXCompiler.o /home/gneill/Desktop/sse/sunstudioceres/bin/CC-o CMakeFiles/cmTryCompileExec.dir/testCXXCompiler.o -c /home/gneill/test/CMakeFiles/CMakeTmp/testCXXCompiler.cxx Linking CXX executable cmTryCompileExec /usr/bin/cmake -P CMakeFiles/cmTryCompileExec.dir/cmake_clean_target.cmake /home/gneill/Desktop/sse/sunstudioceres/bin/CC -fPIC CMakeFiles/cmTryCompileExec.dir/testCXXCompiler.o -o cmTryCompileExec -rdynamic CC: Warning: Option -fPIC passed to ld, if ld is invoked, ignored otherwise CC: Warning: Option -rdynamic passed to ld, if ld is invoked, ignored otherwise /home/gneill/Desktop/sse/sunstudioceres/prod/lib/ld: bad -rpath option make[1]: *** [cmTryCompileExec] Error 1 make[1]: Leaving directory `/home/gneill/test/CMakeFiles/CMakeTmp' make: *** [cmTryCompileExec/fast] Error 2 CMake will not be able to correctly generate this project. -- Configuring done TIA, George. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] cmake and sun workshop compiler.
Bill, On Tue, Dec 9, 2008 at 9:43 AM, Bill Hoffman [EMAIL PROTECTED] wrote: George Neill wrote: Bill, On Tue, Dec 9, 2008 at 7:02 AM, Bill Hoffman [EMAIL PROTECTED] wrote: George Neill wrote: Hi CMakers, I'd like to use cmake with the Sun cc/CC compiler on linux. What do I need to change to make this work? Put them in your PATH. Then set CC=cc, CXX=CC and run cmake. It looks like it's picking up the gcc/g++ flags. CC: Warning: Option -fPIC passed to ld, if ld is invoked, ignored otherwise CC: Warning: Option -rdynamic passed to ld, if ld is invoked, ignored otherwise /home/gneill/Desktop/sse/sunstudioceres/prod/lib/ld: bad -rpath option make[1]: *** [cmTryCompileExec] Error 1 make[1]: Leaving directory `/home/gneill/test/CMakeFiles/CMakeTmp' make: *** [cmTryCompileExec/fast] Error 2 What version of cmake are you using? We have a dashboard with this compiler and it works fine: http://www.cdash.org/CDash/viewNotes.php?buildid=228158 [EMAIL PROTECTED]:~$ cmake --version cmake version 2.4-patch 7 Do you have CXXFLAGS, CFLAGS, or LDFLAGS set in your environment before you run CMake that have gnu flags in them? I do not, [EMAIL PROTECTED]:~$ env | grep CC [EMAIL PROTECTED]:~$ env | grep CXX [EMAIL PROTECTED]:~$ env | grep LDFLAGS [EMAIL PROTECTED]:~$ I am trying to use the Sun Studio Express compiler, from what I understand is the same as the Studio compiler with new features and performance updates ... to be included into the next Studio release. http://developers.sun.com/sunstudio/downloads/express/index.jsp?intcmp=2091cid=926973 Thanks, George. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] cmake and sun workshop compiler.
Hi CMakers, I'd like to use cmake with the Sun cc/CC compiler on linux. What do I need to change to make this work? Thanks, George. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] if(MATCHES) broken??
Matthew, On Wed, Nov 19, 2008 at 5:56 PM, Matthew Woehlke [EMAIL PROTECTED] wrote: Can someone explain to me: - why this doesn't work (prints CFLAGS match broken!!) - if it's supposed to work or if this is a bug - a great work-around to this problem ;-) This is with cmake 2.6.2 macro(foo bar) if(${bar} MATCHES CFLAGS) message(STATUS CFLAGS matched) elseif(${bar} STREQUAL CFLAGS) message(STATUS CFLAGS match broken!!!) endif() endmacro() function(nonce) foreach(arg ${ARGN}) foo(${arg}) endforeach() endfunction() set(CFLAGS happyjoy) foo(CFLAGS) Background: I'm trying to write a function that is invoked like: foobar(mylib CFLAGS -DFOO -DBAR SOURCES foo.c bar.c LINK_LIBRARIES mib) Maybe there is some great mechanism for dealing with this sort of list-splitting that I don't know about? Meanwhile, what I am doing is something like this: - For each arg, 'if(${ARG} MATCHES CFLAGS|SOURCES|LINK_LIBRARIES', set _arg_mode to ${arg}, otherwise based on ${_arg_mode}, do a list(APPEND) to one of _cflags, _sources, _libs. - add_library(${NAME} ${_sources}) - do some target_link_libraries, set_target_properties based on _cflags, _libs, etc. Here's a macro I wrote and a discussion I started some time ago, http://www.cmake.org/pipermail/cmake/2008-May/021361.html It's probably pretty close to what you are looking to do. HTH, George. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Path problem when building a jar file
Robert, On Wed, Oct 29, 2008 at 6:14 AM, Robert Haines [EMAIL PROTECTED] wrote: Hi George, snip my long winded question I filed a bug on this the other day and posted a temporary solution (attached to the bug) http://www.cmake.org/Bug/view.php?id=7832 Hope that helps, It certainly does, thank you very much! I too noticed that previously the jar was generated with a number of extra files in it too - looked like the CMake build machinery for that directory. Yes. That is correct and the only reason I created the .class directory ... to shake those out. I'll add a note to the bug that confirms your workaround for my situation too. Great! Glad it worked for you. Later, George. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] SS12 and -xcode=pic32
Alan, On Tue, Oct 28, 2008 at 1:00 AM, Alan W. Irwin [EMAIL PROTECTED] wrote: On 2008-10-27 15:27-0500 George Neill wrote: Alan, On Mon, Oct 27, 2008 at 3:10 PM, Alan W. Irwin [EMAIL PROTECTED] wrote: On 2008-10-27 12:54-0500 George Neill wrote: Hi All, I am using cmake 2.4.8 and Sun Studio 12. I am trying to overwrite these default cmake compiler settings from Modules/Platorm/SunOS.cmake SET(CMAKE_SHARED_LIBRARY_C_FLAGS -KPIC) SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS -KPIC) to SET(CMAKE_SHARED_LIBRARY_C_FLAGS -xcode=pic32) SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS -xcode=pic32) However I am not having any luck. {...] Any suggestions? The brute-force but completely reliable method is to set your desired compilers and associated flags before running cmake, e.g., export CC='cc -xcode=pic32' export CXX='c++ -xcode=pic32' Should that be ... export CFLAGS=-xcode=pic32 export CXXFLAGS=-xcode=pic32 Uh... No. To set the record straight for others reading this in the future, please do exactly what I suggested (which works) rather than trying something else. George, in your defense, you probably believed the wiki documentation :-) *wink* yeah i'll go with that ... though it's more likely to be my silly habits from years of unix compiles. :) Your suggestion does work perfectly when _all_ items in the build require those flags. I am looking just to compile only my shared libs (and a couple of exes) with -xcode=pic32 .. the rest of my source doesn't need the compile flag, infact, the default -xcode=abs44 is better for performance reasons. http://www.vtk.org/Wiki/CMake_Useful_Variables does mention CC and CXX, but that site now fails to mention that you can also set the associated compile flags at the same time if you follow my instructions above. Somebody removed discussion of that possibility from the wiki a year or so ago. I feel that was a mistake since the method is so useful and so reliable. If you are interested in how the method is implemented, check out the CMake logic you see at the top of Modules/CMakeDetermineLANGCompiler.cmake which uses, e.g., GET_FILENAME_COMPONENT(CMAKE_C_COMPILER_INIT $ENV{CC} PROGRAM PROGRAM_ARGS CMAKE_C_FLAGS_ENV_INIT) to extract the compiler name AND associated flags from the environment variable. I'll spend some time researching. Thanks for the pointer. Apparently, Bill is also helping you find an internal CMake method of overriding the default compile flags, but I prefer the environment variable approach for doing the same thing. The reason is that, by definition, that can be used by one user with special platform needs without interfering with other users building the same software package on different platforms. Of course, the internal method is fine if you have a single-user package or if you can hedge the internal method around with enough CMake platform detection logic so it doesn't interfere with users on other platforms. Well, Bill answered my original question about setting the CMAKE_SHARED_LIBRARY_C_FLAGS variable and I guess now I am just trying to make sure I am using cmake in an acceptable way when overriding compile flags. I probably should have spun a new thread, I apologize for not doing so. Thanks for your comments, I really appreciate it. Later, George ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] SS12 and -xcode=pic32
On Tue, Oct 28, 2008 at 8:40 AM, Bill Hoffman [EMAIL PROTECTED] wrote: George Neill wrote: To set the record straight for others reading this in the future, please do exactly what I suggested (which works) rather than trying something else. Actually, to set the record straight, your approach is not good in this case. It will, as George points out, use the pic flags every where and not just with shared objects. This may or may not be what people want. Basically, George is trying to get around a bug in the Platform file for CMake. George if you could create a bug entry for this I would appreciate it. Also please include the version of the compiler when this new flag started being used so the platform file can be made to do the right thing. To be clear, the -KPIC flag still appears to be a valid flag in SS12 ... even though the man page says, for SPARC, it's obsolete and you shouldn't use it. http://cmake.org/Bug/view.php?id=7873 Thanks, George ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Path problem when building a jar file
Hi Robert, On Tue, Oct 28, 2008 at 1:07 PM, Robert Haines [EMAIL PROTECTED] wrote: Hi all, I am building a jar file but I can't get the paths right within it. I have a directory structure like this source-root/org/some/package/files.java source-root/org/some/other/files.java and I want the compiled .class files to all go into the same jar file. If I have a CMakeLists.txt in source-root simply do a add_library(JarName ${FILES}) (where FILES is a list of all the java files relative to source-root) my jar file is full of paths like this: org/some/package/org/some/package/files.java org/some/other/org/some/other/files.java ie, because CMake builds everything in a directory relative to source-root in the binary tree and then javac puts the files in their package directories using this as a starting point, the package structure gets duplicated. It seems as though CMake is being over zealous in its use of the -d flag to javac. Either that or at the link step the wrong directory is being passed to jar via the -C flag. I have tried to override the -d and -C flags with a combination of set_source_files_properties and set_target_properties with no joy. Another way I have tried is to have a CMakeLists.txt in the source-root/org/some/package/ directory. If I do this I can get the paths right for that particular branch of the package scheme but can't get the classes in the org/some/other/ branch into the same jar file. Has anyone managed to do this with CMake? It seems to be an overwhelmingly simple thing to do so I must be doing it wrong! I filed a bug on this the other day and posted a temporary solution (attached to the bug) http://www.cmake.org/Bug/view.php?id=7832 Hope that helps, George. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] SS12 and -xcode=pic32
Hi All, I am using cmake 2.4.8 and Sun Studio 12. I am trying to overwrite these default cmake compiler settings from Modules/Platorm/SunOS.cmake SET(CMAKE_SHARED_LIBRARY_C_FLAGS -KPIC) SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS -KPIC) to SET(CMAKE_SHARED_LIBRARY_C_FLAGS -xcode=pic32) SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS -xcode=pic32) However I am not having any luck. The manpage says -KPIC is obsolete and -xcode=pic32 should be used instead. quote -KPIC (SPARC) Obsolete. You should not use this option. Use -xcode=pic32 instead. For a complete list of obsolete options and flags, see the C User's Guide. (x86) -KPIC is identical to -Kpic on x86 architectures. /quote I also found this conversation describing the flags, http://unix.derkeiler.com/Newsgroups/comp.unix.solaris/2005-12/msg01281.html Any suggestions? Thanks, George ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] SS12 and -xcode=pic32
Alan, On Mon, Oct 27, 2008 at 3:10 PM, Alan W. Irwin [EMAIL PROTECTED] wrote: On 2008-10-27 12:54-0500 George Neill wrote: Hi All, I am using cmake 2.4.8 and Sun Studio 12. I am trying to overwrite these default cmake compiler settings from Modules/Platorm/SunOS.cmake SET(CMAKE_SHARED_LIBRARY_C_FLAGS -KPIC) SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS -KPIC) to SET(CMAKE_SHARED_LIBRARY_C_FLAGS -xcode=pic32) SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS -xcode=pic32) However I am not having any luck. {...] Any suggestions? The brute-force but completely reliable method is to set your desired compilers and associated flags before running cmake, e.g., export CC='cc -xcode=pic32' export CXX='c++ -xcode=pic32' Should that be ... export CFLAGS=-xcode=pic32 export CXXFLAGS=-xcode=pic32 ... neither of those methods will remove/replace the -KPIC flag from the compile line. But yeah, that brings up another issue; I don't want to unnecessarily compile all of my code with -xcode=pic32 when it doesn't need to. TIA, George. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] SS12 and -xcode=pic32
On Mon, Oct 27, 2008 at 3:33 PM, Bill Hoffman [EMAIL PROTECTED] wrote: George Neill wrote: Alan, On Mon, Oct 27, 2008 at 3:10 PM, Alan W. Irwin [EMAIL PROTECTED] wrote: On 2008-10-27 12:54-0500 George Neill wrote: Hi All, I am using cmake 2.4.8 and Sun Studio 12. I am trying to overwrite these default cmake compiler settings from Modules/Platorm/SunOS.cmake SET(CMAKE_SHARED_LIBRARY_C_FLAGS -KPIC) SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS -KPIC) to SET(CMAKE_SHARED_LIBRARY_C_FLAGS -xcode=pic32) SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS -xcode=pic32) Setting these in the right place should work. project(foo) set(CMAKE_SHARED_LIBRARY_C_FLAGS -xcode=pic32) add_library(foo SHARED foo.c) I believe this is my issue, I am setting the variable before I issue the PROJECT command. I have created my own CMAKE_BUILD_TYPE's and I do all of my compiler (flags, etc...) assignments before the PROJECT command, is there a better way to do this? Thanks much, George. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] SS12 and -xcode=pic32
Bill, On Mon, Oct 27, 2008 at 3:55 PM, Bill Hoffman [EMAIL PROTECTED] wrote: George Neill wrote: Setting these in the right place should work. project(foo) set(CMAKE_SHARED_LIBRARY_C_FLAGS -xcode=pic32) add_library(foo SHARED foo.c) I believe this is my issue, I am setting the variable before I issue the PROJECT command. I have created my own CMAKE_BUILD_TYPE's and I do all of my compiler (flags, etc...) assignments before the PROJECT command, is there a better way to do this? That would do it... You want to look at CMAKE_USER_MAKE_RULES_OVERRIDE: http://www.cmake.org/cmake/help/cmake2.6docs.html#variable:CMAKE_USER_MAKE_RULES_OVERRIDE Thanks, I will do that. I have read through, http://www.itk.org/Wiki/CMake_FAQ#How_can_I_extend_the_build_modes_with_a_custom_made_one_.3F, http://www.cmake.org/pipermail/cmake/2008-September/023808.html and http://www.mip.informatik.uni-kiel.de/~jw/cmake/CMakeModules/DefineFlags.cmake ... and I must have assumed all of the compiler flags should be set before the PROJECT command had been issued. Is there a better place to read up on how to properly override the CMAKE_BUILD_TYPE and compiler options? Also, I have placed a small example project which overrides CMAKE_BUILD_TYPE and compiler options here (http://sugar.bitshed.com/example.zip) ... if you, or anyone else, has time, would you look at it and provide guidance/comments!? TIA, George ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Fortran to C mapping module
Bill, On Mon, Oct 27, 2008 at 8:46 PM, Bill Hoffman [EMAIL PROTECTED] wrote: I have just checked in a module to help with the linking of Fortran from C. I would appreciate some feedback, and perhaps some testing with different Fortran compilers. Does anyone know of a web site that lists different Fortran compiler name mangling schemes? Not sure if this will help you much, but, http://en.wikipedia.org/wiki/Name_mangling#Name_mangling_in_Fortran speaks of a few. Later, George. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] mixed java/c project.
Mathieu, On Mon, Oct 20, 2008 at 4:06 AM, Mathieu Malaterre [EMAIL PROTECTED] wrote: On Sat, Oct 18, 2008 at 7:48 PM, George Neill [EMAIL PROTECTED] wrote: Hi All, On Sat, Oct 18, 2008 at 2:01 AM, George Neill [EMAIL PROTECTED] wrote: Hi all, I am trying to convert a project to cmake which has mixed java and c compilations. Here's the project layout, project/ - src/c - src/java I get the java project to build fine if I use the top level CMakeLists.txt file, but if I use add_subdirectory(src/java) in the top level CMakeLists.txt and create a CMakeLists.txt file in src/java it appears to break (below is the error) The -d option of the javac command line appears to be coming out wrong ... CMakeFiles/luajava.dir/org/keplerproject/luajava should actually be src/java/CMakeFiles/luajava.dir/org/keplerproject/luajava I took a look in Modules/CMakeJavaInformation.cmake and here's what I found, # compile a Java file into an object file IF(NOT CMAKE_Java_COMPILE_OBJECT) SET(CMAKE_Java_COMPILE_OBJECT CMAKE_Java_COMPILER FLAGS SOURCE -d OBJECT_DIR) ENDIF(NOT CMAKE_Java_COMPILE_OBJECT) OBJECT_DIR seems to be the wrong place, any ideas on the best way to fix this? Well, it looks like this isn't a new issue. ( http://www.mail-archive.com/cmake@cmake.org/msg02564.html ) I was able to get by it by doing this, SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) SET(CMAKE_USER_MAKE_RULES_OVERRIDE override) my override.cmake contains, # compile a Java file into an object file IF(NOT CMAKE_Java_COMPILE_OBJECT) SET(CMAKE_Java_COMPILE_OBJECT CMAKE_Java_COMPILER FLAGS SOURCE -d CMAKE_CURRENT_BINARY_DIR/OBJECT_DIR) ENDIF(NOT CMAKE_Java_COMPILE_OBJECT) Is this acceptable, or should I be doing something else? IMHO I think it is. Please open a bug report, otherwise it might get lost -again?- I will. I have made a couple of changes since I last posted. I found out my change, while it did make everything compile fine ... messed up the .jar file creation. So here's what I ended up with, bash-3.00$ cat override.cmake # compile a Java file into an object file FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/.class) SET(CMAKE_Java_COMPILE_OBJECT CMAKE_Java_COMPILER FLAGS SOURCE -d CMAKE_CURRENT_BINARY_DIR/.class ) # this is a place holder if java needed flags for javac they would go here. SET(CMAKE_Java_CREATE_STATIC_LIBRARY CMAKE_Java_ARCHIVE -cf TARGET -C CMAKE_CURRENT_BINARY_DIR/.class . ) Thanks, George. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] mixed java/c project.
Mathieu, On Mon, Oct 20, 2008 at 4:06 AM, Mathieu Malaterre [EMAIL PROTECTED] wrote: On Sat, Oct 18, 2008 at 7:48 PM, George Neill [EMAIL PROTECTED] wrote: Hi All, On Sat, Oct 18, 2008 at 2:01 AM, George Neill [EMAIL PROTECTED] wrote: Hi all, I am trying to convert a project to cmake which has mixed java and c compilations. Here's the project layout, project/ - src/c - src/java I get the java project to build fine if I use the top level CMakeLists.txt file, but if I use add_subdirectory(src/java) in the top level CMakeLists.txt and create a CMakeLists.txt file in src/java it appears to break (below is the error) The -d option of the javac command line appears to be coming out wrong ... CMakeFiles/luajava.dir/org/keplerproject/luajava should actually be src/java/CMakeFiles/luajava.dir/org/keplerproject/luajava I took a look in Modules/CMakeJavaInformation.cmake and here's what I found, # compile a Java file into an object file IF(NOT CMAKE_Java_COMPILE_OBJECT) SET(CMAKE_Java_COMPILE_OBJECT CMAKE_Java_COMPILER FLAGS SOURCE -d OBJECT_DIR) ENDIF(NOT CMAKE_Java_COMPILE_OBJECT) OBJECT_DIR seems to be the wrong place, any ideas on the best way to fix this? Well, it looks like this isn't a new issue. ( http://www.mail-archive.com/cmake@cmake.org/msg02564.html ) I was able to get by it by doing this, SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) SET(CMAKE_USER_MAKE_RULES_OVERRIDE override) my override.cmake contains, # compile a Java file into an object file IF(NOT CMAKE_Java_COMPILE_OBJECT) SET(CMAKE_Java_COMPILE_OBJECT CMAKE_Java_COMPILER FLAGS SOURCE -d CMAKE_CURRENT_BINARY_DIR/OBJECT_DIR) ENDIF(NOT CMAKE_Java_COMPILE_OBJECT) Is this acceptable, or should I be doing something else? IMHO I think it is. Please open a bug report, otherwise it might get lost -again?- http://cmake.org/Bug Done!, http://cmake.org/Bug/view.php?id=7832 Thanks, George. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] mixed java/c project.
Hi all, I am trying to convert a project to cmake which has mixed java and c compilations. Here's the project layout, project/ - src/c - src/java I get the java project to build fine if I use the top level CMakeLists.txt file, but if I use add_subdirectory(src/java) in the top level CMakeLists.txt and create a CMakeLists.txt file in src/java it appears to break (below is the error) The -d option of the javac command line appears to be coming out wrong ... CMakeFiles/luajava.dir/org/keplerproject/luajava should actually be src/java/CMakeFiles/luajava.dir/org/keplerproject/luajava I took a look in Modules/CMakeJavaInformation.cmake and here's what I found, # compile a Java file into an object file IF(NOT CMAKE_Java_COMPILE_OBJECT) SET(CMAKE_Java_COMPILE_OBJECT CMAKE_Java_COMPILER FLAGS SOURCE -d OBJECT_DIR) ENDIF(NOT CMAKE_Java_COMPILE_OBJECT) OBJECT_DIR seems to be the wrong place, any ideas on the best way to fix this? TIA, George. bash-3.00$ make VERBOSE=1 /usr/bin/cmake -H/home/gneill/tmp/luajava-1.1 -B/home/gneill/tmp/luajava-1.1/build --check-build-system CMakeFiles/Makefile.cmake 0 /usr/bin/cmake -E cmake_progress_start /home/gneill/tmp/luajava-1.1/build/CMakeFiles 9 make -f CMakeFiles/Makefile2 all make[1]: Entering directory `/home/gneill/tmp/luajava-1.1/build' make -f src/java/CMakeFiles/luajava.dir/build.make src/java/CMakeFiles/luajava.dir/depend make[2]: Entering directory `/home/gneill/tmp/luajava-1.1/build' make[2]: Nothing to be done for `src/java/CMakeFiles/luajava.dir/depend'. make[2]: Leaving directory `/home/gneill/tmp/luajava-1.1/build' make -f src/java/CMakeFiles/luajava.dir/build.make src/java/CMakeFiles/luajava.dir/build make[2]: Entering directory `/home/gneill/tmp/luajava-1.1/build' /usr/bin/cmake -E cmake_progress_report /home/gneill/tmp/luajava-1.1/build/CMakeFiles 1 [ 11%] Building Java object src/java/CMakeFiles/luajava.dir/org/keplerproject/luajava/CPtr.class /usr/java6_64/bin/javac-sourcepath /home/gneill/tmp/luajava-1.1/src/java /home/gneill/tmp/luajava-1.1/src/java/org/keplerproject/luajava/CPtr.java -d CMakeFiles/luajava.dir/org/keplerproject/luajava javac: directory not found: CMakeFiles/luajava.dir/org/keplerproject/luajava Usage: javac options source files use -help for a list of possible options make[2]: *** [src/java/CMakeFiles/luajava.dir/org/keplerproject/luajava/CPtr.class] Error 2 make[2]: Leaving directory `/home/gneill/tmp/luajava-1.1/build' make[1]: *** [src/java/CMakeFiles/luajava.dir/all] Error 2 make[1]: Leaving directory `/home/gneill/tmp/luajava-1.1/build' make: *** [all] Error 2 ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] mixed java/c project.
Hi All, On Sat, Oct 18, 2008 at 2:01 AM, George Neill [EMAIL PROTECTED] wrote: Hi all, I am trying to convert a project to cmake which has mixed java and c compilations. Here's the project layout, project/ - src/c - src/java I get the java project to build fine if I use the top level CMakeLists.txt file, but if I use add_subdirectory(src/java) in the top level CMakeLists.txt and create a CMakeLists.txt file in src/java it appears to break (below is the error) The -d option of the javac command line appears to be coming out wrong ... CMakeFiles/luajava.dir/org/keplerproject/luajava should actually be src/java/CMakeFiles/luajava.dir/org/keplerproject/luajava I took a look in Modules/CMakeJavaInformation.cmake and here's what I found, # compile a Java file into an object file IF(NOT CMAKE_Java_COMPILE_OBJECT) SET(CMAKE_Java_COMPILE_OBJECT CMAKE_Java_COMPILER FLAGS SOURCE -d OBJECT_DIR) ENDIF(NOT CMAKE_Java_COMPILE_OBJECT) OBJECT_DIR seems to be the wrong place, any ideas on the best way to fix this? Well, it looks like this isn't a new issue. ( http://www.mail-archive.com/cmake@cmake.org/msg02564.html ) I was able to get by it by doing this, SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) SET(CMAKE_USER_MAKE_RULES_OVERRIDE override) my override.cmake contains, # compile a Java file into an object file IF(NOT CMAKE_Java_COMPILE_OBJECT) SET(CMAKE_Java_COMPILE_OBJECT CMAKE_Java_COMPILER FLAGS SOURCE -d CMAKE_CURRENT_BINARY_DIR/OBJECT_DIR) ENDIF(NOT CMAKE_Java_COMPILE_OBJECT) Is this acceptable, or should I be doing something else? Thanks, George. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] CHECK_FUNCTION_EXISTS
Hi All, I am using cmake 2.4.8, compiling on the solaris platform with SS12. I am running cmake like this, export CC=/path/to/SUNWSpro/bin/cc export CXX=/path/to/SUNWspro/bin/CC cmake -DCMAKE_BUILD_TYPE:STRING=MYBUILDTYPE ../path/to/src I have overridden these variables before any PROJECT (or other cmake command) in my top level CMakeLists.txt file. SET(CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE}_INIT -m64 -xarch=sparcvis) SET(CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}_INIT -m64 -xarch=sparcvis) These flags don't seem to make it to the compile line when I use the CHECK_FUNCTION_EXISTS module. I do see there's a CMAKE_REQUIRED_FLAGS variable I could set before the test, however, I guess I assume by setting the *_INIT variables I shouldn't have to override it. Am I way off? TIA, George. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] multi-line definitions
Yuri On Tue, Sep 23, 2008 at 1:54 PM, Emmanuel Blot [EMAIL PROTECTED] wrote: The only way would be something like this: set(a -mcpu=arm7tdmi -std=gnu99 -fgnu89-inline -finline-functions) set(a ${a} -ffunction-sections -fdata-sections ) set(a ${a} -fno-strict-aliasing -mno-thumb -Os -fomit-frame-pointer) I use a list. SET(MY_C_FLAGS -O3 -m32 -DNDEBUG -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -s # strip debug symbols ) Then turn it into a string later, I haven't ran into any issues doing it this way yet. But this turns into list (in terms of cmake) that is string with semicolon-separated elements (not space-separated). And this may be a problem in some cases, and initial compile flags seems to be the case. I have a macro which iterates over the list (semi-colon separated) and turns it in to a string (space separated). I haven't had any troubles. It is possible you might run into troubles if you need to have quotes or something like that in your compile options, but I haven't run in to that case yet. Hope that makes sense. Later, George. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] multi-line definitions
Hi Manu, On Tue, Sep 23, 2008 at 1:54 PM, Emmanuel Blot [EMAIL PROTECTED] wrote: The only way would be something like this: set(a -mcpu=arm7tdmi -std=gnu99 -fgnu89-inline -finline-functions) set(a ${a} -ffunction-sections -fdata-sections ) set(a ${a} -fno-strict-aliasing -mno-thumb -Os -fomit-frame-pointer) I use a list. SET(MY_C_FLAGS -O3 -m32 -DNDEBUG -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -s # strip debug symbols ) Then turn it into a string later, I haven't ran into any issues doing it this way yet. HTH, George. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] hpux (cma vs. pthreads)
Alexander, On Thu, Aug 14, 2008 at 2:45 PM, Alexander Neundorf [EMAIL PROTECTED] wrote: On Thursday 14 August 2008, George Neill wrote: Hi All, I am trying to compile a multi-threaded app (using pthreads) on hpux 11.23 IA -- CMAKE_SYSTEM ...HP-UX-B.11.23 -- CMAKE_SYSTEM_NAME...HP-UX -- CMAKE_SYSTEM_VERSION ...B.11.23 -- CMAKE_C_COMPILER: ../opt/aCC/bin/cc -- CMAKE_CXX_COMPILER: /opt/aCC/bin/aCC It seems as though FindThreads.cmake is not complete. I do _not_ want to link with the cma thread library (http://docs.hp.com/en/5187-0172/ch10s03.html). There doesn't seem to be an obvious way to tell FindThreads.cmake this. I am thinking it should prefer -lpthread over -lcma, if it exists. Anyone have suggestions on the best way to change FindThreads.cmake to handle this? There is a feature request in the bug tracker for a FindPThreads.cmake: http://public.kitware.com/Bug/view.php?id=6399 Please try the module attached there and let me know if it works for you. It does work, however I am not using just pthreads on all platforms. For now I have just copied FindThreads.cmake and commented out the HPUX cma thread hack. I will try to put together a patch for FindThreads.cmake at a later date. Thanks, George. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] hpux (cma vs. pthreads)
Hi All, I am trying to compile a multi-threaded app (using pthreads) on hpux 11.23 IA -- CMAKE_SYSTEM ...HP-UX-B.11.23 -- CMAKE_SYSTEM_NAME...HP-UX -- CMAKE_SYSTEM_VERSION ...B.11.23 -- CMAKE_C_COMPILER: ../opt/aCC/bin/cc -- CMAKE_CXX_COMPILER: /opt/aCC/bin/aCC It seems as though FindThreads.cmake is not complete. I do _not_ want to link with the cma thread library (http://docs.hp.com/en/5187-0172/ch10s03.html). There doesn't seem to be an obvious way to tell FindThreads.cmake this. I am thinking it should prefer -lpthread over -lcma, if it exists. Anyone have suggestions on the best way to change FindThreads.cmake to handle this? TIA, George. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] windows resource flags.
All, I need to define a couple of symbols for the windows resource compiler (rc.exe). SET(CMAKE_RC_FLAGS /d KEY1=VAL1 /d KEY2=VAL2) Would this be the correct way to do it? Thanks, George. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] CHECK_INCLUDE_FILES
Bill, I have ran into a problem on Solaris (v10/SS12) with CHECK_INCLUDE_FILES. I believe this is actually a bug in the header file I am checking for but none-the-less it's a problem for me. I am using cmake 2.4.8. CHECK_INCLUDE_FILES(netinet/tcp.h HAVE_NETINET_TCP_H) here's a quick test program i wrote to mock up what CHECK_INCLUDE_FILES() is doing ... -bash-3.00$ cat test.c #include netinet/tcp.h int main() { return 0; } Here's the compiler results, -bash-3.00$ cc test.c /usr/include/netinet/tcp.h, line 40: syntax error before or at: uint_t cc: acomp failed for test.c It's obvious to me the netinet/tcp.h header file should have included sys/types.h My question is, is there a way to solve this without creating my own check_include_files macro()? set(CMAKE_REQUIRED_INCLUDES sys/types.h) CHECK_INCLUDE_FILES(netinet/tcp.h HAVE_NETINET_TCP_H) ./bin/cmake --help-module CheckIncludeFiles The following variables may be set before calling this macro to modify the way the check is run: CMAKE_REQUIRED_FLAGS = string of compile command line flags CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) CMAKE_REQUIRED_INCLUDES = list of include directories Well crap, I saw CMAKE_REQUIRED_INCLUDES, but read it as a -I (include directory) not a specific file to include. I'll give that a try. Thanks, George. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] CHECK_INCLUDE_FILES
Bill, I must be missing something (or there's a bug in CheckIncludeFiles.cmake) CHECK_INCLUDE_FILES(sys/types.h;netinet/tcp.h HAVE_NETINET_TCP_H) SET(HAVE_NETINET_TCP_H ${HAVE_NETINET_TCP_H} CACHE INTERNAL netinet/tcp.h) . . . -- Looking for include files netinet/tcp.h -- Looking for include files netinet/tcp.h - found -- Looking for include files HAVE_SYS_SYSTEMINFO_H -- Looking for include files HAVE_SYS_SYSTEMINFO_H - found I have tried CHECK_INCLUDE_FILES(sys/types.h;netinet/tcp.h HAVE_NETINET_TCP_H) and LIST(APPEND NETINET sys/types.h netinet/tcp.h) CHECK_INCLUDE_FILES(${NETINET} HAVE_NETINET_TCP_H) and LIST(APPEND NETINET sys/types.h) LIST(APPEND NETINET netinet/tcp.h) CHECK_INCLUDE_FILES(${NETINET} HAVE_NETINET_TCP_H) all three of these provide the same results as above (I am using 2.4.8) I am tempted to write a macro with an interface like this, CHECK_INCLUDES( FILES sys/types.h netinet.h VARIABLE HAVE_NETINET_TCP_H) I suspect that might be better (for me anyhow) ... Thoughts? it looks like the list passed in to check_include_files is getting exploded in to three arguments. TIA, George. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Retrieving a named argument from a list
Eric, On Thu, May 8, 2008 at 4:37 AM, Eric NOULARD [EMAIL PROTECTED] wrote: Just for sake of information when I need such feature in an home-brewed MACRO I do use the PARSE_ARGUMENTS macro defined here: http://www.cmake.org/Wiki/CMakeMacroParseArguments which relies on LIST_CONTAINS MACRO defined in http://www.cmake.org/Wiki/CMakeMacroListOperations those old MACROs may be replaced by builtin LIST operation as shown at the end of the Wiki page. Well, that's exactly what I was looking for and is pretty close to what I came up with. I wonder if it's a possibility to have that useful macro included in future CMake distributions? Thanks, George. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Retrieving a named argument from a list
Before that those MACROs needs to be pruned in order to avoid duplicate function with current CMake 2.6 LIST builtin command. Then one (you or me for example) should file something like feature request for including the macros file to CMake distro. Then I think for each such module Kitware may require a maintainer just like for FindXXX: http://www.vtk.org/Wiki/CMake:Module_Maintainers Can anyone at Kitware and/or CMake official developer tell us if it's worth requesting inclusion of such MACROs file or is it better to request a new builtin feature for LIST? I'd be glad to volunteer myself as a maintainer and or patch provider. It seems to me even if LIST was modified to support a BETWEEN function we'd still probably need a macro. Maybe the best solution would be to add a new language command ... GET_NAMED_ARGUMENTS ( NAMES_LIST ). Later, George. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Retrieving a named argument from a list
Alexander, Below is what I have come up with to fetch named arg from a list. Is there a preferred or built-in way to do this I may have missed? There is no built-in way, but it would be nice to have one. Maybe some function for LIST() ? Thanks for confirming this. That'd be nice, maybe LIST(BETWEEN ...) or something like that. I suppose i'll just use the macro for now! :) Thanks much, George. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] ADD_DEFINITIONS in RC10
Brad, You should only see the new behavior if you call cmake_minimum_required(VERSION 2.6) # note value is 2.6 and not 2.4 ... and of course that is what I did! or explicitly set this policy to NEW behavior. Otherwise CMake preserves the old behavior and warns. If you require 2.6 there is also this new feature: http://www.cmake.org/Wiki/CMake_2.6_Notes#Preprocessor_Definitions Thanks! Later, George. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] CMake 2.6.0 RC 10 ready for testing
Hi Bill, On Thu, May 1, 2008 at 2:48 PM, Bill Hoffman [EMAIL PROTECTED] wrote: I am happy to announce that CMake 2.6.0 RC10 is ready for testing. You can find the source and binaries here: http://www.cmake.org/files/v2.6/ Would you be opposed to putting a link to the latest RC on http://www.cmake.org/HTML/Download.html? Thanks, George. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] ADD_DEFINITIONS in RC10
Bill, Seems like RC10 handles quotes differently regarding ADD_DEFINITIONS, e.g. in 2.4 patch 6 ADD_DEFINITIONS( -DSOME_VALUE=\\value\\ ) in 2.6 RC 10 ADD_DEFINITIONS( -DSOME_VALUE=value ) Is this expected? Thanks, George. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] Retrieving a named argument from a list
Hi All, Below is what I have come up with to fetch named arg from a list. Is there a preferred or built-in way to do this I may have missed? MACRO(GET_NAMED_ARG _key) LIST(APPEND STOP_KEYWORDS DEPENDS SOURCE) SET(${_key} FALSE) SET(_stop -1) FOREACH(arg ${ARGN}) IF(NOT ${${_key}}) STRING(COMPARE EQUAL ${arg} ${_key} ${_key}) ELSE(NOT ${${_key}}) IF(${_stop} LESS 0) LIST(FIND STOP_KEYWORDS ${arg} _stop) IF(${_stop} LESS 0) LIST(APPEND ${_key}_ARGS ${arg}) ELSE(${_stop} LESS 0) LIST(FIND STOP_KEYWORDS ${arg} _stop) ENDIF(${_stop} LESS 0) ENDIF(${_stop} LESS 0) ENDIF(NOT ${${_key}}) ENDFOREACH(arg ${ARGN}) ENDMACRO(GET_NAMED_ARG _key) An example, SET(MY_DEPENDS 0 1 2 3 4 ) SET(MY_SOURCES 5 6 7 8 9 ) LIST(APPEND MY_ARGS DEPENDS ${MY_DEPENDS} SOURCE ${MY_SOURCES} ) GET_NAMED_ARG(DEPENDS ${MY_ARGS}) LIST(LENGTH DEPENDS_ARGS DEPENDS_ARG_COUNT) MESSAGE(STATUS DEPENDS_ARGS: ${DEPENDS_ARGS} COUNT: ${DEPENDS_ARG_COUNT}) produces DEPENDS_ARGS: 0;1;2;3;4 COUNT: 5 TIA, George. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] CHECK_FUNCTION_EXISTS
David, Try setting CMAKE_REQUIRED_LIBRARIES to kernel32 (or maybe kernel32.lib?) before checking for Sleep. SET(CMAKE_REQUIRED_LIBRARIES kernel32) CHECK_FUNCTION_EXISTS(Sleep HAVE_SLEEP) Does that work? No, it sure doesn't. Just wondering if I am using this wrong or if it is a bug? Thanks, George. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] CHECK_FUNCTION_EXISTS
Hi CMakers, I feel rather stupid asking this question, but here I go. I have the following simple CMakeLists.txt file (on the windows platform, default MSVC compiler install). C:\Documents and Settings\gneill\Desktop\tmptype CMakeLists.txt PROJECT(GEORGE C) include(CheckFunctionExists) CHECK_FUNCTION_EXISTS(Sleep HAVE_SLEEP) CHECK_FUNCTION_EXISTS(strtod HAVE_STRTOD) Here's the result, C:\Documents and Settings\gneill\Desktop\tmpcmake . -- Check for working C compiler: C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/bin/cl.exe -- Check for working C compiler: C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/bin/cl.exe -- works -- Check size of void* -- Check size of void* - done -- Looking for Sleep -- Looking for Sleep - not found -- Looking for strtod -- Looking for strtod - found -- Configuring done -- Generating done -- Build files have been written to: C:/Documents and Settings/gneill/Desktop/tmp Is there some trick to making it find Sleep() (which is located in windows.h/kernel32.lib)? It's appears to be able to find strtod which is in the CRT. I have also tried adding (below) with no luck, SET(CMAKE_REQUIRED_LIBRARIES kernel32 user32) Here's what I am seeing in CMakeFiles\CMakeError.log Determining if the function Sleep exists failed with the following output: Microsoft (R) Development Environment Version 7.10.6030. Copyright (C) Microsoft Corp 1984-2001. All rights reserved. -- Build started: Project: cmTryCompileExec, Configuration: Debug Win32 -- Compiling... Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.6030 for 80x86 Copyright (C) Microsoft Corporation 1984-2002. All rights reserved. cl /Od /D WIN32 /D _WINDOWS /D CHECK_FUNCTION_EXISTS=Sleep /D _DEBUG /D CMAKE_INTDIR=\Debug\ /D _MBCS /FD /RTCs /MDd /GS /FocmTryCompileExec.dir\ Debug\\ /FdC:/Documents and Settings/gneill/Desktop/tmp/CMakeFiles/CMakeTmp/De bug/cmTryCompileExec.pdb /W3 /c /Zi /TC /Zm1000 \Program Files\CMake 2.4\share\cmake-2.4\Modules\CheckFunctionExists.c CheckFunctionExists.c Linking... CheckFunctionExists.obj : error LNK2019: unresolved external symbol _Sleep referenced in function _main Debug\cmTryCompileExec.exe : fatal error LNK1120: 1 unresolved externals Build log was saved at file://c:\Documents and Settings\gneill\Desktop\tmp\CMakeFiles\CMakeTmp\cmTryCompileExec.dir\Debug\BuildLog.htm cmTryCompileExec - 2 error(s), 0 warning(s) -- Done -- Build: 0 succeeded, 1 failed, 0 skipped Maybe I just have something misconfigured (or missing something simple) .. any suggestions? TIA, George. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] CHECK_FUNCTION_EXISTS
David, Try setting CMAKE_REQUIRED_LIBRARIES to kernel32 (or maybe kernel32.lib?) before checking for Sleep. SET(CMAKE_REQUIRED_LIBRARIES kernel32) CHECK_FUNCTION_EXISTS(Sleep HAVE_SLEEP) Does that work? No, it sure doesn't. I tried SET(CMAKE_REQUIRED_LIBRARIES kernel32) and SET(CMAKE_REQUIRED_LIBRARIES kernel32.lib) as well as the unquoted versions in my previous post. If it's worth anything, this simple program compiles and executes just fine with no additional compiler flags or libraries. Before I run cmake I set up my environment by running the vsvars32.bat file located in the Tools directory of the MSVC install. C:\Documents and Settings\gneill\Desktop\tmptype george.c #include windows.h #include stdio.h int main(int argc, char* argv[]) { fprintf(stdout, sleeping.\n); Sleep(1000); fprintf(stdout, done.\n); return 0; } C:\Documents and Settings\gneill\Desktop\tmpgeorge sleeping. done. TIA, George. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Sun GCC builds (cooltools)
Brad, More info compiling with SUN GCC 4.2 (cooltools) on sun sparc. I think I have narrowed it to HAVE_POSIX_STRERROR_R not being defined in Utilities/cmcurl. It seems strange since it compiles and produces the expected results when I do it by hand. -bash-3.00$ env | grep CC CC=/opt/gcc/bin/gcc -bash-3.00$ $CC -DHAVE_POSIX_STRERROR_R CurlTests.c -bash-3.00$ ./a.out -bash-3.00$ ./a.out ; echo $? 0 This appears to be the cause of my troubles, Linking C executable cmTryCompileExec /export/home/gneill/src/build/Bootstrap.cmk/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec.dir/link.txt --verbose=1 /opt/gcc/bin/gcc -DHAVE_POSIX_STRERROR_R -fPIC CMakeFiles/cmTryCompileExec.dir/CurlTests.c.o -o cmTryCompileExec -ldl -lsocket -lnsl -lcrypto -lssl ld.so.1: cmTryCompileExec: fatal: libcrypto.so.0.9.7: open failed: No such file or directory Child killed libcrypto.so.0.9.7 and libssl.so.0.9.7 are in /usr/sfw/lib on my system (but they are certainly not in my LD_LIBRARY_PATH or system path) so I am not sure why it's trying to use those. -bash-3.00$ crle Default configuration file (/var/ld/ld.config) not found Default Library Path (ELF): /lib:/usr/lib (system default) Trusted Directories (ELF):/lib/secure:/usr/lib/secure (system default) -bash-3.00$ echo $LD_LIBRARY_PATH I will do some more digging ... Thanks, George. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Sun GCC builds (cooltools)
Brad, I will do some more digging ... So this is why the CMake SS12 compile works, -bash-3.00$ /opt/SUNWspro/bin/cc -lcrypto -lssl test.c ld: fatal: library -lcrypto: not found ld: fatal: library -lssl: not found ld: fatal: File processing errors. No output written to a.out and this is why the SUN GCC 4.2.0 (cooltools) compile fails. -bash-3.00$ /opt/gcc/bin/gcc -lcrypto -lssl test.c -bash-3.00$ ./a.out ld.so.1: a.out: fatal: libcrypto.so.0.9.7: open failed: No such file or directory Killed The pre-installed /usr/sfw/bin/gcc (3.4.3) compiles/runs just fine. -bash-3.00$ /usr/sfw/bin/gcc -lcrypto -lssl test.c -bash-3.00$ ./a.out Hello there. So I guess the temporary fix is to just .. export LD_LIBRARY_PATH=/usr/sfw/lib:$LD_LIBRARY_PATH before the bootstrap. Later, George. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Sun GCC builds (cooltools)
Brad, This proved to be useful for me, if it is worth including ... -bash-3.00$ cvs diff CMakeLists.txt Index: CMakeLists.txt === RCS file: /cvsroot/CMake/CMake/Utilities/cmcurl/CMakeLists.txt,v retrieving revision 1.19 diff -r1.19 CMakeLists.txt 521a522,526 IF(${${CURL_TEST}} MATCHES FAILED_TO_RUN) MESSAGE(FATAL_ERROR Unable to run test for ${CURL_TEST}. Command output is ${OUTPUT}) ENDIF(${${CURL_TEST}} MATCHES FAILED_TO_RUN) ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Sun GCC builds (cooltools)
Bill, Sounds like the pre-installed gcc is broken. That path should be in some sort of system path. Thanks for looking into this. You bet. The pre-installed (gcc 3.4.3) works fine. But it looks like the SUN gcc 4.2.0 cooltools compiler has some kind of pathing issue going on with it (or I have screwed something up! .. which is quite possible). I suppose we'll find out. http://forum.java.sun.com/thread.jspa?threadID=5277589 Later, George. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] INCLUDE_DIRECTORIES and FIND_PATH
Hi! FIND_PATH(GN NAMES include PATHS /tmp ) I see I am using this wrong, my apologies. Thanks, George. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] Sun GCC builds (cooltools)
Hi CMakers, I am building cmake on a Sun Enterprise 220R with 2GB of RAM running Solaris 10 08/07. I have two compilers installed on this box. 1. SunStudio 12 -bash-3.00$ /opt/SUNWspro/bin/CC -V CC: Sun C++ 5.9 SunOS_sparc Patch 124863-01 2007/07/25 2. The SUN modified gcc compiler v4.2.0 -- http://cooltools.sunsource.net/gcc sparc-sun-solaris2.10-gcc (GCC) 4.2.0 (gccfss) Copyright (C) 2007 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. When compiling with #1, bootstrap / make ... worked and all tests passed for both in-source and out-of-source bootstrap builds. When compiling with #2, an in-source ./bootstrap fails with the following error export CC=/opt/gcc/bin/gcc export CXX=/opt/gcc/bin/g++ cvs co CMake cd CMake ./bootstrap . . Undefined first referenced symbol in file cmELF::GetSOName(std::basic_stringchar, std::char_traitschar, std::allocatorchar )cmSystemTools.o cmELF::GetRPath() cmSystemTools.o cmELF::cmELF(char const*) cmSystemTools.o cmELF::Valid() constcmSystemTools.o cmELF::GetRunPath() cmSystemTools.o cmELF::~cmELF() cmSystemTools.o ld: fatal: Symbol referencing errors. No output written to cmake however an out-of-source bootstrap appears to succeed, cvs co CMake mkdir CMake.build cd CMake.build ../CMake/bootstrap ... but make then fails with, [ 31%] Building C object Utilities/cmcurl/CMakeFiles/cmcurl.dir/strdup.o [ 31%] Building C object Utilities/cmcurl/CMakeFiles/cmcurl.dir/strequal.o [ 31%] Building C object Utilities/cmcurl/CMakeFiles/cmcurl.dir/strerror.o /export/home/gneill/src/CMake/Utilities/cmcurl/strerror.c:28:2: error: #error you MUST have either POSIX or glibc strerror_r if strerror_r is found /export/home/gneill/src/CMake/Utilities/cmcurl/strerror.c: In function 'Curl_strerror': /export/home/gneill/src/CMake/Utilities/cmcurl/strerror.c:649: warning: initialization makes pointer from integer without a cast *** Error code 1 I am willing to set up nightly builds on this machine and report results to the cmake dashboard ... if you are interested. Thanks, George. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] /MACHINE:x64
Hi CMakers! I am trying to compile on a 64 bit windows machine (AMD64). It seems CMake only outputs /MACHINE:X64 for the link flags. However, link.exe reports that flag doesn't exist. Is this a bug? I am using, cmake version 2.4-patch 7 cl.exe Microsoft (R) C/C++ Optimizing Compiler Version 14.00.40310.41 for AMD64 Copyright (C) Microsoft Corporation. All rights reserved. link.exe Microsoft (R) Incremental Linker Version 8.00.40310.39 Copyright (C) Microsoft Corporation. All rights reserved. options for /MACHINE: from link.exe /? /MACHINE:{AM33|AMD64|ARM|CEE|EBC|IA64|M32R|MIPS|MIPS16|MIPSFPU|MIPSFPU16| MIPSR41XX|SH4|SH5|THUMB|X86} Let me know if you need more info. Thanks, George. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] /MACHINE:x64
Hi Bill, Thanks for responding. What version of the compiler do you have? With vs 2005, which was the first one we supported 64 bit builds, I get this: Windows Server 2003 SP1 Platform SDK and the Visual C++ toolkit 2003. The following link appears to be similar to issue(s) I am having ... http://www.planetamd64.com/lofiversion/index.php?t5878.html $ link /? Microsoft (R) Incremental Linker Version 8.00.50727.762 Copyright (C) Microsoft Corporation. All rights reserved. /MACHINE:{ARM|EBC|IA64|MIPS|MIPS16|MIPSFPU|MIPSFPU16| SH4|THUMB|X64|X86} Exactly what steps are you taking for running cmake, and installing the compiler? cd out_of_source_build_dir cmake -GNMake Makefiles -DCMAKE_BUILD_TYPE=Release ..\src I will have to get back to you on the steps to install the compiler (because I didn't install it). But I can tell you a simple hello world! c program compiles and runs just fine when compiled by hand. I was able to get past the /machine:x64 issue, by changing Windows-cl.cmake. But now I am running in to RTC error unresolved external symbol _RTC_Shutdown when running cmake which I think is caused by (a previous post of mine) http://www.cmake.org/pipermail/cmake/2007-December/018866.html. TIA, George. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] cmTryCompileExec.exe error
Hi CMakers, I am trying to compile on windows in 'Release' mode. I am getting a error about a missing MSVCR71D.dll debug library (which I presume might be a bad compiler install or some crafty person making sure we don't build against debug libs). Anyhow, I can build a simple hello world program and it executes properly without the /MDd flag by hand. When I am trying to preform platform checks ... it appears cmTryCompileExec.exe does not utilize the -DCMAKE_BUILD_TYPE define/flags. What can I do to force it to use the CMAKE_BUILD_TYPE settings? Please let me know if you need more information. TIA, George. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] ADD_SUBDIRECTORY
Hi Brandon, Because having a subdirectory doesn't imply that you're going to do anything there. It could just be an intermediate part of your source tree. Perhaps the CMakeLists.txt in that subdirectory merely contains more ADD_SUBDIRECTORY commands. In the example I provided, I tried to depicted that case. I guess by issuing the ADD_SUBDIRECTORY() ( along with a PROJECT() ) I am implicitly saying there's going to be a collection of stuff built under this project. It makes sense (to me) CMake could automatically generate a psuedo-target (synonomous with a make all for a subproject I suppose). Just an idea! It would have saved me (and a co-worker) a few minutes yesterday. :) TIA, George. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] ADD_SUBDIRECTORY
Hi CMakers, I have a simple example. I am curious why CMake doesn't automatically build a psuedo-target when an ADD_SUBDIRECTORY is issued? In the end, I want be able to type 'make libs'. I was able to get it to work by adding ADD_CUSTOM_TARGET(libs DEPENDS A B), but adding it seems somewhat redundant. example/CMakeLists.txt contains, PROJECT(EXAMPLE C) ADD_SUBDIRECTORY(libs) ADD_CUSTOM_TARGET(libs DEPENDS A B) example/libs/CMakeLists.txt contains, PROJECT(LIBS C) ADD_SUBDIRECTORY(A) ADD_SUBDIRECTORY(B) example/libs/A/CMakeLists.txt contains PROJECT(A C) ADD_EXECUTABLE(A A.c) example/libs/B/CMakeLists.txt contains PROJECT(B C) ADD_EXECUTABLE(B B.c) TIA, George. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] CMake with Lua Experiment
Hi CMakers! Being relatively new to CMake (3 months now), this whole LUA discussion seems very odd ... (so please accept an apology for my ignorance in advance) An additional thought is to export global constants (variables), so we can basically create keywords. So instead of: cm_add_library( simpleLib, STATIC, sources) we could drop the quotes around STATIC: cm_add_library( simpleLib, STATIC, sources) Maybe I am missing the obvious, but I am trying to understand -why- this list is talking about replacing the current CMake language. As it seems everyone is trying to retrofit the would be new language to be just like the current language. I do understand the want (need?) to retain backwards compatibility, but a fork-lift replacment of the current language sounds like a bad idea; if that is indeed the goal. Thanks, George. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] CMake with Lua Experiment
Brandon, On 11/28/07, Brandon Van Every [EMAIL PROTECTED] wrote: - better scoping - higher quality, outsourced documentation - outsource core language bugs - popularity boost for 5 years - some advanced programming constructs gained I certainly can't debate those (unless CMake developers make significant changes to the core LUA libraries). Is backward compatibility with the current language a goal of the LUA experiment? I ask because the examples spoken of on this list appear to be trying to mimic the current CMake syntax. Thanks, George. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] ADD_DIRECTORY
Hi, I am relatively new to cmake, thanks for the cool product ... I have have fun using it thus far. I have ran in to a problem, on windows, with relative out-of-source builds. C:\DOCUME~1\GEORGE~1\Desktopcmake -version cmake version 2.4-patch 7 Here are the commands I have been using to build my project cmake -GNMake Makefiles ..\project nmake For some reason the path is -different- upon use of the ADD_SUBDIRECTORY() function. I have searched through the archives and found a couple of conversations about something similar, but not quite the same. http://public.kitware.com/pipermail/cmake/2007-August/015641.html. It appears the ADD_SUBDIRECTORY() call is somehow getting the scrunched 8.3names; and I imagine is what causes cmake to fail. The error I am getting. C:/Documents and Settings/George Neill/Desktop/project/test is not a subdirectory of C:/DOCUME~1/GEORGE~1/Desktop/project. I was able to get around it by just specifiying the full path to my source code. But I am now wondering if I am using CMake wrong, or if this is just a bug? TIA, George. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] ADD_SUBDIRECTORY() / windows path
Hi, I am relatively new to cmake, thanks for the cool product ... I have have fun using it so far. I have ran in to a problem, on windows xp, with relative out-of-source builds. C:\DOCUME~1\GEORGE~1\Desktopcmake -version cmake version 2.4-patch 7 Here are the commands I have been using to build my project cmake -GNMake Makefiles ..\project nmake For some reason the path is -different- upon use of the ADD_SUBDIRECTORY() function. I have searched through the archives and found a couple of conversations about something similar, but not quite the same. http://public.kitware.com/pipermail/cmake/2007-August/015641.html. It appears the ADD_SUBDIRECTORY() call is somehow getting the scrunched 8.3names; and I imagine is what causes cmake to fail. The error I am getting. C:/Documents and Settings/George Neill/Desktop/project/test is not a subdirectory of C:/DOCUME~1/GEORGE~1/Desktop/project. I was able to get around it by just specifiying the full path to my source code. But I am now wondering if I am using CMake wrong, or is this just a bug? TIA, George. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] VC++ 5.0 Express
Hi All, I am new to cmake, thank you for the awesome product. I am using the free VC++ 5.0 Express with the Platform SDK, I am curious why cmake doesn't report this as the free VC compiler? I am using cmake version 2.4-patch 7. C:\DOCUME~1\GEORGE~1\Desktop\buildcmake -GNMake Makefiles ..\src -- Check for CL compiler version -- Check for CL compiler version - 1400 -- Check if this is a free VC compiler -- Check if this is a free VC compiler - no -- Check CL platform -- Check CL platform - 32 bit -- Check for working C compiler: C:/Program Files/Microsoft Visual Studio 8/VC/b in/cl.exe -- Check for working C compiler: C:/Program Files/Microsoft Visual Studio 8/VC/b in/cl.exe -- works -- Check size of void* -- Check size of void* - done . . . TIA, George. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake