Re: [CMake] DLL import/export flag differentiation
On Nov 24, 2007 7:53 PM, Nicholas Yue <[EMAIL PROTECTED]> wrote: > > I understand that there is no per target DEFINITIONS setup so I'd like to > hear advice from experience cmake user how I should configure my build. There is, however, a REMOVE_DEFINITIONS command, which you could use judiciously to achieve the effect. You'd have to be careful though. > The library needs the -DDLL_EXPORT while the application must not have > that set so that it imports the exported symbols. If that's the extent of your problem, then it's easy. Remember that order of appearance in CMakeLists.txt does matter. You'd do: ADD_DEFINITIONS, ADD_LIBRARY, REMOVE_DEFINITIONS, ADD_EXECUTABLE. Cheers, Brandon Van Every ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Changing compiler at runtime
On Nov 25, 2007 2:12 AM, Gonzalo Garramuño <[EMAIL PROTECTED]> wrote: > > Recently, Josef Karthauser was requesting the ability to change the > compiler at runtime. > > I am now more or less seconding that request or asking for workarounds. > > The situation: > I have a complex project built for windows that has several plug-ins > that, for each version of the project, needs to be compiled with a > particular compiler version to keep binary compatibility. Thus, my v3.0 > needs to be built against vc6, my v4.0 against vc7.1, my v5.0 against > vc8, etc. > I am automating the build process for each build as an out of source > build, but I also need to automate the changing of the compiler. I don't get it. Why do you need to resolve any of this at runtime? Resolve it 5 times at configuration time, run 5 different configurations. It would be 10 lines in your favorite scripting language. Could invoke with "cmake -P mybuildscript" if you don't mind CMake script and don't want another language dependency. Cheers, Brandon Van Every ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] Changing compiler at runtime
Recently, Josef Karthauser was requesting the ability to change the compiler at runtime. I am now more or less seconding that request or asking for workarounds. The situation: I have a complex project built for windows that has several plug-ins that, for each version of the project, needs to be compiled with a particular compiler version to keep binary compatibility. Thus, my v3.0 needs to be built against vc6, my v4.0 against vc7.1, my v5.0 against vc8, etc. I am automating the build process for each build as an out of source build, but I also need to automate the changing of the compiler. -- Gonzalo Garramuño [EMAIL PROTECTED] AMD4400 - ASUS48N-E GeForce7300GT Xubuntu Gutsy ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Can't set EXECUTABLE_OUTPUT_PATH ?
On Nov 24, 2007 4:52 PM, Convey Christian J NPRI <[EMAIL PROTECTED]> wrote: > Hi guys, > > I'm using CMake 2.4-7 on Ubuntu Linux 7.10. I have a trivial CMakeLists.txt > file in which I'm just trying to specify where my build programs will go. > (This is a distilled version of a larger, actually useful CMakeLists.txt > file.): > > PROJECT(IVP_LOCAL) > SET(EXECUTABLE_OUTPUT_PATH ${IVP_LOCAL_SOURCE_DIR}/bin) > MESSAGE("EXECUTABLE_OUTPUT_PATH = " ${EXECUTABLE_OUTPUT_PATH}) Try the following: SET(EXECUTABLE_OUTPUT_PATH ${IVP_LOCAL_SOURCE_DIR}/bin CACHE PATH "Single output directory for building all executables.") > My problem is this: When I run cmake, I get the following output, which is > what I was hoping for: > > -- Check for working C compiler: /usr/bin/gcc > -- Check for working C compiler: /usr/bin/gcc -- works > EXECUTABLE_OUTPUT_PATH = /home/cjc/moos-ivp-local/trunk/src/bin > -- Configuring done > -- Generating done > -- Build files have been written to: /home/cjc/moos-ivp-local/trunk/src > > But then when I run "ccmake ./", the variable EXECUTABLE_OUTPUT_PATH appears > to be unset! > > Does anyone know why I might be seeing this? EXECUTABLE_OUTPUT_PATH is a cache variable so you need to use this version. The problem you are having is due to having a non-cache variable named the same as your cache variable... ccmake will use the cache, while message(...) is printing the non-cached version. --Miguel ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] DLL import/export flag differentiation
Hi, I am attempting to migrate the ANN build to CMake for my own ease of cross platform maintenance. The cmake configuration works fine on OSX but have problem Windows because of the additional linkage requirement. I understand that there is no per target DEFINITIONS setup so I'd like to hear advice from experience cmake user how I should configure my build. The library needs the -DDLL_EXPORT while the application must not have that set so that it imports the exported symbols. At the moment, my build fails at the ann_test target because it inherits the -DDLL_EXPORT flag from the top. Regards 8<--8<--8<--8<--8<--8<--8<--8<--8<--8<-- PROJECT (ANN) INCLUDE_DIRECTORIES ( ../include ) IF (WIN32) ADD_DEFINITIONS ( -DDLL_EXPORTS -DANN_PERF -DANN_NO_RANDOM -D_CRT_SECURE_NO_DEPRECATE ) SET ( LIBRARY_TYPE SHARED ) ELSE (WIN32) SET ( LIBRARY_TYPE STATIC ) ENDIF (WIN32) ADD_LIBRARY ( ANN ${LIBRARY_TYPE} ../src/ANN.cpp ../src/bd_fix_rad_search.cpp ../src/bd_pr_search.cpp ../src/bd_search.cpp ../src/bd_tree.cpp ../src/brute.cpp ../src/kd_dump.cpp ../src/kd_fix_rad_search.cpp ../src/kd_pr_search.cpp ../src/kd_search.cpp ../src/kd_split.cpp ../src/kd_tree.cpp ../src/kd_util.cpp ../src/perf.cpp ) ADD_EXECUTABLE ( ann_test ../test/ann_test.cpp ../test/rand.cpp ) ADD_EXECUTABLE ( ann_sample ../sample/ann_sample.cpp ) ADD_EXECUTABLE ( ann2fig ../ann2fig/ann2fig.cpp ) TARGET_LINK_LIBRARIES ( ann_test ANN ) TARGET_LINK_LIBRARIES ( ann_sample ANN ) TARGET_LINK_LIBRARIES ( ann2fig ANN ) INSTALL ( TARGETS ann_test ann_sample ann2fig ANN RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] Patch to FindQt4.cmake for supporting moc compiler options
Hello, I would like to propose the following patch or something similar to add support for moc compiler options. Currently, one can do the following: SET(moc-sources foo.h bar.h) QT4_WRAP_CPP(sources ${moc-sources}) With the attached patch one could pass also options to be invoked with each moc-source: QT4_WRAP_CPP(sources ${moc-sources} OPTIONS -DMYDEF) The current approach is a simplified one to support the following syntax: QT4_WRAP_CPP( [OPTIONS opt1 opt2 ...]) This could also be applied to QT4_WRAP_UI(...). --Miguel FindQt4.cmake.patch Description: Binary data ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] Can't set EXECUTABLE_OUTPUT_PATH ?
Hi guys, I'm using CMake 2.4-7 on Ubuntu Linux 7.10. I have a trivial CMakeLists.txt file in which I'm just trying to specify where my build programs will go. (This is a distilled version of a larger, actually useful CMakeLists.txt file.): PROJECT(IVP_LOCAL) SET(EXECUTABLE_OUTPUT_PATH ${IVP_LOCAL_SOURCE_DIR}/bin) MESSAGE("EXECUTABLE_OUTPUT_PATH = " ${EXECUTABLE_OUTPUT_PATH}) My problem is this: When I run cmake, I get the following output, which is what I was hoping for: -- Check for working C compiler: /usr/bin/gcc -- Check for working C compiler: /usr/bin/gcc -- works -- Check size of void* -- Check size of void* - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works EXECUTABLE_OUTPUT_PATH = /home/cjc/moos-ivp-local/trunk/src/bin -- Configuring done -- Generating done -- Build files have been written to: /home/cjc/moos-ivp-local/trunk/src But then when I run "ccmake ./", the variable EXECUTABLE_OUTPUT_PATH appears to be unset! Does anyone know why I might be seeing this? Thanks, Christian Christian Convey Scientist, Naval Undersea Warfare Centers Newport, RI smime.p7s Description: S/MIME cryptographic signature ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake